[v17,04/10] drivers/net: update Rx RSS hash offload capabilities
Checks
Commit Message
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Add DEV_RX_OFFLOAD_RSS_HASH flag for all PMDs that support RSS hash
delivery.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 6 +++++-
drivers/net/cxgbe/cxgbe.h | 3 ++-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 ++
drivers/net/dpaa/dpaa_ethdev.c | 3 ++-
drivers/net/dpaa2/dpaa2_ethdev.c | 1 +
drivers/net/e1000/igb_ethdev.c | 4 ++++
drivers/net/e1000/igb_rxtx.c | 3 ++-
drivers/net/enic/enic_ethdev.c | 2 ++
drivers/net/enic/enic_res.c | 3 ++-
drivers/net/fm10k/fm10k_ethdev.c | 5 ++++-
drivers/net/hinic/hinic_pmd_ethdev.c | 5 ++++-
drivers/net/i40e/i40e_ethdev.c | 5 ++++-
drivers/net/iavf/iavf_ethdev.c | 5 ++++-
drivers/net/ice/ice_ethdev.c | 5 ++++-
drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++
drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++-
drivers/net/liquidio/lio_ethdev.c | 5 ++++-
drivers/net/mlx4/mlx4.c | 2 ++
drivers/net/mlx4/mlx4_rxq.c | 3 ++-
drivers/net/mlx5/mlx5_ethdev.c | 3 +++
drivers/net/mlx5/mlx5_rxq.c | 3 ++-
drivers/net/netvsc/hn_ethdev.c | 2 ++
drivers/net/netvsc/hn_rndis.c | 3 ++-
drivers/net/nfp/nfp_net.c | 5 ++++-
drivers/net/octeontx2/otx2_ethdev.c | 3 ++-
drivers/net/octeontx2/otx2_ethdev.h | 15 ++++++++-------
drivers/net/qede/qede_ethdev.c | 5 ++++-
drivers/net/sfc/sfc_ef10_essb_rx.c | 3 ++-
drivers/net/sfc/sfc_ef10_rx.c | 3 ++-
drivers/net/sfc/sfc_rx.c | 7 ++++++-
drivers/net/thunderx/nicvf_ethdev.c | 2 ++
drivers/net/thunderx/nicvf_ethdev.h | 3 ++-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 ++++-
33 files changed, 102 insertions(+), 30 deletions(-)
Comments
On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index 931e4f4fe..6bc85a3d5 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
> struct rte_flow_error error;
> int ret;
>
> + dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
> +
Build still fails because of this change, s/offload/offloads, I can fix it while
merging if this is the only issue.
>On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
>> index 931e4f4fe..6bc85a3d5 100644
>> --- a/drivers/net/mlx4/mlx4.c
>> +++ b/drivers/net/mlx4/mlx4.c
>> @@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
>> struct rte_flow_error error;
>> int ret;
>>
>> + dev->data->dev_conf.rxmode.offload |=
>DEV_RX_OFFLOAD_RSS_HASH;
>> +
>
>Build still fails because of this change, s/offload/offloads, I can fix it
>while
>merging if this is the only issue.
My bad since MLX4 and MLX5 are disabled by default normal build script don’t catch the errors
# Compile burst-oriented Mellanox ConnectX-3 (MLX4) PMD
CONFIG_RTE_LIBRTE_MLX4_PMD=n
CONFIG_RTE_LIBRTE_MLX4_DEBUG=y
# Compile burst-oriented Mellanox ConnectX-4, ConnectX-5,
# ConnectX-6 & Bluefield (MLX5) PMD
CONFIG_RTE_LIBRTE_MLX5_PMD=n
CONFIG_RTE_LIBRTE_MLX5_DEBUG=y
On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 30c0379d4..8c1caac18 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
> int ret;
>
> PMD_INIT_FUNC_TRACE();
> +
> + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> +
Hi Pavan, Andrew, Jerin,
This is causing trouble when device is re-configured with its existing data,
because of the check in the ethdev [1].
This is for the case device configuration get, a few thing changed and
re-configured case, this is what is done in bonding and it is failing now.
Do you have any suggestion for the solution?
We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
but reconfigure is not.
Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
[1]
@@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
nb_rx_q, uint16_t nb_tx_q,
goto rollback;
}
+ /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
+ if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
+ (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+ RTE_ETHDEV_LOG(ERR,
+ "Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is
requested",
+ port_id,
+ rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
+ ret = -EINVAL;
+ goto rollback;
+ }
On 11/13/2019 6:02 PM, Ferruh Yigit wrote:
> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>> index 30c0379d4..8c1caac18 100644
>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>> int ret;
>>
>> PMD_INIT_FUNC_TRACE();
>> +
>> + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>> +
>
> Hi Pavan, Andrew, Jerin,
>
> This is causing trouble when device is re-configured with its existing data,
> because of the check in the ethdev [1].
>
> This is for the case device configuration get, a few thing changed and
> re-configured case, this is what is done in bonding and it is failing now.
>
> Do you have any suggestion for the solution?
>
> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
> but reconfigure is not.
>
> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
>
No update? I think we should fix this before rc3!
>
>
> [1]
>
> @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
> nb_rx_q, uint16_t nb_tx_q,
> goto rollback;
> }
>
> + /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
> + if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
> + (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> + RTE_ETHDEV_LOG(ERR,
> + "Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is
> requested",
> + port_id,
> + rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
> + ret = -EINVAL;
> + goto rollback;
> + }
>
On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 30c0379d4..8c1caac18 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
> > int ret;
> >
> > PMD_INIT_FUNC_TRACE();
> > +
> > + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
> > +
>
> Hi Pavan, Andrew, Jerin,
>
> This is causing trouble when device is re-configured with its existing data,
> because of the check in the ethdev [1].
>
> This is for the case device configuration get, a few thing changed and
> re-configured case, this is what is done in bonding and it is failing now.
>
> Do you have any suggestion for the solution?
>
> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
> but reconfigure is not.
>
> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
IMO, We can relax the check as it is NOT at all critical for this flag.
>
>
>
> [1]
>
> @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
> nb_rx_q, uint16_t nb_tx_q,
> goto rollback;
> }
>
> + /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
> + if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
> + (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> + RTE_ETHDEV_LOG(ERR,
> + "Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is
> requested",
> + port_id,
> + rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
> + ret = -EINVAL;
> + goto rollback;
> + }
On 11/14/19 3:57 PM, Jerin Jacob wrote:
> On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>>> index 30c0379d4..8c1caac18 100644
>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>> int ret;
>>>
>>> PMD_INIT_FUNC_TRACE();
>>> +
>>> + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>> +
>> Hi Pavan, Andrew, Jerin,
>>
>> This is causing trouble when device is re-configured with its existing data,
>> because of the check in the ethdev [1].
>>
>> This is for the case device configuration get, a few thing changed and
>> re-configured case, this is what is done in bonding and it is failing now.
>>
>> Do you have any suggestion for the solution?
>>
>> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
>> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
>> but reconfigure is not.
>>
>> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
> IMO, We can relax the check as it is NOT at all critical for this flag.
Other option is to set RSS_HASH above if (dev_conf->rxmode.mq_mode &
ETH_MQ_RX_RSS_FLAG).
Should I care about it?
>> [1]
>>
>> @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
>> nb_rx_q, uint16_t nb_tx_q,
>> goto rollback;
>> }
>>
>> + /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>> + if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>> + (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>> + RTE_ETHDEV_LOG(ERR,
>> + "Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is
>> requested",
>> + port_id,
>> + rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>> + ret = -EINVAL;
>> + goto rollback;
>> + }
On 11/14/2019 1:24 PM, Andrew Rybchenko wrote:
> On 11/14/19 3:57 PM, Jerin Jacob wrote:
>> On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>> index 30c0379d4..8c1caac18 100644
>>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>>> int ret;
>>>>
>>>> PMD_INIT_FUNC_TRACE();
>>>> +
>>>> + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>>> +
>>> Hi Pavan, Andrew, Jerin,
>>>
>>> This is causing trouble when device is re-configured with its existing data,
>>> because of the check in the ethdev [1].
>>>
>>> This is for the case device configuration get, a few thing changed and
>>> re-configured case, this is what is done in bonding and it is failing now.
>>>
>>> Do you have any suggestion for the solution?
>>>
>>> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
>>> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
>>> but reconfigure is not.
>>>
>>> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
>> IMO, We can relax the check as it is NOT at all critical for this flag.
>
> Other option is to set RSS_HASH above if (dev_conf->rxmode.mq_mode &
> ETH_MQ_RX_RSS_FLAG).
+1 to this check in PMDs, even we can disable the RSS_HASH offload when RSS is
not enabled [2], but this won't solve the problem completely. User can do first
configure with RSS enabled and second with RSS disabled, it will be same issue.
[2]
in PMD, configure():
if (dev_conf->rxmode.mq_mode & TH_MQ_RX_RSS_FLAG)
offload |= RSS_HASH
else
offload &= ~RSS_HASH
> Should I care about it?
>
>>> [1]
>>>
>>> @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
>>> nb_rx_q, uint16_t nb_tx_q,
>>> goto rollback;
>>> }
>>>
>>> + /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>>> + if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>>> + (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>>> + RTE_ETHDEV_LOG(ERR,
>>> + "Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is
>>> requested",
>>> + port_id,
>>> + rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>>> + ret = -EINVAL;
>>> + goto rollback;
>>> + }
>
On 11/14/2019 1:59 PM, Ferruh Yigit wrote:
> On 11/14/2019 1:24 PM, Andrew Rybchenko wrote:
>> On 11/14/19 3:57 PM, Jerin Jacob wrote:
>>> On Wed, Nov 13, 2019 at 11:32 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>> On 11/11/2019 1:19 PM, pbhagavatula@marvell.com wrote:
>>>>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>>> index 30c0379d4..8c1caac18 100644
>>>>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>>>>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>>>>> @@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
>>>>> int ret;
>>>>>
>>>>> PMD_INIT_FUNC_TRACE();
>>>>> +
>>>>> + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
>>>>> +
>>>> Hi Pavan, Andrew, Jerin,
>>>>
>>>> This is causing trouble when device is re-configured with its existing data,
>>>> because of the check in the ethdev [1].
>>>>
>>>> This is for the case device configuration get, a few thing changed and
>>>> re-configured case, this is what is done in bonding and it is failing now.
>>>>
>>>> Do you have any suggestion for the solution?
>>>>
>>>> We can set this offload in PMDs only if 'ETH_MQ_RX_RSS_FLAG' set but same thing
>>>> still can caught us, if the initial configuration was with 'ETH_MQ_RX_RSS_FLAG'
>>>> but reconfigure is not.
>>>>
>>>> Or we can relax the check in 'rte_eth_dev_configure()' to log but not return error?
>>> IMO, We can relax the check as it is NOT at all critical for this flag.
>>
>> Other option is to set RSS_HASH above if (dev_conf->rxmode.mq_mode &
>> ETH_MQ_RX_RSS_FLAG).
>
> +1 to this check in PMDs, even we can disable the RSS_HASH offload when RSS is
> not enabled [2], but this won't solve the problem completely. User can do first
> configure with RSS enabled and second with RSS disabled, it will be same issue.
>
> [2]
> in PMD, configure():
> if (dev_conf->rxmode.mq_mode & TH_MQ_RX_RSS_FLAG)
> offload |= RSS_HASH
> else
> offload &= ~RSS_HASH
Hi Pavan, Andrew, Jerin,
All this bonding issue, tespmd rx_offload copy not being correct, the fail log
on each app start because PMD force enables this config.
I remember I have requested it to keep the device configuration correct, but it
is causing more troubles than expected.
Instead we can remove those PMD updates, so when application not requested
RSS_HAS, PMD will say OK and update the configuration according, but indeed it
will continue to update mbuf:rss:hash fields, since PMD is doing more than
requested this shouldn't be a problem in application side.
The behavior can be fixed when PMD implements the disabling RSS_HASH but this is
most probably won't happen for some PMDs because of performance reasons. So the
device configuration may remain wrong for those PMDs.
Overall, since that was the case in prev versions, I believe you are OK but can
you confirm again please?
>
>> Should I care about it?
>>
>>>> [1]
>>>>
>>>> @@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t
>>>> nb_rx_q, uint16_t nb_tx_q,
>>>> goto rollback;
>>>> }
>>>>
>>>> + /* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>>>> + if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
>>>> + (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
>>>> + RTE_ETHDEV_LOG(ERR,
>>>> + "Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is
>>>> requested",
>>>> + port_id,
>>>> + rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
>>>> + ret = -EINVAL;
>>>> + goto rollback;
>>>> + }
>>
>
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
DEV_RX_OFFLOAD_KEEP_CRC | \
DEV_RX_OFFLOAD_VLAN_EXTEND | \
DEV_RX_OFFLOAD_TCP_LRO | \
- DEV_RX_OFFLOAD_SCATTER)
+ DEV_RX_OFFLOAD_SCATTER | \
+ DEV_RX_OFFLOAD_RSS_HASH)
static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask);
static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
@@ -673,6 +674,9 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
bp->rx_cp_nr_rings = bp->rx_nr_rings;
bp->tx_cp_nr_rings = bp->tx_nr_rings;
+ rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+ eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+
if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
eth_dev->data->mtu =
eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
@@ -47,7 +47,8 @@
DEV_RX_OFFLOAD_UDP_CKSUM | \
DEV_RX_OFFLOAD_TCP_CKSUM | \
DEV_RX_OFFLOAD_JUMBO_FRAME | \
- DEV_RX_OFFLOAD_SCATTER)
+ DEV_RX_OFFLOAD_SCATTER | \
+ DEV_RX_OFFLOAD_RSS_HASH)
/* Common PF and VF devargs */
@@ -426,6 +426,8 @@ int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)
CXGBE_FUNC_TRACE();
+ eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
if (!(adapter->flags & FW_QUEUE_BOUND)) {
err = cxgbe_setup_sge_fwevtq(adapter);
if (err)
@@ -56,7 +56,8 @@ static uint64_t dev_rx_offloads_nodis =
DEV_RX_OFFLOAD_IPV4_CKSUM |
DEV_RX_OFFLOAD_UDP_CKSUM |
DEV_RX_OFFLOAD_TCP_CKSUM |
- DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+ DEV_RX_OFFLOAD_RSS_HASH;
/* Supported Tx offloads */
static uint64_t dev_tx_offloads_sup =
@@ -45,6 +45,7 @@ static uint64_t dev_rx_offloads_sup =
/* Rx offloads which cannot be disabled */
static uint64_t dev_rx_offloads_nodis =
+ DEV_RX_OFFLOAD_RSS_HASH |
DEV_RX_OFFLOAD_SCATTER;
/* Supported Tx offloads */
@@ -1182,6 +1182,8 @@ eth_igb_configure(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* multipe queue mode checking */
ret = igb_check_mq_mode(dev);
if (ret != 0) {
@@ -3257,6 +3259,8 @@ igbvf_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
dev->data->port_id);
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/*
* VF has no ability to enable/disable HW CRC
* Keep the persistent behavior the same as Host PF
@@ -1646,7 +1646,8 @@ igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
DEV_RX_OFFLOAD_TCP_CKSUM |
DEV_RX_OFFLOAD_JUMBO_FRAME |
DEV_RX_OFFLOAD_KEEP_CRC |
- DEV_RX_OFFLOAD_SCATTER;
+ DEV_RX_OFFLOAD_SCATTER |
+ DEV_RX_OFFLOAD_RSS_HASH;
return rx_offload_capa;
}
@@ -405,6 +405,8 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
return ret;
}
+ eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
enic->mc_count = 0;
enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
DEV_RX_OFFLOAD_CHECKSUM);
@@ -205,7 +205,8 @@ int enic_get_vnic_config(struct enic *enic)
DEV_RX_OFFLOAD_VLAN_STRIP |
DEV_RX_OFFLOAD_IPV4_CKSUM |
DEV_RX_OFFLOAD_UDP_CKSUM |
- DEV_RX_OFFLOAD_TCP_CKSUM;
+ DEV_RX_OFFLOAD_TCP_CKSUM |
+ DEV_RX_OFFLOAD_RSS_HASH;
enic->tx_offload_mask =
PKT_TX_IPV6 |
PKT_TX_IPV4 |
@@ -461,6 +461,8 @@ fm10k_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* multipe queue mode checking */
ret = fm10k_check_mq_mode(dev);
if (ret != 0) {
@@ -1805,7 +1807,8 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
DEV_RX_OFFLOAD_UDP_CKSUM |
DEV_RX_OFFLOAD_TCP_CKSUM |
DEV_RX_OFFLOAD_JUMBO_FRAME |
- DEV_RX_OFFLOAD_HEADER_SPLIT);
+ DEV_RX_OFFLOAD_HEADER_SPLIT |
+ DEV_RX_OFFLOAD_RSS_HASH);
}
static int
@@ -318,6 +318,8 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
return -EINVAL;
}
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* mtu size is 256~9600 */
if (dev->data->dev_conf.rxmode.max_rx_pkt_len < HINIC_MIN_FRAME_SIZE ||
dev->data->dev_conf.rxmode.max_rx_pkt_len >
@@ -740,7 +742,8 @@ hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
DEV_RX_OFFLOAD_VLAN_FILTER |
DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_JUMBO_FRAME |
- DEV_RX_OFFLOAD_TCP_LRO;
+ DEV_RX_OFFLOAD_TCP_LRO |
+ DEV_RX_OFFLOAD_RSS_HASH;
info->tx_queue_offload_capa = 0;
info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
@@ -1812,6 +1812,8 @@ i40e_dev_configure(struct rte_eth_dev *dev)
ad->tx_simple_allowed = true;
ad->tx_vec_allowed = true;
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* Only legacy filter API needs the following fdir config. So when the
* legacy filter API is deprecated, the following codes should also be
* removed.
@@ -3613,7 +3615,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_VLAN_EXTEND |
DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_JUMBO_FRAME;
+ DEV_RX_OFFLOAD_JUMBO_FRAME |
+ DEV_RX_OFFLOAD_RSS_HASH;
dev_info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
dev_info->tx_offload_capa =
@@ -147,6 +147,8 @@ iavf_dev_configure(struct rte_eth_dev *dev)
ad->rx_vec_allowed = true;
ad->tx_vec_allowed = true;
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* Vlan stripping setting */
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {
if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
@@ -522,7 +524,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_JUMBO_FRAME |
- DEV_RX_OFFLOAD_VLAN_FILTER;
+ DEV_RX_OFFLOAD_VLAN_FILTER |
+ DEV_RX_OFFLOAD_RSS_HASH;
dev_info->tx_offload_capa =
DEV_TX_OFFLOAD_VLAN_INSERT |
DEV_TX_OFFLOAD_QINQ_INSERT |
@@ -2357,6 +2357,8 @@ ice_dev_configure(struct rte_eth_dev *dev)
ad->rx_bulk_alloc_allowed = true;
ad->tx_simple_allowed = true;
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
return 0;
}
@@ -2809,7 +2811,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
DEV_RX_OFFLOAD_TCP_CKSUM |
DEV_RX_OFFLOAD_QINQ_STRIP |
DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
- DEV_RX_OFFLOAD_VLAN_EXTEND;
+ DEV_RX_OFFLOAD_VLAN_EXTEND |
+ DEV_RX_OFFLOAD_RSS_HASH;
dev_info->tx_offload_capa |=
DEV_TX_OFFLOAD_QINQ_INSERT |
DEV_TX_OFFLOAD_IPV4_CKSUM |
@@ -2402,6 +2402,9 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
int ret;
PMD_INIT_FUNC_TRACE();
+
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* multipe queue mode checking */
ret = ixgbe_check_mq_mode(dev);
if (ret != 0) {
@@ -5155,6 +5158,8 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
dev->data->port_id);
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/*
* VF has no ability to enable/disable HW CRC
* Keep the persistent behavior the same as Host PF
@@ -2872,7 +2872,8 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
DEV_RX_OFFLOAD_KEEP_CRC |
DEV_RX_OFFLOAD_JUMBO_FRAME |
DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_SCATTER;
+ DEV_RX_OFFLOAD_SCATTER |
+ DEV_RX_OFFLOAD_RSS_HASH;
if (hw->mac.type == ixgbe_mac_82598EB)
offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
@@ -412,7 +412,8 @@ lio_dev_info_get(struct rte_eth_dev *eth_dev,
devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
DEV_RX_OFFLOAD_UDP_CKSUM |
DEV_RX_OFFLOAD_TCP_CKSUM |
- DEV_RX_OFFLOAD_VLAN_STRIP);
+ DEV_RX_OFFLOAD_VLAN_STRIP |
+ DEV_RX_OFFLOAD_RSS_HASH);
devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM |
DEV_TX_OFFLOAD_UDP_CKSUM |
DEV_TX_OFFLOAD_TCP_CKSUM |
@@ -1735,6 +1736,8 @@ lio_dev_configure(struct rte_eth_dev *eth_dev)
PMD_INIT_FUNC_TRACE();
+ eth_dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* Inform firmware about change in number of queues to use.
* Disable IO queues and reset registers for re-configuration.
*/
@@ -248,6 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
struct rte_flow_error error;
int ret;
+ dev->data->dev_conf.rxmode.offload |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* Prepare internal flow rules. */
ret = mlx4_flow_sync(priv, &error);
if (ret) {
@@ -685,7 +685,8 @@ mlx4_get_rx_queue_offloads(struct mlx4_priv *priv)
{
uint64_t offloads = DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_KEEP_CRC |
- DEV_RX_OFFLOAD_JUMBO_FRAME;
+ DEV_RX_OFFLOAD_JUMBO_FRAME |
+ DEV_RX_OFFLOAD_RSS_HASH;
if (priv->hw_csum)
offloads |= DEV_RX_OFFLOAD_CHECKSUM;
@@ -404,6 +404,9 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
rte_errno = ENOMEM;
return -rte_errno;
}
+
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
memcpy(priv->rss_conf.rss_key,
use_app_rss_key ?
dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
@@ -372,7 +372,8 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev *dev)
struct mlx5_dev_config *config = &priv->config;
uint64_t offloads = (DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_TIMESTAMP |
- DEV_RX_OFFLOAD_JUMBO_FRAME);
+ DEV_RX_OFFLOAD_JUMBO_FRAME |
+ DEV_RX_OFFLOAD_RSS_HASH);
if (config->hw_fcs_strip)
offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
@@ -532,6 +532,8 @@ static int hn_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
+ dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
if (unsupported) {
PMD_DRV_LOG(NOTICE,
@@ -897,7 +897,8 @@ int hn_rndis_get_offload(struct hn_data *hv,
== HN_NDIS_LSOV2_CAP_IP6)
dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
- dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
+ dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |
+ DEV_RX_OFFLOAD_RSS_HASH;
if (hwcaps.ndis_csum.ndis_ip4_rxcsum & NDIS_RXCSUM_CAP_IP4)
dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_IPV4_CKSUM;
@@ -407,6 +407,8 @@ nfp_net_configure(struct rte_eth_dev *dev)
rxmode = &dev_conf->rxmode;
txmode = &dev_conf->txmode;
+ rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* Checking TX mode */
if (txmode->mq_mode) {
PMD_INIT_LOG(INFO, "TX mq_mode DCB and VMDq not supported");
@@ -1236,7 +1238,8 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
DEV_RX_OFFLOAD_UDP_CKSUM |
DEV_RX_OFFLOAD_TCP_CKSUM;
- dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME;
+ dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME |
+ DEV_RX_OFFLOAD_RSS_HASH;
if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)
dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;
@@ -599,7 +599,8 @@ nix_rx_offload_flags(struct rte_eth_dev *eth_dev)
struct rte_eth_rxmode *rxmode = &conf->rxmode;
uint16_t flags = 0;
- if (rxmode->mq_mode == ETH_MQ_RX_RSS)
+ if (rxmode->mq_mode == ETH_MQ_RX_RSS &&
+ (dev->rx_offloads & DEV_RX_OFFLOAD_RSS_HASH))
flags |= NIX_RX_OFFLOAD_RSS_F;
if (dev->rx_offloads & (DEV_RX_OFFLOAD_TCP_CKSUM |
@@ -122,8 +122,8 @@
DEV_TX_OFFLOAD_MT_LOCKFREE | \
DEV_TX_OFFLOAD_VLAN_INSERT | \
DEV_TX_OFFLOAD_QINQ_INSERT | \
- DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \
- DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \
+ DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | \
+ DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \
DEV_TX_OFFLOAD_TCP_CKSUM | \
DEV_TX_OFFLOAD_UDP_CKSUM | \
DEV_TX_OFFLOAD_SCTP_CKSUM | \
@@ -140,11 +140,12 @@
DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \
DEV_RX_OFFLOAD_SCATTER | \
DEV_RX_OFFLOAD_JUMBO_FRAME | \
- DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \
- DEV_RX_OFFLOAD_VLAN_STRIP | \
- DEV_RX_OFFLOAD_VLAN_FILTER | \
- DEV_RX_OFFLOAD_QINQ_STRIP | \
- DEV_RX_OFFLOAD_TIMESTAMP)
+ DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \
+ DEV_RX_OFFLOAD_VLAN_STRIP | \
+ DEV_RX_OFFLOAD_VLAN_FILTER | \
+ DEV_RX_OFFLOAD_QINQ_STRIP | \
+ DEV_RX_OFFLOAD_TIMESTAMP | \
+ DEV_RX_OFFLOAD_RSS_HASH)
#define NIX_DEFAULT_RSS_CTX_GROUP 0
#define NIX_DEFAULT_RSS_MCAM_IDX -1
@@ -1186,6 +1186,8 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
PMD_INIT_FUNC_TRACE(edev);
+ rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
/* We need to have min 1 RX queue.There is no min check in
* rte_eth_dev_configure(), so we are checking it here.
*/
@@ -1306,7 +1308,8 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
DEV_RX_OFFLOAD_SCATTER |
DEV_RX_OFFLOAD_JUMBO_FRAME |
DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP);
+ DEV_RX_OFFLOAD_VLAN_STRIP |
+ DEV_RX_OFFLOAD_RSS_HASH);
dev_info->rx_queue_offload_capa = 0;
/* TX offloads are on a per-packet basis, so it is applicable
@@ -715,7 +715,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
},
.features = SFC_DP_RX_FEAT_FLOW_FLAG |
SFC_DP_RX_FEAT_FLOW_MARK,
- .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM,
+ .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM |
+ DEV_RX_OFFLOAD_RSS_HASH,
.queue_offload_capa = 0,
.get_dev_info = sfc_ef10_essb_rx_get_dev_info,
.pool_ops_supported = sfc_ef10_essb_rx_pool_ops_supported,
@@ -796,7 +796,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
.features = SFC_DP_RX_FEAT_MULTI_PROCESS |
SFC_DP_RX_FEAT_INTR,
.dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM |
- DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM,
+ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+ DEV_RX_OFFLOAD_RSS_HASH,
.queue_offload_capa = DEV_RX_OFFLOAD_SCATTER,
.get_dev_info = sfc_ef10_rx_get_dev_info,
.qsize_up_rings = sfc_ef10_rx_qsize_up_rings,
@@ -617,7 +617,8 @@ struct sfc_dp_rx sfc_efx_rx = {
.hw_fw_caps = 0,
},
.features = SFC_DP_RX_FEAT_INTR,
- .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM,
+ .dev_offload_capa = DEV_RX_OFFLOAD_CHECKSUM |
+ DEV_RX_OFFLOAD_RSS_HASH,
.queue_offload_capa = DEV_RX_OFFLOAD_SCATTER,
.qsize_up_rings = sfc_efx_rx_qsize_up_rings,
.qcreate = sfc_efx_rx_qcreate,
@@ -1556,6 +1557,10 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
}
+ if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
+ (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+ rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
return rc;
}
@@ -1920,6 +1920,8 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
+ rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
if (!rte_eal_has_hugepages()) {
PMD_INIT_LOG(INFO, "Huge page is not configured");
return -EINVAL;
@@ -41,7 +41,8 @@
DEV_RX_OFFLOAD_CHECKSUM | \
DEV_RX_OFFLOAD_VLAN_STRIP | \
DEV_RX_OFFLOAD_JUMBO_FRAME | \
- DEV_RX_OFFLOAD_SCATTER)
+ DEV_RX_OFFLOAD_SCATTER | \
+ DEV_RX_OFFLOAD_RSS_HASH)
#define NICVF_DEFAULT_RX_FREE_THRESH 224
#define NICVF_DEFAULT_TX_FREE_THRESH 224
@@ -56,7 +56,8 @@
DEV_RX_OFFLOAD_UDP_CKSUM | \
DEV_RX_OFFLOAD_TCP_CKSUM | \
DEV_RX_OFFLOAD_TCP_LRO | \
- DEV_RX_OFFLOAD_JUMBO_FRAME)
+ DEV_RX_OFFLOAD_JUMBO_FRAME | \
+ DEV_RX_OFFLOAD_RSS_HASH)
static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
static int eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -407,6 +408,8 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
if (dev->data->nb_tx_queues > VMXNET3_MAX_TX_QUEUES ||
dev->data->nb_rx_queues > VMXNET3_MAX_RX_QUEUES) {
PMD_INIT_LOG(ERR, "ERROR: Number of queues not supported");