Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4125410ybh; Tue, 6 Aug 2019 06:43:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLfhEocDQ3KJIUs6TY2DtVCnZXpzaarim7AzaYHv5SSJzlL4bDaJQQf8PeXFSV1/bsrUhZ X-Received: by 2002:a17:90a:3590:: with SMTP id r16mr3357820pjb.44.1565099015374; Tue, 06 Aug 2019 06:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565099015; cv=none; d=google.com; s=arc-20160816; b=ADla55wL9sHyZpgL0G9f+ZwcKvLZmVR54c/i4nlfuQvYm/MM5uw2KVUlX3JO6dUgLM hSQB3TCC8dQZbX82PR1o0QD/aZchRQVUsy6GeKuDMz1/EfH9ldZ+oW0kW4d+mc1jtDd7 o8VspXzItXrSHNvYy3/SFockOrn8h7cuyCtXz76Mv3gKQQULjpolVUjh0+KaQsZCwuZb 9Qx1YjRMhm7/94PU9aRap478pfBc0xgobM9Eje1evNQmK7rIA4QTIZ0J/w8vCnRO89zW DtTXm2lrrSdyjJZ4Q6ZrOElpjNjZ2oiwroyJ/kEpDPpe66vVFMfYBQApguxxyZafXZlv rJiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:comments:references:in-reply-to:subject:cc :to:from; bh=+YoSNSM+k94dV8s6NMG9dr+rbv3ft9wec5OnXX1faQw=; b=JanJcTZZsNGSxTWuakP4awS4NOLzwd+RiJ89xZFFit6kulzCs1kLAbjWLwDjAPifZu 6Dt3rYTw51Do727MpTnjhUJNSM0FXE2JqA9NaiT16wvGlm+W299N3FByvWzKFwd7OWkB /Dq+fkbmPUqS4QbpieXKikQRAtDPinUnzIgOvH1WkdqcrhTWkWQHdIv9XecB6yNsGppN h8WGylOVyRFZ3l9TaGba4cysIMF5NcXH5pu+0sD9VUvOSXeUvN4Fz3NCpJDUHnixxNDh w0tOuCTaqpmK4finNAH0Y6P+kBblYzGP4gYsLk06eXddBmul8aGSbVwK+Md3tK1P6MPD U//A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si10492501pgk.96.2019.08.06.06.43.19; Tue, 06 Aug 2019 06:43:35 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732259AbfHFNla convert rfc822-to-8bit (ORCPT + 99 others); Tue, 6 Aug 2019 09:41:30 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44242 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbfHFNla (ORCPT ); Tue, 6 Aug 2019 09:41:30 -0400 Received: from [38.64.181.146] (helo=nyx.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1huziP-0003n1-Oh; Tue, 06 Aug 2019 13:41:25 +0000 Received: by nyx.localdomain (Postfix, from userid 1000) id 7D88924026B; Tue, 6 Aug 2019 09:41:24 -0400 (EDT) Received: from nyx (localhost [127.0.0.1]) by nyx.localdomain (Postfix) with ESMTP id 79646289F62; Tue, 6 Aug 2019 09:41:24 -0400 (EDT) From: Jay Vosburgh To: YueHaibing cc: vfalico@gmail.com, andy@greyhouse.net, davem@davemloft.net, jiri@resnulli.us, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] bonding: Add vlan tx offload to hw_enc_features In-reply-to: <20190805134953.63596-1-yuehaibing@huawei.com> References: <20190805134953.63596-1-yuehaibing@huawei.com> Comments: In-reply-to YueHaibing message dated "Mon, 05 Aug 2019 21:49:53 +0800." X-Mailer: MH-E 8.5+bzr; nmh 1.7.1-RC3; GNU Emacs 27.0.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4280.1565098884.1@nyx> Content-Transfer-Encoding: 8BIT Date: Tue, 06 Aug 2019 09:41:24 -0400 Message-ID: <4281.1565098884@nyx> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org YueHaibing wrote: >As commit 30d8177e8ac7 ("bonding: Always enable vlan tx offload") >said, we should always enable bonding's vlan tx offload, pass the >vlan packets to the slave devices with vlan tci, let them to handle >vlan implementation. > >Now if encapsulation protocols like VXLAN is used, skb->encapsulation >may be set, then the packet is passed to vlan devicec which based on Typo: "devicec" >bonding device. However in netif_skb_features(), the check of >hw_enc_features: > > if (skb->encapsulation) > features &= dev->hw_enc_features; > >clears NETIF_F_HW_VLAN_CTAG_TX/NETIF_F_HW_VLAN_STAG_TX. This results >in same issue in commit 30d8177e8ac7 like this: > >vlan_dev_hard_start_xmit > -->dev_queue_xmit > -->validate_xmit_skb > -->netif_skb_features //NETIF_F_HW_VLAN_CTAG_TX is cleared > -->validate_xmit_vlan > -->__vlan_hwaccel_push_inside //skb->tci is cleared >... > --> bond_start_xmit > --> bond_xmit_hash //BOND_XMIT_POLICY_ENCAP34 > --> __skb_flow_dissect // nhoff point to IP header > --> case htons(ETH_P_8021Q) > // skb_vlan_tag_present is false, so > vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan), > //vlan point to ip header wrongly > >Signed-off-by: YueHaibing Looks good to me; should this be tagged with Fixes: 278339a42a1b ("bonding: propogate vlan_features to bonding master") as 30d8177e8ac7 was? If not, is there an appropriate commit id? Acked-by: Jay Vosburgh -J >--- > drivers/net/bonding/bond_main.c | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c >index 02fd782..931d9d9 100644 >--- a/drivers/net/bonding/bond_main.c >+++ b/drivers/net/bonding/bond_main.c >@@ -1126,6 +1126,8 @@ static void bond_compute_features(struct bonding *bond) > done: > bond_dev->vlan_features = vlan_features; > bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL | >+ NETIF_F_HW_VLAN_CTAG_TX | >+ NETIF_F_HW_VLAN_STAG_TX | > NETIF_F_GSO_UDP_L4; > bond_dev->mpls_features = mpls_features; > bond_dev->gso_max_segs = gso_max_segs; >-- >2.7.4 --- -Jay Vosburgh, jay.vosburgh@canonical.com