]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx4: check RSS queues number limitation
authorMoti Haimovsky <motih@mellanox.com>
Wed, 25 Jul 2018 14:47:39 +0000 (17:47 +0300)
committerShahaf Shuler <shahafs@mellanox.com>
Thu, 2 Aug 2018 10:34:16 +0000 (12:34 +0200)
This patch verifies that the number of Rx queues configured for RSS
is supported by the device hardware.
RSS support in mlx4 requires contiguous chunk of QPs to be reserved,
there is a hardware limitation on the amount of contiguous QPs which
is reported by the hardware. Ignoring this value will cause Rx queues
creation to fail.

Cc: stable@dpdk.org
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx4/mlx4.c
drivers/net/mlx4/mlx4.h
drivers/net/mlx4/mlx4_rxq.c

index c67d2c05df3b1ca765095d3b9e02c485dbe6e3de..defc0d4b0d12c326efaa24ba3d72af7175ca45e3 100644 (file)
@@ -673,6 +673,9 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                                                   &device_attr_ex);
                DEBUG("supported RSS hash fields mask: %016" PRIx64,
                      priv->hw_rss_sup);
+               priv->hw_rss_max_qps =
+                       device_attr_ex.rss_caps.max_rwq_indirection_table_size;
+               DEBUG("MAX RSS queues %d", priv->hw_rss_max_qps);
                priv->hw_fcs_strip = !!(device_attr_ex.raw_packet_caps &
                                        IBV_RAW_PACKET_CAP_SCATTER_FCS);
                DEBUG("FCS stripping toggling is %ssupported",
index 89d8c3839ad34c5d995919885fba1454dd35c270..e6fb934faa21326a9abf307b6035d71f88802725 100644 (file)
@@ -95,6 +95,7 @@ struct priv {
        uint32_t hw_fcs_strip:1; /**< FCS stripping toggling is supported. */
        uint32_t tso:1; /**< Transmit segmentation offload is supported. */
        uint32_t tso_max_payload_sz; /**< Max supported TSO payload size. */
+       uint32_t hw_rss_max_qps; /**< Max Rx Queues supported by RSS. */
        uint64_t hw_rss_sup; /**< Supported RSS hash fields (Verbs format). */
        struct rte_intr_handle intr_handle; /**< Port interrupt handle. */
        struct mlx4_drop *drop; /**< Shared resources for drop flow rules. */
index 0cd9560fc129201f5f0c195ee3d9ca25ee32d994..e8bef1d645907bf84dae4fa29b42ade80dc31536 100644 (file)
@@ -338,6 +338,12 @@ mlx4_rss_init(struct priv *priv)
 
        if (priv->rss_init)
                return 0;
+       if (priv->dev->data->nb_rx_queues > priv->hw_rss_max_qps) {
+               ERROR("RSS does not support more than %d queues",
+                     priv->hw_rss_max_qps);
+               rte_errno = EINVAL;
+               return -rte_errno;
+       }
        /* Prepare range for RSS contexts before creating the first WQ. */
        ret = mlx4_glue->dv_set_context_attr
                (priv->ctx,