Author: Antti Tiainen <atiainen(a)forcepoint.com>
Date: 2016-03-02 (Wed, 02 Mar 2016)
teamd: do correct l3/l4 tx hashing with vlans
bpf_create_code() is not creating correct hashing code with vlan tagged
packets. L3/l4 headers are not included to hash even when configured.
There were three problems:
- VLAN_HEADER_SIZE is wrong. But this doesn't really matter because...
- if vlan tagging is offloaded, generated code will find skb->vlan_tci
and incorrectly skip non-existent vlan header, failing to find l3 protocol
- if vlan tagging is not offloaded, skb->vlan_tci is zeroed in kernel
after call to __vlan_put_tag(). Hashing code will not skip VLAN header,
failing again to find l3 protocol
bpf code must look first for VLAN proto (0x8100) and read the vlan tag
from header instead of skb->vlan_tci, and in this case use the correct
offset (4) for vlan shift. If VLAN header is not present in packet,
skb->vlan_tci must still be checked in case of offloaded vlan header.
Signed-off-by: Antti Tiainen <atiainen(a)forcepoint.com>
Acked-by: Flavio Leitner <fbl(a)sysclose.org>
Signed-off-by: Jiri Pirko <jiri(a)mellanox.com>