Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp920969ybd; Wed, 26 Jun 2019 08:08:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdCCMWgwmoeWGbc1ieJBCnl9AYrgQcZIfydDDSxd8lQaQCSzbBog0GktTk5xWw/VouWPXy X-Received: by 2002:a17:90a:2ec1:: with SMTP id h1mr5314929pjs.101.1561561731087; Wed, 26 Jun 2019 08:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561561731; cv=none; d=google.com; s=arc-20160816; b=tlg15kzvgbYQf/wImEXkHTmbAPUTs0eJZSijSfw6ECn88/Ofo+0U/g3po3CEYqQHVj 3t6QUVmhnjLURt/Aa5v+LNCt5qTTtL7LektJpDECmez+KNMx9F2eYZXd44aE0nyP/nHN 5IHXLvkYzCym0c40X985JFUqYqFNxBkdUC/FnM7zREiBAShJ7Uo5SVdnlS1PelMnmcbL ThCfoNH07yfqhSXgOduuRjJYXuBDNoWpXLEJ7pGifLX7Pwv7lGIWUDYNLZb5wRD19ubm IqySNIh722Om0v8qVtPk5jwdyhJGs2IISwQ9qKDwoG2oIpOu0GUNGWfz8AZUubG9i/tS FifQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=IdjKY/GroPqeUlZ+56JR9Zm4lg5FRN0qpAZ4LrkxqH8=; b=YwQbZgqffV9Ah/CI1Xfu1KLebRuGUI2J2s8CudVl+qHFj//PJUn3yjW6oftqgB3pLN ValELgpLMmJwyrWQRZn4P60h28m1bi0oyq96cGgxwEHcS6cgDjZLkrFiRxOyuFL2UlwB JglVbqn4gwVy9HvH+h1QGAJKKg4CK51FjV1oxvEpH6m3fXshMYclC3FCsWBCDi5Z33ed wKPZDFqQuzGIQr3oqNrOOZPzXnnPdOcCEZMLUddixxtTtxhNpsaIvhr26KXUsHZX9Wk4 TWVA9D1zcCVeN535DQiqFwW0t6HBbc34FWsqKzwyIOn7hkq6pbY5gxTdbXlgXf02tmbb IHWw== ARC-Authentication-Results: i=1; mx.google.com; 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 j1si17671429pfr.52.2019.06.26.08.08.20; Wed, 26 Jun 2019 08:08:51 -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; 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 S1728249AbfFZPHA (ORCPT + 99 others); Wed, 26 Jun 2019 11:07:00 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:19081 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727562AbfFZPHA (ORCPT ); Wed, 26 Jun 2019 11:07:00 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E6D418317CE54D8D4702; Wed, 26 Jun 2019 23:06:52 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Wed, 26 Jun 2019 23:06:45 +0800 From: YueHaibing To: , , , , , , , , , , CC: , , YueHaibing Subject: [PATCH] bonding: Always enable vlan tx offload Date: Wed, 26 Jun 2019 16:08:44 +0800 Message-ID: <20190626080844.20796-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20190624135007.GA17673@nanopsycho> References: <20190624135007.GA17673@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 278339a42a1b ("bonding: propogate vlan_features to bonding master") Suggested-by: Jiri Pirko Signed-off-by: YueHaibing --- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- 2.20.1