netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] flow_dissector: Fix vlan header offset in __skb_flow_dissect
@ 2019-06-19 16:01 YueHaibing
  2019-06-19 18:39 ` Stanislav Fomichev
  2019-06-22 23:19 ` [PATCH] flow_dissector: Fix vlan header offset in __skb_flow_dissect David Miller
  0 siblings, 2 replies; 18+ messages in thread
From: YueHaibing @ 2019-06-19 16:01 UTC (permalink / raw)
  To: davem, sdf, jianbol, jiri, mirq-linux, willemb
  Cc: linux-kernel, netdev, YueHaibing

We build vlan on top of bonding interface, which vlan offload
is off, bond mode is 802.3ad (LACP) and xmit_hash_policy is
BOND_XMIT_POLICY_ENCAP34.

__skb_flow_dissect() fails to get information from protocol headers
encapsulated within vlan, because 'nhoff' is points to IP header,
so bond hashing is based on layer 2 info, which fails to distribute
packets across slaves.

Fixes: d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/core/flow_dissector.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 415b95f..2a52abb 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -785,6 +785,9 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 		    skb && skb_vlan_tag_present(skb)) {
 			proto = skb->protocol;
 		} else {
+			if (dissector_vlan == FLOW_DISSECTOR_KEY_MAX)
+				nhoff -=  sizeof(*vlan);
+
 			vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
 						    data, hlen, &_vlan);
 			if (!vlan) {
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-06-27  7:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 16:01 [PATCH] flow_dissector: Fix vlan header offset in __skb_flow_dissect YueHaibing
2019-06-19 18:39 ` Stanislav Fomichev
2019-06-20  7:20   ` Jiri Pirko
2019-06-20 10:02   ` Yuehaibing
2019-06-21  0:33     ` Stanislav Fomichev
2019-06-24 13:50       ` Jiri Pirko
2019-06-26  8:08         ` [PATCH] bonding: Always enable vlan tx offload YueHaibing
2019-06-26 15:25           ` Jiri Pirko
2019-06-26 15:29             ` Yuehaibing
2019-06-26 16:13           ` mirq-linux
2019-06-26 16:48             ` Jiri Pirko
2019-06-26 23:29               ` Michał Mirosław
2019-06-26 16:03         ` [PATCH] team: " YueHaibing
2019-06-26 17:14           ` David Miller
2019-06-22 23:19 ` [PATCH] flow_dissector: Fix vlan header offset in __skb_flow_dissect David Miller
2019-06-24  3:49   ` [PATCH v2] " YueHaibing
2019-06-27  2:28     ` David Miller
2019-06-27  7:44       ` Jiri Pirko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).