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:44 -0400
committerFerruh Yigit <ferruh.yigit@intel.com>2019-06-13 23:54:30 +0900
commitf8168ca0e690c31578d32bbf6ff7394b94459c4d (patch)
tree2add06dd0766e243dd5501b986dd292474eec8f7 /drivers/net/bnxt/bnxt_rxr.c
parent61d2b9a71dc611e7f683466abf3402005953c752 (diff)
downloaddpdk-next-eventdev-f8168ca0e690c31578d32bbf6ff7394b94459c4d.zip
dpdk-next-eventdev-f8168ca0e690c31578d32bbf6ff7394b94459c4d.tar.gz
dpdk-next-eventdev-f8168ca0e690c31578d32bbf6ff7394b94459c4d.tar.xz
net/bnxt: support thor controller
This commit adds support to the bnxt PMD for devices based on the BCM57508 "thor" Ethernet controller. Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 75d2c76..44303f3 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -637,6 +637,7 @@ void bnxt_free_rx_rings(struct bnxt *bp)
int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
{
struct bnxt_cp_ring_info *cpr;
+ struct bnxt_cp_ring_info *nqr;
struct bnxt_rx_ring_info *rxr;
struct bnxt_ring *ring;
@@ -685,6 +686,32 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
ring->vmem_size = 0;
ring->vmem = NULL;
+ if (BNXT_HAS_NQ(rxq->bp)) {
+ nqr = rte_zmalloc_socket("bnxt_rx_ring_cq",
+ sizeof(struct bnxt_cp_ring_info),
+ RTE_CACHE_LINE_SIZE, socket_id);
+ if (nqr == NULL)
+ return -ENOMEM;
+
+ rxq->nq_ring = nqr;
+
+ ring = rte_zmalloc_socket("bnxt_rx_ring_struct",
+ sizeof(struct bnxt_ring),
+ RTE_CACHE_LINE_SIZE, socket_id);
+ if (ring == NULL)
+ return -ENOMEM;
+
+ nqr->cp_ring_struct = ring;
+ ring->ring_size =
+ rte_align32pow2(rxr->rx_ring_struct->ring_size *
+ (2 + AGG_RING_SIZE_FACTOR));
+ ring->ring_mask = ring->ring_size - 1;
+ ring->bd = (void *)nqr->cp_desc_ring;
+ ring->bd_dma = nqr->cp_desc_mapping;
+ ring->vmem_size = 0;
+ ring->vmem = NULL;
+ }
+
/* Allocate Aggregator rings */
ring = rte_zmalloc_socket("bnxt_rx_ring_struct",
sizeof(struct bnxt_ring),