All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@fomichev.me>
To: YueHaibing <yuehaibing@huawei.com>
Cc: davem@davemloft.net, sdf@google.com, jianbol@mellanox.com,
	jiri@mellanox.com, mirq-linux@rere.qmqm.pl, willemb@google.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] flow_dissector: Fix vlan header offset in __skb_flow_dissect
Date: Wed, 19 Jun 2019 11:39:38 -0700	[thread overview]
Message-ID: <20190619183938.GA19111@mini-arch> (raw)
In-Reply-To: <20190619160132.38416-1-yuehaibing@huawei.com>

On 06/20, YueHaibing wrote:
> 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);
> +
Should we instead fix the place where the skb is allocated to properly
pull vlan (skb_vlan_untag)? I'm not sure this particular place is
supposed to work with an skb. Having an skb with nhoff pointing to
IP header but missing skb_vlan_tag_present() when with
proto==ETH_P_8021xx seems weird.

>  			vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
>  						    data, hlen, &_vlan);
>  			if (!vlan) {
> -- 
> 2.7.0
> 
> 

  reply	other threads:[~2019-06-19 18:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 16:01 [PATCH] flow_dissector: Fix vlan header offset in __skb_flow_dissect YueHaibing
2019-06-19 18:39 ` Stanislav Fomichev [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619183938.GA19111@mini-arch \
    --to=sdf@fomichev.me \
    --cc=davem@davemloft.net \
    --cc=jianbol@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=willemb@google.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.