patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH v2 1/5] net/txgbe: fix RSS in QINQ
Date: Thu, 29 Apr 2021 15:31:14 +0100
Message-ID: <1fd58ff8-5028-2216-eec7-1437630de896@intel.com> (raw)
In-Reply-To: <20210429103335.23060-2-jiawenwu@trustnetic.com>

On 4/29/2021 11:33 AM, Jiawen Wu wrote:
> Support to enable and disable QINQ hardware strip,
> when configure vlan offload with QINQ strip mask,
> to avoid RSS does not work for QINQ packets.
> 

Hi Jiawen,

What was not working and fixed here?
Is it RSS hash calculation is wrong when packet has double VLAN tag? Is it
failing to calculate hash for VLAN field of the packet or calculation for any
fields are wrong? Can't device detect/parse QinQ fields?

And how enabling QinQ strip is solving the issue? Should user enable QinQ strip
before configuring the RSS? What happens if user don't, should driver has checks
to cover this, like fail to enable RSS if QinQ strip is not enable etc?

Can you please provide more details?


> Fixes: 220b0e49bc47 ("net/txgbe: support VLAN")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  drivers/net/txgbe/txgbe_ethdev.c | 39 +++++++++++++++++++++++++++-----
>  1 file changed, 33 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
> index 97796f040b..3d6d356102 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.c
> +++ b/drivers/net/txgbe/txgbe_ethdev.c
> @@ -1209,7 +1209,6 @@ txgbe_vlan_hw_extend_disable(struct rte_eth_dev *dev)
>  
>  	ctrl = rd32(hw, TXGBE_PORTCTL);
>  	ctrl &= ~TXGBE_PORTCTL_VLANEXT;
> -	ctrl &= ~TXGBE_PORTCTL_QINQ;
>  	wr32(hw, TXGBE_PORTCTL, ctrl);
>  }
>  
> @@ -1217,17 +1216,38 @@ static void
>  txgbe_vlan_hw_extend_enable(struct rte_eth_dev *dev)
>  {
>  	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> -	struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
> -	struct rte_eth_txmode *txmode = &dev->data->dev_conf.txmode;
>  	uint32_t ctrl;
>  
>  	PMD_INIT_FUNC_TRACE();
>  
>  	ctrl  = rd32(hw, TXGBE_PORTCTL);
>  	ctrl |= TXGBE_PORTCTL_VLANEXT;
> -	if (rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP ||
> -	    txmode->offloads & DEV_TX_OFFLOAD_QINQ_INSERT)
> -		ctrl |= TXGBE_PORTCTL_QINQ;
> +	wr32(hw, TXGBE_PORTCTL, ctrl);
> +}
> +
> +static void
> +txgbe_qinq_hw_strip_disable(struct rte_eth_dev *dev)
> +{
> +	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> +	uint32_t ctrl;
> +
> +	PMD_INIT_FUNC_TRACE();
> +
> +	ctrl = rd32(hw, TXGBE_PORTCTL);
> +	ctrl &= ~TXGBE_PORTCTL_QINQ;
> +	wr32(hw, TXGBE_PORTCTL, ctrl);
> +}
> +
> +static void
> +txgbe_qinq_hw_strip_enable(struct rte_eth_dev *dev)
> +{
> +	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
> +	uint32_t ctrl;
> +
> +	PMD_INIT_FUNC_TRACE();
> +
> +	ctrl  = rd32(hw, TXGBE_PORTCTL);
> +	ctrl |= TXGBE_PORTCTL_QINQ | TXGBE_PORTCTL_VLANEXT;
>  	wr32(hw, TXGBE_PORTCTL, ctrl);
>  }
>  
> @@ -1294,6 +1314,13 @@ txgbe_vlan_offload_config(struct rte_eth_dev *dev, int mask)
>  			txgbe_vlan_hw_extend_disable(dev);
>  	}
>  
> +	if (mask & ETH_QINQ_STRIP_MASK) {
> +		if (rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP)
> +			txgbe_qinq_hw_strip_enable(dev);
> +		else
> +			txgbe_qinq_hw_strip_disable(dev);
> +	}
> +
>  	return 0;
>  }
>  
> 


  reply	other threads:[~2021-04-29 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210429103335.23060-1-jiawenwu@trustnetic.com>
2021-04-29 10:33 ` Jiawen Wu
2021-04-29 14:31   ` Ferruh Yigit [this message]
2021-05-06  3:33     ` Jiawen Wu
2021-04-29 10:33 ` [dpdk-stable] [PATCH v2 2/5] net/txgbe: fix VF MTU limit setting Jiawen Wu
2021-04-29 14:59   ` Ferruh Yigit
2021-05-06  1:43     ` Jiawen Wu

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=1fd58ff8-5028-2216-eec7-1437630de896@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=jiawenwu@trustnetic.com \
    --cc=stable@dpdk.org \
    /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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git