From: Jerin Jacob Date: Thu, 21 Jul 2016 14:01:46 +0000 (+0530) Subject: net/thunderx: add tunneling extension info capability flag X-Git-Tag: spdx-start~5850 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e2c519b39257a925947b8a4d2eaf142d6d548722;p=dpdk.git net/thunderx: add tunneling extension info capability flag Certain thunderx SoC pass has additional optional word in Rx descriptor to hold tunneling extension info. Based on this capability, the location where packet pointer address stored in Rx descriptor will vary. Signed-off-by: Jerin Jacob --- diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h index 602a6fff4b..5629d9c130 100644 --- a/drivers/net/thunderx/base/nicvf_hw.h +++ b/drivers/net/thunderx/base/nicvf_hw.h @@ -50,8 +50,9 @@ #define NICVF_GET_TX_STATS(reg) \ nicvf_reg_read(nic, NIC_VNIC_TX_STAT_0_4 | (reg << 3)) - -#define NICVF_CAP_TUNNEL_PARSING (1ULL << 0) +#define NICVF_CAP_TUNNEL_PARSING (1ULL << 0) +/* Additional word in Rx descriptor to hold optional tunneling extension info */ +#define NICVF_CAP_CQE_RX2 (1ULL << 1) enum nicvf_tns_mode { NIC_TNS_BYPASS_MODE, diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 4dda64fc09..0875ba5566 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -1142,7 +1142,12 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, rxq->cq_status = nicvf_qset_base(nic, qidx) + NIC_QSET_CQ_0_7_STATUS; rxq->cq_door = nicvf_qset_base(nic, qidx) + NIC_QSET_CQ_0_7_DOOR; rxq->precharge_cnt = 0; - rxq->rbptr_offset = NICVF_CQE_RBPTR_WORD; + + if (nicvf_hw_cap(nic) & NICVF_CAP_CQE_RX2) + rxq->rbptr_offset = NICVF_CQE_RX2_RBPTR_WORD; + else + rxq->rbptr_offset = NICVF_CQE_RBPTR_WORD; + /* Alloc completion queue */ if (nicvf_qset_cq_alloc(nic, rxq, rxq->queue_id, nb_desc)) {