Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1022738ybd; Wed, 26 Jun 2019 09:49:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4E5mDhk1Nc2+3DWwtPicQJPfsRDg2AlpTgqa8ELNwfhN8lqkPP+OwjDJHTK967m1ADrLQ X-Received: by 2002:a63:3f48:: with SMTP id m69mr3788021pga.17.1561567776588; Wed, 26 Jun 2019 09:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561567776; cv=none; d=google.com; s=arc-20160816; b=0BI0gK1TdjfJ5CdVVW5I3+wOof9eY0Uzc6jq8teYfL/4iA6aDPvjcxhYzQw9dqNFKt 54tR3le1ADYwjMBvFqgdV2sQIGoWr9Cl3QYYfjRLNrsiOVTx0QOz3vE48XBGCxHOXGOm nNtX3+hDjCLfEnXfnsLF+i28i3RNceUZUhljNKKDSVGHTLqcZ+S/5OC5NU/FnpylJfbP 2/A6Qq6ePthMViMME+cwS+9iF/PwUsW46uju7/F+TdYlshzvxNQtXUpL3g7EemaqMer+ lSaERr/NMnxUckwkD018a43g3/ZJG99qXSIwZvWCyuQ7oDHODFHcSKvjF1kmKe631pSx ckbQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OoEaJv7aaqTqsijzQaaYdkI+HMpgRA4Nz4+oOvolsqU=; b=EX11dbiB1u6EqpUG14k2Ri7uNwxcsjPp5lYuV8zrbFrZoy6ZmxQdwFw+czLOyTr+1x ZSWNgCrC4E8f4CBlIbPttgE3HCZynecTTR16DJI742QlA7vBPYNKE9plRuUsMjSGY1Nm IiUfU/KhC3ZA+qufHfllVEx/h0liMQNSSoWHRFVBUFAA+X4We+BAPtV8wD8hY0zjnZeE NpihIK7IVCL1ND4Fkwqd2koamchUK6da0nLZaR6MVZ8iYZ2zzh83VJPNhoaUY0BbhXDB JV+xk/okL5amaezP8GYg2U/VQaBPxW6+wZz/2VFh+UuM4T5p+q1Sp+MQ1HetmYnHVQoF 3A9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=dG0Kh3Lo; 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 x21si2455875pjt.37.2019.06.26.09.49.19; Wed, 26 Jun 2019 09:49:36 -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=dG0Kh3Lo; 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 S1726500AbfFZQs6 (ORCPT + 99 others); Wed, 26 Jun 2019 12:48:58 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46604 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbfFZQs5 (ORCPT ); Wed, 26 Jun 2019 12:48:57 -0400 Received: by mail-wr1-f67.google.com with SMTP id n4so3501739wrw.13 for ; Wed, 26 Jun 2019 09:48:55 -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:content-transfer-encoding:in-reply-to :user-agent; bh=OoEaJv7aaqTqsijzQaaYdkI+HMpgRA4Nz4+oOvolsqU=; b=dG0Kh3Lo3L+KjkpWUyRqJHULACKCqOiHDzKZMCIhv80+LK5mAayW0rFQ63wrU0q4x8 Q0BbXgQ+irrQMzb0OW7JXp4ad13a6m5qbyVXQ36STSmCHIgq2/8MQxuvbbzRr3KBNB/8 coofV77Wy2DHdKB1ChjxSpCnSZ9ezyt96+67mw0HNqsIL3v63NlBlFa8Tc2umtPTTlGc +qbIV6RR5O0yywpBNjAde9z2OKnn8g7D/GjAhjOTVZfTrALXfSirrDPQYW6rNzqPJQRD E2RuWftv70iIKw7ABFMOJjbC42BbNpBdXr/AbKi3IyRTJYFyLOui4uRpsPlQd+I2W2T7 HktA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=OoEaJv7aaqTqsijzQaaYdkI+HMpgRA4Nz4+oOvolsqU=; b=KDZPCGVLkIgoup5VouKBe6bYb+c0GTr/L3nm9601VFMtm+4xbjk38ETBgwc4FPAVYV Fmt13dIObnIFNl3vWI0nspdfAHcQ3QqcBXhqsZXZtZ9oOUHjfOXhtETfrknhIlUUB5X7 qVe4hwJzBbFonJXvY0FejKSkgq2F9c9Ls0GnYcIR/LKHpDcSjSKuplGfpn6dbKZ29EJT /WOFlvD1Mg0BnEQHsr2ka8OqX3OfyWkrA7fKwI4dFpJ0NX3oQkLL7SyZNFjbmKpiPG5O JwdqfYKOiD9Qyp5f6c2Ilcr2ukGS3pagglBSk9SXOoM3hV+yzxFXdpOG0d3mWruFWBKY 2m3w== X-Gm-Message-State: APjAAAXgFCLdZmy8gAI23Gl0BE3pwc8/68S4Dt9ryC8GOJQu6CXD7LIo sOLHyADeVY2k/6VShegNcsOvww== X-Received: by 2002:a5d:5702:: with SMTP id a2mr4649769wrv.89.1561567735012; Wed, 26 Jun 2019 09:48:55 -0700 (PDT) Received: from localhost (ip-89-176-222-26.net.upcbroadband.cz. [89.176.222.26]) by smtp.gmail.com with ESMTPSA id o6sm3792212wmc.15.2019.06.26.09.48.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 09:48:54 -0700 (PDT) Date: Wed, 26 Jun 2019 18:48:53 +0200 From: Jiri Pirko To: mirq-linux@rere.qmqm.pl Cc: YueHaibing , davem@davemloft.net, sdf@google.com, jianbol@mellanox.com, jiri@mellanox.com, willemb@google.com, sdf@fomichev.me, j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] bonding: Always enable vlan tx offload Message-ID: <20190626164853.GC2424@nanopsycho> References: <20190624135007.GA17673@nanopsycho> <20190626080844.20796-1-yuehaibing@huawei.com> <20190626161337.GA18953@qmqm.qmqm.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190626161337.GA18953@qmqm.qmqm.pl> 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 26, 2019 at 06:13:38PM CEST, mirq-linux@rere.qmqm.pl wrote: >On Wed, Jun 26, 2019 at 04:08:44PM +0800, 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. >> >> Because vlan tx offload is off, vlan tci is cleared and skb push >> the vlan header in validate_xmit_vlan() while sending from vlan >> devices. Then in bond_xmit_hash, __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. >> >> This patch always enable bonding's vlan tx offload, pass the vlan >> packets to the slave devices with vlan tci, let them to handle >> vlan implementation. >[...] >> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c >> index 407f4095a37a..799fc38c5c34 100644 >> --- a/drivers/net/bonding/bond_main.c >> +++ b/drivers/net/bonding/bond_main.c >> @@ -4320,12 +4320,12 @@ void bond_setup(struct net_device *bond_dev) >> bond_dev->features |= NETIF_F_NETNS_LOCAL; >> >> bond_dev->hw_features = BOND_VLAN_FEATURES | >> - NETIF_F_HW_VLAN_CTAG_TX | >> NETIF_F_HW_VLAN_CTAG_RX | >> NETIF_F_HW_VLAN_CTAG_FILTER; >> >> bond_dev->hw_features |= NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4; >> bond_dev->features |= bond_dev->hw_features; >> + bond_dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX; >> } >> >> /* Destroy a bonding device. >> > >I can see that bonding driver uses dev_queue_xmit() to pass packets to >slave links, but I can't see where in the path it does software fallback >for devices without HW VLAN tagging. Generally drivers that don't ever >do VLAN offload also ignore vlan_tci presence. Am I missing something >here? validate_xmit_skb->validate_xmit_vlan > >Best Regards, >Michał Mirosław