summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@broadcom.com>2018-06-28 13:15:35 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2018-07-03 01:35:58 +0200
commit14255b35153721456de9b4cdabf62c2e150f1119 (patch)
tree2c678bf5ec7bcbc0d79fa909f3e880f36c8193cd /drivers/net/bnxt/bnxt_rxr.c
parent12853bb6f7fe746893ccc243fe2a06274cb8ed7e (diff)
downloaddpdk-next-eventdev-14255b35153721456de9b4cdabf62c2e150f1119.zip
dpdk-next-eventdev-14255b35153721456de9b4cdabf62c2e150f1119.tar.gz
dpdk-next-eventdev-14255b35153721456de9b4cdabf62c2e150f1119.tar.xz
net/bnxt: fix queue start/stop operations
Packets destined to the to-be-stopped queue should not be dropped (neither in HW nor in the driver), so re-program the RSS Table without this queue on stop and add it back to the table on start unless it is a Representor VF. Since 0th entry is used for default ring, use fw_grp_id + 1 to change the RSS table population logic by programming valid IDs instead of the default zeroth entry in case of an invalid fw_grp_id. Destroy and recreate the trio of Rx rings(compl, Rx, AG) every time in start so that HW is in sync with software. Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index b6b72c5..c7bc884 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -541,7 +541,9 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
bool evt = false;
/* If Rx Q was stopped return. RxQ0 cannot be stopped. */
- if (rxq->rx_deferred_start && rxq->queue_id)
+ if (unlikely(((rxq->rx_deferred_start ||
+ !rte_spinlock_trylock(&rxq->lock)) &&
+ rxq->queue_id)))
return 0;
/* Handle RX burst request */
@@ -583,7 +585,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
* For PMD, there is no need to keep on pushing to REARM
* the doorbell if there are no new completions
*/
- return nb_rx_pkts;
+ goto done;
}
if (prod != rxr->rx_prod)
@@ -618,16 +620,22 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
}
}
+done:
+ rte_spinlock_unlock(&rxq->lock);
+
return nb_rx_pkts;
}
void bnxt_free_rx_rings(struct bnxt *bp)
{
int i;
+ struct bnxt_rx_queue *rxq;
- for (i = 0; i < (int)bp->rx_nr_rings; i++) {
- struct bnxt_rx_queue *rxq = bp->rx_queues[i];
+ if (!bp->rx_queues)
+ return;
+ for (i = 0; i < (int)bp->rx_nr_rings; i++) {
+ rxq = bp->rx_queues[i];
if (!rxq)
continue;