summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
diff options
context:
space:
mode:
authorLance Richardson <lance.richardson@broadcom.com>2019-06-02 13:42:42 -0400
committerFerruh Yigit <ferruh.yigit@intel.com>2019-06-13 23:54:29 +0900
commitbb0546edfa6776b93b3011618dfc4f2af6a51f76 (patch)
treeec8e56d738b05a8e93f41128dd793afe3d875740 /drivers/net/bnxt/bnxt_rxr.c
parent79cc1efd99c6d9659a30f3b3c7fbc558343645a2 (diff)
downloaddpdk-next-eventdev-bb0546edfa6776b93b3011618dfc4f2af6a51f76.zip
dpdk-next-eventdev-bb0546edfa6776b93b3011618dfc4f2af6a51f76.tar.gz
dpdk-next-eventdev-bb0546edfa6776b93b3011618dfc4f2af6a51f76.tar.xz
net/bnxt: refactor doorbell handling
Reduce code duplication and prepare for newer controllers that use different doorbell protocols by refactoring doorbell handling code. Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 303549b..75d2c76 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -552,7 +552,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
break;
/* Post some Rx buf early in case of larger burst processing */
if (nb_rx_pkts == BNXT_RX_POST_THRESH)
- B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
+ bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
}
cpr->cp_raw_cons = raw_cons;
@@ -565,13 +565,13 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
}
if (prod != rxr->rx_prod)
- B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
+ bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
/* Ring the AGG ring DB */
if (ag_prod != rxr->ag_prod)
- B_RX_DB(rxr->ag_doorbell, rxr->ag_prod);
+ bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
- B_CP_DIS_DB(cpr, cpr->cp_raw_cons);
+ bnxt_db_cq(cpr);
/* Attempt to alloc Rx buf in case of a previous allocation failure. */
if (rc == -ENOMEM) {
@@ -588,7 +588,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
/* This slot is empty. Alloc buffer for Rx */
if (!bnxt_alloc_rx_data(rxq, rxr, i)) {
rxr->rx_prod = i;
- B_RX_DB(rxr->rx_doorbell, rxr->rx_prod);
+ bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
} else {
PMD_DRV_LOG(ERR, "Alloc mbuf failed\n");
break;