net/ixgbevf: fix RSS init for x550 nics

Message ID 20240215133145.181302-1-edwin.brossette@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers
Series net/ixgbevf: fix RSS init for x550 nics |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

edwin.brossette@6wind.com Feb. 15, 2024, 1:31 p.m. UTC
  From: Edwin Brossette <edwin.brossette@6wind.com>

Different Intel nics with the igxbe pmd do not handle RSS in the same
way when working with virtualization. While some nics like Intel 82599ES
only have a single RSS table in the device and leave all rss features to
be handled by the pf, some other nics like x550 let the vf handle RSS
features. This can lead to different behavior when rss is enabled
depending on the model of nic used.

In particular, it occurred that ixgbevf_dev_rx_init() do not initiate
rss parameters at device init, even if the multi-queue mode option is
set in the device configuration (ie: RTE_ETH_MQ_RX_RSS is set). Note
that this issue went unnoticed until now, probably because some nics do
not really have support for RSS in virtualization mode.

Thus, depending on the nic used, we can we find ourselves in a situation
where RSS is not configured despite being enabled. This will cause
serious performance issues because the RSS reta will be fully zeroed,
causing all packets to go only in the first queue and leaving all the
others empty.

By looking at ixgbe_reta_size_get(), we can see that only X550 nic
models have a non zero reta size set in vf mode. Thus add a call to
ixgbe_rss_configure() for these cards in ixgbevf_dev_rx_init() if the
option to enable RSS is set.

Fixes: f4d1598ee14f ("ixgbevf: support RSS config on x550")
Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
  

Comments

Vladimir Medvedkin Feb. 27, 2024, 5:26 p.m. UTC | #1
On 15/02/2024 13:31, edwin.brossette@6wind.com wrote:
> From: Edwin Brossette <edwin.brossette@6wind.com>
>
> Different Intel nics with the igxbe pmd do not handle RSS in the same
> way when working with virtualization. While some nics like Intel 82599ES
> only have a single RSS table in the device and leave all rss features to
> be handled by the pf, some other nics like x550 let the vf handle RSS
> features. This can lead to different behavior when rss is enabled
> depending on the model of nic used.
>
> In particular, it occurred that ixgbevf_dev_rx_init() do not initiate
> rss parameters at device init, even if the multi-queue mode option is
> set in the device configuration (ie: RTE_ETH_MQ_RX_RSS is set). Note
> that this issue went unnoticed until now, probably because some nics do
> not really have support for RSS in virtualization mode.
>
> Thus, depending on the nic used, we can we find ourselves in a situation
> where RSS is not configured despite being enabled. This will cause
> serious performance issues because the RSS reta will be fully zeroed,
> causing all packets to go only in the first queue and leaving all the
> others empty.
>
> By looking at ixgbe_reta_size_get(), we can see that only X550 nic
> models have a non zero reta size set in vf mode. Thus add a call to
> ixgbe_rss_configure() for these cards in ixgbevf_dev_rx_init() if the
> option to enable RSS is set.
>
> Fixes: f4d1598ee14f ("ixgbevf: support RSS config on x550")
> Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
> ---
>   drivers/net/ixgbe/ixgbe_rxtx.c | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index 537aa2f68de8..0aa968f7e258 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -5873,6 +5873,25 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
>   		IXGBE_PSRTYPE_RQPL_SHIFT;
>   	IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype);
>   
> +	/* Initialize the rss for x550_vf cards if enabled */
> +	switch (hw->mac.type) {
> +	case ixgbe_mac_X550_vf:
> +	case ixgbe_mac_X550EM_x_vf:
> +	case ixgbe_mac_X550EM_a_vf:
> +		switch (dev->data->dev_conf.rxmode.mq_mode) {
> +		case RTE_ETH_MQ_RX_RSS:
> +		case RTE_ETH_MQ_RX_DCB_RSS:
> +		case RTE_ETH_MQ_RX_VMDQ_RSS:
> +			ixgbe_rss_configure(dev);
> +			break;
> +		default:
> +			break;
> +		}
> +		break;
> +	default:
> +		break;
> +	}
> +
>   	ixgbe_set_rx_function(dev);
>   
>   	return 0;
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
  
Bruce Richardson Feb. 29, 2024, 11:49 a.m. UTC | #2
On Tue, Feb 27, 2024 at 05:26:06PM +0000, Medvedkin, Vladimir wrote:
> 
> On 15/02/2024 13:31, edwin.brossette@6wind.com wrote:
> > From: Edwin Brossette <edwin.brossette@6wind.com>
> > 
> > Different Intel nics with the igxbe pmd do not handle RSS in the same
> > way when working with virtualization. While some nics like Intel 82599ES
> > only have a single RSS table in the device and leave all rss features to
> > be handled by the pf, some other nics like x550 let the vf handle RSS
> > features. This can lead to different behavior when rss is enabled
> > depending on the model of nic used.
> > 
> > In particular, it occurred that ixgbevf_dev_rx_init() do not initiate
> > rss parameters at device init, even if the multi-queue mode option is
> > set in the device configuration (ie: RTE_ETH_MQ_RX_RSS is set). Note
> > that this issue went unnoticed until now, probably because some nics do
> > not really have support for RSS in virtualization mode.
> > 
> > Thus, depending on the nic used, we can we find ourselves in a situation
> > where RSS is not configured despite being enabled. This will cause
> > serious performance issues because the RSS reta will be fully zeroed,
> > causing all packets to go only in the first queue and leaving all the
> > others empty.
> > 
> > By looking at ixgbe_reta_size_get(), we can see that only X550 nic
> > models have a non zero reta size set in vf mode. Thus add a call to
> > ixgbe_rss_configure() for these cards in ixgbevf_dev_rx_init() if the
> > option to enable RSS is set.
> > 
> > Fixes: f4d1598ee14f ("ixgbevf: support RSS config on x550")

+ Cc: stable@dpdk.org

> > Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
> > ---
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> 

Applied to next-net-intel tree.
Thanks,
/Bruce
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 537aa2f68de8..0aa968f7e258 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -5873,6 +5873,25 @@  ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 		IXGBE_PSRTYPE_RQPL_SHIFT;
 	IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype);
 
+	/* Initialize the rss for x550_vf cards if enabled */
+	switch (hw->mac.type) {
+	case ixgbe_mac_X550_vf:
+	case ixgbe_mac_X550EM_x_vf:
+	case ixgbe_mac_X550EM_a_vf:
+		switch (dev->data->dev_conf.rxmode.mq_mode) {
+		case RTE_ETH_MQ_RX_RSS:
+		case RTE_ETH_MQ_RX_DCB_RSS:
+		case RTE_ETH_MQ_RX_VMDQ_RSS:
+			ixgbe_rss_configure(dev);
+			break;
+		default:
+			break;
+		}
+		break;
+	default:
+		break;
+	}
+
 	ixgbe_set_rx_function(dev);
 
 	return 0;