]> git.droids-corp.org - dpdk.git/commitdiff
net/bnxt: fix flow creation with non-consecutive group ids
authorRahul Gupta <rahul.gupta@broadcom.com>
Wed, 13 Nov 2019 08:29:42 +0000 (13:59 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Nov 2019 16:36:05 +0000 (17:36 +0100)
In non-RSS mode, vnics map 1:1 with Rx queues during init. This can
create problems if non-consecutive group IDs are given as part of
subsequent flow create cmds as they can end up pointing to Rx queues
(mapped during init) that are different than the intended destination
queue as specified in the flow create cmd.
To fix this, now that we have the ability to dynamically create
vnics, do not create any additional vnics other than the default vnic
during init. Allocate them only during flow/filter creation time.

When RSS is disabled we need to use the COS queue count queried
from firmware.

Fixes: 36024b2e7fe5 ("net/bnxt: allow dynamic creation of VNIC")
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_flow.c
drivers/net/bnxt/bnxt_rxq.c

index 8f386cdf1331bc86106a9c4b6a80c540e1303c63..5af57144850474c837e58e6ccc847fb30c572a51 100644 (file)
@@ -1093,9 +1093,7 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
                    vnic->fw_vnic_id != INVALID_HW_RING_ID)
                        goto use_vnic;
 
-               if (!rxq ||
-                   bp->vnic_info[0].fw_grp_ids[act_q->index] !=
-                   INVALID_HW_RING_ID) {
+               if (!rxq) {
                        PMD_DRV_LOG(ERR,
                                    "Queue invalid or used with other VNIC\n");
                        rte_flow_error_set(error,
index fa11bec4ed2a45ae50e40a4de5da45ce1f9861e0..7db72542edd1c02588794a2a87c054279d2ca465 100644 (file)
@@ -35,7 +35,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
        int start_grp_id, end_grp_id = 1, rc = 0;
        struct bnxt_vnic_info *vnic;
        struct bnxt_filter_info *filter;
-       enum rte_eth_nb_pools pools = bp->rx_cp_nr_rings, max_pools = 0;
+       enum rte_eth_nb_pools pools = 1, max_pools = 0;
        struct bnxt_rx_queue *rxq;
 
        bp->nr_vnics = 0;
@@ -100,7 +100,11 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
                        rc = -EINVAL;
                        goto err_out;
                }
+       } else if (!dev_conf->rxmode.mq_mode) {
+               pools = bp->rx_cosq_cnt ? bp->rx_cosq_cnt : pools;
        }
+
+       pools = RTE_MIN(pools, bp->rx_cp_nr_rings);
        nb_q_per_grp = bp->rx_cp_nr_rings / pools;
        bp->rx_num_qs_per_vnic = nb_q_per_grp;
        PMD_DRV_LOG(DEBUG, "pools = %u nb_q_per_grp = %u\n",