kernel_optimize_test/net
Alexei Starovoitov e430f34ee5 net: filter: cleanup A/X name usage
The macro 'A' used in internal BPF interpreter:
 #define A regs[insn->a_reg]
was easily confused with the name of classic BPF register 'A', since
'A' would mean two different things depending on context.

This patch is trying to clean up the naming and clarify its usage in the
following way:

- A and X are names of two classic BPF registers

- BPF_REG_A denotes internal BPF register R0 used to map classic register A
  in internal BPF programs generated from classic

- BPF_REG_X denotes internal BPF register R7 used to map classic register X
  in internal BPF programs generated from classic

- internal BPF instruction format:
struct sock_filter_int {
        __u8    code;           /* opcode */
        __u8    dst_reg:4;      /* dest register */
        __u8    src_reg:4;      /* source register */
        __s16   off;            /* signed offset */
        __s32   imm;            /* signed immediate constant */
};

- BPF_X/BPF_K is 1 bit used to encode source operand of instruction
In classic:
  BPF_X - means use register X as source operand
  BPF_K - means use 32-bit immediate as source operand
In internal:
  BPF_X - means use 'src_reg' register as source operand
  BPF_K - means use 32-bit immediate as source operand

Suggested-by: Chema Gonzalez <chema@google.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Chema Gonzalez <chema@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-06-11 00:13:16 -07:00
..
9p
802
8021q
appletalk
atm
ax25
batman-adv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-03 23:32:12 -07:00
bluetooth Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2014-06-05 14:10:07 -04:00
bridge bridge: memorize and export selected IGMP/MLD querier port 2014-06-10 23:50:47 -07:00
caif
can
ceph
core net: filter: cleanup A/X name usage 2014-06-11 00:13:16 -07:00
dcb
dccp
decnet
dns_resolver dns_resolver: Do not accept domain names longer than 255 chars 2014-06-05 00:05:53 -07:00
dsa
ethernet
hsr
ieee802154
ipv4 gre: allow changing mac address when device is up 2014-06-10 22:46:42 -07:00
ipv6 ipv6: Shrink udp_v6_mcast_next() to one socket variable 2014-06-05 16:23:08 -07:00
ipx
irda
iucv
key
l2tp l2tp: call udp{6}_set_csum 2014-06-04 22:46:38 -07:00
lapb
llc
mac80211
mac802154 mac802154: llsec: add forgotten list_del_rcu in key removal 2014-06-06 16:25:37 -07:00
mpls gre: Call gso_make_checksum 2014-06-04 22:46:38 -07:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2014-06-05 15:35:04 -07:00
netlabel
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-03 23:32:12 -07:00
netrom
nfc
openvswitch vxlan: Add support for UDP checksums (v4 sending, v6 zero csums) 2014-06-04 22:46:39 -07:00
packet
phonet
rds
rfkill
rose
rxrpc
sched net: use the new API kvfree() 2014-06-05 00:49:51 -07:00
sctp
sunrpc
tipc
unix
vmw_vsock
wimax
wireless
x25
xfrm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-03 23:32:12 -07:00
compat.c
Kconfig
Makefile
nonet.c
socket.c
sysctl_net.c