DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Liu, KevinX" <kevinx.liu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhang, Yuying" <yuying.zhang@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Yang, SteveX" <stevex.yang@intel.com>,
	"Zhang, RobinX" <robinx.zhang@intel.com>,
	"Liu, KevinX" <kevinx.liu@intel.com>
Subject: RE: [PATCH v4] net/i40e: add outer VLAN processing
Date: Fri, 10 Jun 2022 01:01:50 +0000	[thread overview]
Message-ID: <DM4PR11MB5994AB7550F213EAD62E101FD7A69@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220609144321.274775-1-kevinx.liu@intel.com>



> -----Original Message-----
> From: Kevin Liu <kevinx.liu@intel.com>
> Sent: Thursday, June 9, 2022 10:43 PM
> To: dev@dpdk.org
> Cc: Zhang, Yuying <yuying.zhang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Zhang,
> RobinX <robinx.zhang@intel.com>; Liu, KevinX <kevinx.liu@intel.com>
> Subject: [PATCH v4] net/i40e: add outer VLAN processing
> 
> From: Robin Zhang <robinx.zhang@intel.com>
> 
> Outer VLAN processing is supported after firmware v8.4, kernel driver also
> change the default behavior to support this feature. To align with kernel driver,
> add support for outer VLAN processing in DPDK.
> 
> But it is forbidden for firmware to change the Inner/Outer VLAN configuration
> while there are MAC/VLAN filters in the switch table.
> Therefore, we need to clear the MAC table before setting config, and then
> restore the MAC table after setting.
> 
> This will not impact on an old firmware.
> 
> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 83 ++++++++++++++++++++++++++++++++--
>  drivers/net/i40e/i40e_ethdev.h |  3 ++
>  2 files changed, 81 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 755786dc10..736afb268b 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -3909,6 +3909,7 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev,
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
>  	int qinq = dev->data->dev_conf.rxmode.offloads &
>  		   RTE_ETH_RX_OFFLOAD_VLAN_EXTEND;
> +	u16 sw_flags = 0, valid_flags = 0;
>  	int ret = 0;
> 
>  	if ((vlan_type != RTE_ETH_VLAN_TYPE_INNER && @@ -3927,15
> +3928,34 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev,
>  	/* 802.1ad frames ability is added in NVM API 1.7*/
>  	if (hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) {
>  		if (qinq) {
> +			if (pf->is_outer_vlan_processing) {
> +				sw_flags =
> I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN;
> +				valid_flags =
> I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN;
> +			}
>  			if (vlan_type == RTE_ETH_VLAN_TYPE_OUTER)
>  				hw->first_tag = rte_cpu_to_le_16(tpid);
>  			else if (vlan_type == RTE_ETH_VLAN_TYPE_INNER)
>  				hw->second_tag = rte_cpu_to_le_16(tpid);
>  		} else {
> -			if (vlan_type == RTE_ETH_VLAN_TYPE_OUTER)
> -				hw->second_tag = rte_cpu_to_le_16(tpid);
> +			/*When FW > 8.3, the tpid must be set to QinQ to
> close extend*/

The comment is confusing, there is no firmware version related check in below code
And what is "set to QinQ to close extend" means?


      parent reply	other threads:[~2022-06-10  1:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  9:39 [PATCH] " Robin Zhang
2022-05-19  6:18 ` [PATCH v2] " Robin Zhang
2022-06-09 11:26   ` [PATCH v3] " Kevin Liu
2022-06-09 14:43     ` [PATCH v4] " Kevin Liu
2022-04-07 20:01       ` [PATCH v5] " Kevin Liu
2022-06-10 15:52         ` [PATCH v6] " Kevin Liu
2022-06-10  8:06           ` Zhang, Qi Z
2022-06-10  8:14             ` Liu, KevinX
2022-06-10 16:29           ` [PATCH v7] " Kevin Liu
2022-06-10 14:27             ` Ben Magistro
2022-06-13  2:14               ` Liu, KevinX
2022-06-13 15:01                 ` Ben Magistro
2022-06-14  2:43             ` Zhang, Yuying
2022-06-14  3:06               ` Liu, KevinX
2022-06-14  8:39                 ` Zhang, Yuying
2022-06-14  8:43                   ` Liu, KevinX
2022-06-15 12:12                   ` Zhang, Qi Z
2022-06-10  1:01       ` Zhang, Qi Z [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM4PR11MB5994AB7550F213EAD62E101FD7A69@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=kevinx.liu@intel.com \
    --cc=robinx.zhang@intel.com \
    --cc=stevex.yang@intel.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).