]> git.droids-corp.org - dpdk.git/commitdiff
drivers/net: fix RSS hash offload flag if no RSS
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 14 Nov 2019 16:40:50 +0000 (16:40 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Nov 2019 16:36:06 +0000 (17:36 +0100)
By default RSS hash delivery (offload) is bound to RSS mode and
it is incorrect to advertise it as enabled if Rx multi-queue mode
has no RSS.

Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
19 files changed:
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/cxgbe/cxgbe_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/enic/enic_ethdev.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/hinic/hinic_pmd_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/iavf/iavf_ethdev.c
drivers/net/ice/ice_ethdev.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/liquidio/lio_ethdev.c
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/netvsc/hn_ethdev.c
drivers/net/nfp/nfp_net.c
drivers/net/qede/qede_ethdev.c
drivers/net/sfc/sfc_rx.c
drivers/net/thunderx/nicvf_ethdev.c
drivers/net/vmxnet3/vmxnet3_ethdev.c

index 393706b80018de347e4521e623a6c8b1813b60b4..06033e3b8f52aa216cde40ad7fc2f04254127198 100644 (file)
@@ -674,7 +674,8 @@ 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;
+       if (eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
        eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
 
        if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
index 3dc9351a13348552ba5ace4f852ede65154b5b88..51b63ef574677102ed60e06ef74f43585f0fb689 100644 (file)
@@ -426,7 +426,9 @@ 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 (eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               eth_dev->data->dev_conf.rxmode.offloads |=
+                       DEV_RX_OFFLOAD_RSS_HASH;
 
        if (!(adapter->flags & FW_QUEUE_BOUND)) {
                err = cxgbe_setup_sge_fwevtq(adapter);
index 369a978adcae6b0e8acdcc77c799f5a849fd8b9f..2d2dc9cbefeb652fda5acd75bcc61e3c1268103a 100644 (file)
@@ -1182,7 +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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /* multipe queue mode checking */
        ret  = igb_check_mq_mode(dev);
@@ -3259,7 +3260,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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /*
         * VF has no ability to enable/disable HW CRC
index 683fed28b1b86a4f64d9d52fb6caefac07f3ded7..a7a178e41b15c79f91c60cded61a916160d1a334 100644 (file)
@@ -405,7 +405,9 @@ 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;
+       if (eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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 &
index 3114825220c85f0fe7d001fca7f55eb505ec3b3f..407baa16c364a0296478196ad00466079be927e8 100644 (file)
@@ -461,7 +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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /* multipe queue mode checking */
        ret  = fm10k_check_mq_mode(dev);
index 072fec339849f101ff8259888f16053b2f8e235a..ddfe0821427f924651636dd3cc0869f74378e235 100644 (file)
@@ -318,7 +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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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 ||
index 1afddeb1f3e6bbd49e4435a604a6216eadefedb7..5999c964bdb9a33f0dcd8c756470c79fe1a31951 100644 (file)
@@ -1816,7 +1816,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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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
index c23a8fc67505cf108b4cad43685b34365dd1d272..a39ba1466cbf7b543a83e1e9db6a42d2bf7366f2 100644 (file)
@@ -147,7 +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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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) {
index 7fd4bfe082b6e932335d642f61f738a7a5f3ad4d..837a26fd9ddb1b42b9d9b7116759efed95c84d11 100644 (file)
@@ -2445,7 +2445,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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        return 0;
 }
index 797f321e0eaa82ec3c50715c4f9ef39abd58b331..0084c3335ceb53e36361cece8bac5ad2813e1463 100644 (file)
@@ -2405,7 +2405,8 @@ ixgbe_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->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /* multipe queue mode checking */
        ret  = ixgbe_check_mq_mode(dev);
@@ -5160,7 +5161,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;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /*
         * VF has no ability to enable/disable HW CRC
index cdf979edbfb65cb4dfdda9f5b5b35cf6bbb82b0e..ad4a51ecdae0954b8cafb346973e091ec1b4d169 100644 (file)
@@ -1736,7 +1736,9 @@ 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;
+       if (eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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.
index 9b5c5477da5c7efbc6c08c80e95072e384f279d0..ab5e6c66cb44ae99e0281577d5fc55198fe843de 100644 (file)
@@ -248,7 +248,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
        struct rte_flow_error error;
        int ret;
 
-       dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /* Prepare internal flow rules. */
        ret = mlx4_flow_sync(priv, &error);
index 11efb2d8adac4fb77d21c3963e9a9bd3bec1020d..1d6c084119ec93e5c081b752574bf04aba6f1546 100644 (file)
@@ -405,7 +405,8 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
                return -rte_errno;
        }
 
-       dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        memcpy(priv->rss_conf.rss_key,
               use_app_rss_key ?
index 6589355090d7dd94fd3ace9bc0b5242e3ce9f132..164e9ad174a76fdf7afc8c1ae4548849a96509f6 100644 (file)
@@ -532,7 +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;
+       if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev_conf->rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        unsupported = txmode->offloads & ~HN_TX_OFFLOAD_CAPS;
        if (unsupported) {
index 7941248c0137abc7d1eae42cdd75fcbb1522c3c2..450875ce2facb976100d1df9e9fef8de9aa77eb9 100644 (file)
@@ -407,7 +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;
+       if (rxmode->mq_mode & ETH_MQ_RX_RSS_FLAG)
+               rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        /* Checking TX mode */
        if (txmode->mq_mode) {
index 853748afedce36d4e1ebd795b9e355fbd4fe1a7a..19d2e961913d24df1b543eed7bb1eb6f62134ed4 100644 (file)
@@ -1186,7 +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;
+       if (rxmode->mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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.
index 10fa1e5ff3163073216af025e818eb9e11e1d80d..74218296cd5b8ea10c924e676295a082afe5b63d 100644 (file)
@@ -1558,7 +1558,7 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
        }
 
        if ((offloads_supported & DEV_RX_OFFLOAD_RSS_HASH) &&
-           (~rxmode->offloads & DEV_RX_OFFLOAD_RSS_HASH))
+           (rxmode->mq_mode & ETH_MQ_RX_RSS_FLAG))
                rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        return rc;
index 062eec3f25ced2a35853b07062cbd27c26414454..2cf0ffe13b7ae292dfdf489edc9b01a4a0d2bfcd 100644 (file)
@@ -1920,7 +1920,8 @@ nicvf_dev_configure(struct rte_eth_dev *dev)
 
        PMD_INIT_FUNC_TRACE();
 
-       rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+       if (rxmode->mq_mode & ETH_MQ_RX_RSS_FLAG)
+               rxmode->offloads |= DEV_RX_OFFLOAD_RSS_HASH;
 
        if (!rte_eal_has_hugepages()) {
                PMD_INIT_LOG(INFO, "Huge page is not configured");
index 53fbd2bd036924439bd71f4558f41a9278122cb2..6e6efa960323aeb6511398650b9086f2b9f93527 100644 (file)
@@ -408,7 +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->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               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) {