Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1605709ybi; Thu, 20 Jun 2019 00:20:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaAiL65yb+Ojf3KevehaUgLOX4vdL5KoscvQa6Lz8BCeGi8Gnwl7OmNHfH+0FV4XNEWzBu X-Received: by 2002:a62:e801:: with SMTP id c1mr105633800pfi.41.1561015254049; Thu, 20 Jun 2019 00:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561015254; cv=none; d=google.com; s=arc-20160816; b=c4Kzg9VuzMh+XMZYVrvI9rgfPe9v7IyeNfs9vsj2aVS9GIPdZ61HsRXWm717hC/Brg dPusI0aRrZuhf65dpFNR5etg+oi6l8bHnOmW7bSNZIqTUvpm7B4b12GdNxwhJE4eG0j5 /LX05caYxROeLobbbP34xcQb2k+25IGdeULxer3YZERyMCZgAl7r9gB4gTOtnCrZFpXB dydeme9PjJLSQmV7qPVj+8b5M2GDQcMDzyl2jII5vAH6cqWpqUdSH8TVy0j6J+cdjJHi MXmD++BHmTdiM+1v1zS/BhuaflV2J4Nh6UHDROBTpzWIe9dbXYZGJfMi1PkxT0gyQlDM M3sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5+cZZQUiAbSFZ5vyqDnl6i0sE8+BN4xzCapTjFH6GZ0=; b=h6uYYIq/DoD5eswo+Xff8gW5aYeQzzeEAlruzwgczu44UjL/19DNU+OzdZ4PIQ6aB3 Fi7bkGObBQ/GEFnYRWGAjIfeVcjeUt96265I8HSs1McmbkXsHmNlULiak+PVv+jWCwh7 0nyc1CZJ31eAPc+EHjcXDRO/O3mPDX7u52U1c6xuV/d8uoek5V7XBSxtNJzSBCO48K8C pZU/yUE/dqG8ioeaCv1XUe5GRxh6y83FrcOSMyUVZmefs0aVI+pacKmkkHUiHNs/xUKR 7LEWNRacodE5EE+UKbBoglWguzQsJqkk6O0waD6S7Icswtrpqant6riAW0OwKhRnlQvY Zo5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=NKyS9gvG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si5028579pgu.68.2019.06.20.00.20.37; Thu, 20 Jun 2019 00:20:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=NKyS9gvG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbfFTHUN (ORCPT + 99 others); Thu, 20 Jun 2019 03:20:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37228 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfFTHUM (ORCPT ); Thu, 20 Jun 2019 03:20:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id v14so1844995wrr.4 for ; Thu, 20 Jun 2019 00:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5+cZZQUiAbSFZ5vyqDnl6i0sE8+BN4xzCapTjFH6GZ0=; b=NKyS9gvG9OoNVIU+wvtPkKl9LryqEO3a6YKp09Ltgm2Fy2zXIaW8+E4EQ12u7PS2e5 8SdpcYMCN6RM9rvJzkG08F/aN5s6RwMWqJBrW6VgRebiPjO4Cn/K87QL7bLl9IHdCIhn UPNizEIG4VXvN0Hn+imu5VErvswc4D7xZte6EuJyp/h0q/Y3YHkIMjmrCjEZiUbUvF6Y ruTi9vRSxs7IkMW0vU9Tagcc4F4LV1PGouu5bl7W1pU+LpTWskTQrVAI99PkoEWuJX7/ hIINIgntTJZjYDmA3oVCKI8raOCSyNQSnoDdAO+rvA/gM70m8rf5V/g14DMv3MTB7YGY 0SlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5+cZZQUiAbSFZ5vyqDnl6i0sE8+BN4xzCapTjFH6GZ0=; b=O85wt7o24eXbTtbnApCP2JBvYKA3awz5HaIjUNn7dqp+PkIH0PyKCHwvJU6+2UuWc+ yIeikTQER7XGn/RxCZYP+gavhOAsSX6E+1KsToCPPsSL4T/l7NRzUdva72DzkgpLIFlM qF/B87mlitcFTwQgMv7mHjG9sYK1XRWO9BRRrp5E2SGk5Vha2G3ysmbrKuyDvZnngowS q5hzJR6deOf8Oe3b1WN3thH+DSIsrJOGYhltCVyMrWCH/B+qcybTvugu3OadS2LaVoST h/5FB559dCKv6/zyof8jd0ttjIn4O7M1EvVqQ9v5loL22S6x4tguB3MfqGl8i3vJ6Exy OQ9w== X-Gm-Message-State: APjAAAUfXQsVOOjmD28A3yr1iVevkrL7MLeA0HIHAO7U/rzM1afCpB/f 3g/4ABNvbVvwf8jHymMJPFxqGQ== X-Received: by 2002:a05:6000:100a:: with SMTP id a10mr20639918wrx.154.1561015210289; Thu, 20 Jun 2019 00:20:10 -0700 (PDT) Received: from localhost (ip-78-45-163-56.net.upcbroadband.cz. [78.45.163.56]) by smtp.gmail.com with ESMTPSA id f204sm5291869wme.18.2019.06.20.00.20.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 20 Jun 2019 00:20:09 -0700 (PDT) Date: Thu, 20 Jun 2019 09:20:09 +0200 From: Jiri Pirko To: Stanislav Fomichev Cc: YueHaibing , 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 Message-ID: <20190620072009.GA2504@nanopsycho> References: <20190619160132.38416-1-yuehaibing@huawei.com> <20190619183938.GA19111@mini-arch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190619183938.GA19111@mini-arch> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Jun 19, 2019 at 08:39:38PM CEST, sdf@fomichev.me wrote: >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 >> --- >> 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 Yes. >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 >> >>