From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 521F3A0C41 for ; Tue, 7 Sep 2021 12:38:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42A55410EC; Tue, 7 Sep 2021 12:38:43 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 998F2410EC for ; Tue, 7 Sep 2021 12:38:41 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id i28so2431114wrb.2 for ; Tue, 07 Sep 2021 03:38:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=srzoiiE8Kr4eJNiaf3O4fp/FBmYQpQDRTaGUoW4BXiA=; b=XikCU4+U+FtWfMdmYrLgOE9+etwz8CLjsrEtPDjAo4QZkCPNV+7lxlzJyXnNpCW2aS rYk4BkYdG3gp+7GaCJnalBrXrLvEbJ/MJFyICrQG0fqkHbJuq3c97VYPIlQ+MjmkK+Cu cx/RagT+LINaniMW9vaI7SYHQEUyMpQ1H24IAuDST/p8g1na1a9VYlmUG/qJTcTeblhC V5ye7dC+nvF2rZXJh4gGkCQeXzLkpFmeWIUV/QtXF1Gm7VrA4kYHbz51O/ir0+X2T70j SJUg/xlEeIs31NULEUp9J5Q78D369vSZllxR64+YUJe9xjc6k/HBkuJxuKsfA/PFuO06 ssfA== X-Gm-Message-State: AOAM531IdFT0wI2kfKGqA4mRHa1HQ0UlOXOWmHfNjk5krmc13CywsfRS uLjfDi37HtF0V0LqoS8c2Xg= X-Google-Smtp-Source: ABdhPJwPm8Sc20GYjXnq/ml/GRIEjeQBUuO6nvI5Fkk6bTMXPbhlllTD5Sgf7Noi9bzE/ZwAJTpqEQ== X-Received: by 2002:a05:6000:344:: with SMTP id e4mr18702658wre.423.1631011121350; Tue, 07 Sep 2021 03:38:41 -0700 (PDT) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id q85sm2071079wme.23.2021.09.07.03.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 03:38:40 -0700 (PDT) Message-ID: <87b2422a7789ee39ab4c072fbd99d59749bcf5a9.camel@debian.org> From: Luca Boccassi To: Beilei Xing Cc: Qiming Chen , stable@dpdk.org Date: Tue, 07 Sep 2021 11:38:40 +0100 In-Reply-To: <20210831035207.5590-1-chenqiming_huawei@163.com> References: <20210831035207.5590-1-chenqiming_huawei@163.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.38.3-1+plugin MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH 20.11] net/i40e: solve vf vlan strip X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Tue, 2021-08-31 at 11:52 +0800, Qiming Chen wrote: > Kernel PF+DPDK VF mode, after vf adds vlan, the test result shows that th= e > vlan received from vf has been stripped. >=20 > The patch solves the problem that the kernel i40e.ko driver strips the vl= an > by default after vf adds vlan. Determine whether to strip vlan through > the DEV_RX_OFFLOAD_VLAN_STRIP mask bit in rxmode.offload. >=20 > Environmental information: > 1) dpdk 19.11 > 2) Kernel PF i40e.ko: 2.7.12 > 3) Firmware: 6.01 0x800034a3 1.1747.0 >=20 > I did not use testpmd to test vlan filter, but write Demo for testing > based on the following deployment: > 1) x710 nic, use 2 PFs, each PF virtualizes 1 VF > 2) 2 pf connected with fiber optic cable > 3) 2 vf are hard to pass through to the VM > 4) In vm, dpdk takes over the vf port, > 5) One port is used as the sending port, and the other port is used as > the receiving port, e.g. xmit portid is 0, rx portid is 1 >=20 > Use the default configuration for port 0 as the sender, and configure > port 1 as the receiving port as follows: > 1) rte_eth_dev_set_vlan_offload(1, ETH_VLAN_FILTER_OFFLOAD) > 2) rte_eth_dev_vlan_filter(1, 100, 1) >=20 > Do the following tests: > Demo constructs a message with vlan 100 to be sent from port 0, and found > that the vlan header of the message received from port 1 was stripped. >=20 > Signed-off-by: Qiming Chen > --- > =C2=A0drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- > =C2=A01 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_vf.c > index 12e69a3233..d60243411c 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1900,11 +1900,15 @@ static int > =C2=A0i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, i= nt on) > =C2=A0{ > =C2=A0 int ret; > + struct rte_eth_conf *dev_conf =3D &dev->data->dev_conf; > =C2=A0 >=20 > - if (on) > + if (on) { > =C2=A0 ret =3D i40evf_add_vlan(dev, vlan_id); > - else > + if (!(dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)) > + i40evf_disable_vlan_strip(dev); > + } else { > =C2=A0 ret =3D i40evf_del_vlan(dev,vlan_id); > + } > =C2=A0 >=20 > =C2=A0 return ret; > =C2=A0} Hi Beilei, Could you please review this and the other i40e patches that have been sent for 20.11? Thank you --=20 Kind regards, Luca Boccassi