patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/4] net/txgbe: fix RSS in double VALN
       [not found] <20210425080347.20376-1-jiawenwu@trustnetic.com>
@ 2021-04-25  8:03 ` Jiawen Wu
  2021-04-27 16:42   ` Ferruh Yigit
  2021-04-25  8:03 ` [dpdk-stable] [PATCH 2/4] net/txgbe: fix VF MTU limit setting Jiawen Wu
  1 sibling, 1 reply; 4+ messages in thread
From: Jiawen Wu @ 2021-04-25  8:03 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu, stable

Regard QINQ as one case of extend VLAN, and always enable QINQ mode when
double VLAN is set, to avoid RSS does not work for QINQ packets.

Fixes: 220b0e49bc47 ("net/txgbe: support VLAN")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_ethdev.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 97796f040b..87c041c2ec 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -1217,17 +1217,12 @@ 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;
+	ctrl |= TXGBE_PORTCTL_VLANEXT | TXGBE_PORTCTL_QINQ;
 	wr32(hw, TXGBE_PORTCTL, ctrl);
 }
 
@@ -1287,8 +1282,9 @@ txgbe_vlan_offload_config(struct rte_eth_dev *dev, int mask)
 			txgbe_vlan_hw_filter_disable(dev);
 	}
 
-	if (mask & ETH_VLAN_EXTEND_MASK) {
-		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
+	if (mask & (ETH_VLAN_EXTEND_MASK | ETH_QINQ_STRIP_MASK)) {
+		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND ||
+			rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP)
 			txgbe_vlan_hw_extend_enable(dev);
 		else
 			txgbe_vlan_hw_extend_disable(dev);
-- 
2.21.0.windows.1




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH 2/4] net/txgbe: fix VF MTU limit setting
       [not found] <20210425080347.20376-1-jiawenwu@trustnetic.com>
  2021-04-25  8:03 ` [dpdk-stable] [PATCH 1/4] net/txgbe: fix RSS in double VALN Jiawen Wu
@ 2021-04-25  8:03 ` Jiawen Wu
  2021-04-27 16:44   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Jiawen Wu @ 2021-04-25  8:03 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu, stable

Fix to set MTU bigger than mbuf size when device is stopped, scattered
rx may be enabled in next starting, exempt from setting in EAL parameters.

Fixes: a2beaa4a769e ("net/txgbe: support VF MTU update")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_ethdev_vf.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 3a5123733e..5597968e18 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -1115,7 +1115,7 @@ txgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 {
 	struct txgbe_hw *hw;
 	uint32_t max_frame = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
-	struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
+	struct rte_eth_dev_data *dev_data = dev->data;
 
 	hw = TXGBE_DEV_HW(dev);
 
@@ -1123,13 +1123,15 @@ txgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 			max_frame > RTE_ETHER_MAX_JUMBO_FRAME_LEN)
 		return -EINVAL;
 
-	/* refuse mtu that requires the support of scattered packets when this
-	 * feature has not been enabled before.
+	/* If device is started, refuse mtu that requires the support of
+	 * scattered packets when this feature has not been enabled before.
 	 */
-	if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
+	if (dev_data->dev_started && !dev_data->scattered_rx &&
 	    (max_frame + 2 * TXGBE_VLAN_TAG_SIZE >
-	     dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
+	     dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
+		PMD_INIT_LOG(ERR, "Stop port first.");
 		return -EINVAL;
+	}
 
 	/*
 	 * When supported by the underlying PF driver, use the TXGBE_VF_SET_MTU
-- 
2.21.0.windows.1




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [PATCH 1/4] net/txgbe: fix RSS in double VALN
  2021-04-25  8:03 ` [dpdk-stable] [PATCH 1/4] net/txgbe: fix RSS in double VALN Jiawen Wu
@ 2021-04-27 16:42   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-04-27 16:42 UTC (permalink / raw)
  To: Jiawen Wu, dev; +Cc: stable

On 4/25/2021 9:03 AM, Jiawen Wu wrote:
> Regard QINQ as one case of extend VLAN, and always enable QINQ mode when
> double VLAN is set, to avoid RSS does not work for QINQ packets.
> 

It is hard to understand above paragraph, can you please reword it?

Also in the patch title s/VALN/VLAN

VLAN_EXTEND mainly comes from ixgbe, it is different than QinQ, which one does
your device supports?

> Fixes: 220b0e49bc47 ("net/txgbe: support VLAN")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  drivers/net/txgbe/txgbe_ethdev.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
> index 97796f040b..87c041c2ec 100644
> --- a/drivers/net/txgbe/txgbe_ethdev.c
> +++ b/drivers/net/txgbe/txgbe_ethdev.c
> @@ -1217,17 +1217,12 @@ 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;
> +	ctrl |= TXGBE_PORTCTL_VLANEXT | TXGBE_PORTCTL_QINQ;
>  	wr32(hw, TXGBE_PORTCTL, ctrl);
>  }
>  
> @@ -1287,8 +1282,9 @@ txgbe_vlan_offload_config(struct rte_eth_dev *dev, int mask)
>  			txgbe_vlan_hw_filter_disable(dev);
>  	}
>  
> -	if (mask & ETH_VLAN_EXTEND_MASK) {
> -		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
> +	if (mask & (ETH_VLAN_EXTEND_MASK | ETH_QINQ_STRIP_MASK)) {
> +		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND ||
> +			rxmode->offloads & DEV_RX_OFFLOAD_QINQ_STRIP)
>  			txgbe_vlan_hw_extend_enable(dev);
>  		else
>  			txgbe_vlan_hw_extend_disable(dev);
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [PATCH 2/4] net/txgbe: fix VF MTU limit setting
  2021-04-25  8:03 ` [dpdk-stable] [PATCH 2/4] net/txgbe: fix VF MTU limit setting Jiawen Wu
@ 2021-04-27 16:44   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-04-27 16:44 UTC (permalink / raw)
  To: Jiawen Wu, dev; +Cc: stable

On 4/25/2021 9:03 AM, Jiawen Wu wrote:
> Fix to set MTU bigger than mbuf size when device is stopped, scattered
> rx may be enabled in next starting, exempt from setting in EAL parameters.
> 

The main change is 'dev_started' check, right? Can you please reword above
paragraph to clarify it?

> Fixes: a2beaa4a769e ("net/txgbe: support VF MTU update")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  drivers/net/txgbe/txgbe_ethdev_vf.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
> index 3a5123733e..5597968e18 100644
> --- a/drivers/net/txgbe/txgbe_ethdev_vf.c
> +++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
> @@ -1115,7 +1115,7 @@ txgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
>  {
>  	struct txgbe_hw *hw;
>  	uint32_t max_frame = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
> -	struct rte_eth_rxmode *rx_conf = &dev->data->dev_conf.rxmode;
> +	struct rte_eth_dev_data *dev_data = dev->data;
>  
>  	hw = TXGBE_DEV_HW(dev);
>  
> @@ -1123,13 +1123,15 @@ txgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
>  			max_frame > RTE_ETHER_MAX_JUMBO_FRAME_LEN)
>  		return -EINVAL;
>  
> -	/* refuse mtu that requires the support of scattered packets when this
> -	 * feature has not been enabled before.
> +	/* If device is started, refuse mtu that requires the support of
> +	 * scattered packets when this feature has not been enabled before.
>  	 */
> -	if (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) &&
> +	if (dev_data->dev_started && !dev_data->scattered_rx &&
>  	    (max_frame + 2 * TXGBE_VLAN_TAG_SIZE >
> -	     dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM))
> +	     dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
> +		PMD_INIT_LOG(ERR, "Stop port first.");
>  		return -EINVAL;
> +	}
>  
>  	/*
>  	 * When supported by the underlying PF driver, use the TXGBE_VF_SET_MTU
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-27 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210425080347.20376-1-jiawenwu@trustnetic.com>
2021-04-25  8:03 ` [dpdk-stable] [PATCH 1/4] net/txgbe: fix RSS in double VALN Jiawen Wu
2021-04-27 16:42   ` Ferruh Yigit
2021-04-25  8:03 ` [dpdk-stable] [PATCH 2/4] net/txgbe: fix VF MTU limit setting Jiawen Wu
2021-04-27 16:44   ` Ferruh Yigit

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