DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: <dev@dpdk.org>
Cc: <thomas.monjalon@6wind.com>, <bruce.richardson@intel.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 2/3] net/thunderx: introduce cqe_rx2 HW capability flag
Date: Thu, 21 Jul 2016 19:31:46 +0530	[thread overview]
Message-ID: <1469109707-23213-3-git-send-email-jerin.jacob@caviumnetworks.com> (raw)
In-Reply-To: <1469109707-23213-1-git-send-email-jerin.jacob@caviumnetworks.com>

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 <jerin.jacob@caviumnetworks.com>
---
 drivers/net/thunderx/base/nicvf_hw.h | 5 +++--
 drivers/net/thunderx/nicvf_ethdev.c  | 7 ++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h
index 602a6ff..5629d9c 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 3802d49..f6faddf 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)) {
-- 
2.5.5

  parent reply	other threads:[~2016-07-21 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 14:01 [dpdk-dev] [PATCH 0/3] net/thunderx: add 81xx SoC support Jerin Jacob
2016-07-21 14:01 ` [dpdk-dev] [PATCH 1/3] net/thunderx: remove generic passx references from the driver Jerin Jacob
2016-07-21 14:01 ` Jerin Jacob [this message]
2016-07-21 14:01 ` [dpdk-dev] [PATCH 3/3] net/thunderx: add 81xx SoC support Jerin Jacob
2016-09-21 10:01 ` [dpdk-dev] [PATCH 0/3] " Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469109707-23213-3-git-send-email-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).