DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sathesh Edara <sedara@marvell.com>
To: <sburla@marvell.com>, <jerinj@marvell.com>, <sedara@marvell.com>,
	"Radha Mohan Chintakuntla" <radhac@marvell.com>,
	Veerasenareddy Burru <vburru@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH v1 2/2] net/octeon_ep: support port kind
Date: Tue, 21 Feb 2023 06:36:26 -0800	[thread overview]
Message-ID: <20230221143627.219917-3-sedara@marvell.com> (raw)
In-Reply-To: <20230221143627.219917-1-sedara@marvell.com>

Added port kind functionality.

Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
 drivers/net/octeon_ep/otx_ep_common.h |  1 +
 drivers/net/octeon_ep/otx_ep_ethdev.c |  2 +-
 drivers/net/octeon_ep/otx_ep_rxtx.c   | 16 ++++++++--------
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 7eb50af75a..e4c92270d4 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -32,6 +32,7 @@
 #define OTX_EP_PCI_RING_ALIGN   65536
 #define SDP_PKIND 40
 #define SDP_OTX2_PKIND 57
+#define SDP_OTX2_PKIND_FS0 0
 
 #define      ORDERED_TAG 0
 #define      ATOMIC_TAG  1
diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
index 0930efedce..f43db1e398 100644
--- a/drivers/net/octeon_ep/otx_ep_ethdev.c
+++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
@@ -495,7 +495,7 @@ otx_ep_eth_dev_init(struct rte_eth_dev *eth_dev)
 
 	otx_epdev_init(otx_epvf);
 	if (pdev->id.device_id == PCI_DEVID_CN9K_EP_NET_VF)
-		otx_epvf->pkind = SDP_OTX2_PKIND;
+		otx_epvf->pkind = SDP_OTX2_PKIND_FS0;
 	else
 		otx_epvf->pkind = SDP_PKIND;
 	otx_ep_info("using pkind %d\n", otx_epvf->pkind);
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index 59df6ad857..6912ca2401 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -17,7 +17,8 @@
 #include "otx_ep_rxtx.h"
 
 /* SDP_LENGTH_S specifies packet length and is of 8-byte size */
-#define INFO_SIZE 8
+#define OTX_EP_INFO_SIZE 8
+#define OTX_EP_FSZ_FS0 0
 #define DROQ_REFILL_THRESHOLD 16
 
 static void
@@ -678,7 +679,7 @@ otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
 	iqcmd2.irh.u64 = 0;
 
 	/* ih invars */
-	iqcmd2.ih.s.fsz = OTX2_EP_FSZ;
+	iqcmd2.ih.s.fsz = OTX_EP_FSZ_FS0;
 	iqcmd2.ih.s.pkind = otx_ep->pkind; /* The SDK decided PKIND value */
 	/* irh invars */
 	iqcmd2.irh.s.opcode = OTX_EP_NW_PKT_OP;
@@ -875,12 +876,11 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
 
 	info->length = rte_bswap64(info->length);
 	/* Deduce the actual data size */
-	total_pkt_len = info->length + INFO_SIZE;
+	total_pkt_len = info->length + OTX_EP_INFO_SIZE;
 	if (total_pkt_len <= droq->buffer_size) {
-		info->length -=  OTX_EP_RH_SIZE;
 		droq_pkt  = droq->recv_buf_list[droq->read_idx];
 		if (likely(droq_pkt != NULL)) {
-			droq_pkt->data_off += OTX_EP_DROQ_INFO_SIZE;
+			droq_pkt->data_off += OTX_EP_INFO_SIZE;
 			/* otx_ep_dbg("OQ: pkt_len[%ld], buffer_size %d\n",
 			 * (long)info->length, droq->buffer_size);
 			 */
@@ -917,11 +917,11 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
 				droq_pkt->port = otx_ep->port_id;
 				if (!pkt_len) {
 					droq_pkt->data_off +=
-						OTX_EP_DROQ_INFO_SIZE;
+						OTX_EP_INFO_SIZE;
 					droq_pkt->pkt_len =
-						cpy_len - OTX_EP_DROQ_INFO_SIZE;
+						cpy_len - OTX_EP_INFO_SIZE;
 					droq_pkt->data_len =
-						cpy_len - OTX_EP_DROQ_INFO_SIZE;
+						cpy_len - OTX_EP_INFO_SIZE;
 				} else {
 					droq_pkt->pkt_len = cpy_len;
 					droq_pkt->data_len = cpy_len;
-- 
2.31.1


  parent reply	other threads:[~2023-02-21 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 14:36 [PATCH v1 0/2] net/octeon_ep: support device close and " Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 1/2] net/octeon_ep: support device close Sathesh Edara
2023-02-21 14:36 ` Sathesh Edara [this message]
2023-03-02 17:05   ` [PATCH v1 2/2] net/octeon_ep: support port kind Jerin Jacob

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=20230221143627.219917-3-sedara@marvell.com \
    --to=sedara@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=radhac@marvell.com \
    --cc=sburla@marvell.com \
    --cc=vburru@marvell.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).