DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH v2 3/8] net/nfp: adjust the data field of Rx/Tx queue
Date: Fri, 19 Apr 2024 13:23:44 +0800	[thread overview]
Message-ID: <20240419052349.1294696-4-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240419052349.1294696-1-chaoyong.he@corigine.com>

Adjust the data field of Rx/Tx queue structure, move the cold data back
and hold position for hot data.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_rxtx.h | 71 +++++++++++++++++++-------------------
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index f463b9cf75..0aa73a6432 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -31,21 +31,6 @@ struct nfp_net_txq {
 	/** Backpointer to nfp_net structure */
 	struct nfp_net_hw *hw;
 
-	/** Point to the base of the queue structure on the NFP. */
-	uint8_t *qcp_q;
-
-	/**
-	 * Host side read and write pointer, they are free running and
-	 * have little relation to the QCP pointers.
-	 */
-	uint32_t wr_p;
-	uint32_t rd_p;
-
-	/** The size of the queue in number of descriptors. */
-	uint32_t tx_count;
-
-	uint32_t tx_free_thresh;
-
 	/**
 	 * For each descriptor keep a reference to the mbuf and
 	 * DMA address used until completion is signalled.
@@ -61,6 +46,18 @@ struct nfp_net_txq {
 		struct nfp_net_nfdk_tx_desc *ktxds;
 	};
 
+	/**
+	 * Host side read and write pointer, they are free running and
+	 * have little relation to the QCP pointers.
+	 */
+	uint32_t wr_p;
+	uint32_t rd_p;
+
+	/** The size of the queue in number of descriptors. */
+	uint32_t tx_count;
+
+	uint32_t tx_free_thresh;
+
 	/** The index of the QCP queue relative to the TX queue BAR. */
 	uint32_t tx_qcidx;
 
@@ -72,8 +69,8 @@ struct nfp_net_txq {
 	uint16_t data_pending;
 
 	/**
-	 * At this point 58 bytes have been used for all the fields in the
-	 * TX critical path. We have room for 6 bytes and still all placed
+	 * At this point 50 bytes have been used for all the fields in the
+	 * TX critical path. We have room for 14 bytes and still all placed
 	 * in a cache line.
 	 */
 	uint64_t dma;
@@ -83,6 +80,9 @@ struct nfp_net_txq {
 
 	/** TX pointer ring write back area DMA address */
 	uint64_t txrwb_dma;
+
+	/** Point to the base of the queue structure on the NFP. */
+	uint8_t *qcp_q;
 } __rte_aligned(64);
 
 /* RX and freelist descriptor format */
@@ -145,19 +145,6 @@ struct nfp_net_rxq {
 	 */
 	uint8_t *qcp_fl;
 
-	/**
-	 * Host side read pointer, free running and have little relation
-	 * to the QCP pointers. It is where the driver start reading
-	 * descriptors for newly arrive packets from.
-	 */
-	uint32_t rd_p;
-
-	/**
-	 * The index of the QCP queue relative to the RX queue BAR
-	 * used for the freelist.
-	 */
-	uint32_t fl_qcidx;
-
 	/**
 	 * For each buffer placed on the freelist, record the
 	 * associated mbuf.
@@ -177,6 +164,14 @@ struct nfp_net_rxq {
 	 * safely copied to the mbuf using the NFP_NET_RX_OFFSET.
 	 */
 	struct rte_mempool *mem_pool;
+
+	/**
+	 * Host side read pointer, free running and have little relation
+	 * to the QCP pointers. It is where the driver start reading
+	 * descriptors for newly arrive packets from.
+	 */
+	uint32_t rd_p;
+
 	uint16_t mbuf_size;
 
 	/**
@@ -186,9 +181,6 @@ struct nfp_net_rxq {
 	uint16_t rx_free_thresh;
 	uint16_t nb_rx_hold;
 
-	 /** The size of the queue in number of descriptors */
-	uint16_t rx_count;
-
 	/** Referencing dev->data->port_id */
 	uint16_t port_id;
 
@@ -196,11 +188,20 @@ struct nfp_net_rxq {
 	uint16_t qidx;
 
 	/**
-	 * At this point 60 bytes have been used for all the fields in the
-	 * RX critical path. We have room for 4 bytes and still all placed
+	 * At this point 54 bytes have been used for all the fields in the
+	 * RX critical path. We have room for 10 bytes and still all placed
 	 * in a cache line.
 	 */
 
+	/** The size of the queue in number of descriptors */
+	uint16_t rx_count;
+
+	/**
+	 * The index of the QCP queue relative to the RX queue BAR
+	 * used for the freelist.
+	 */
+	uint32_t fl_qcidx;
+
 	/** DMA address of the queue */
 	uint64_t dma;
 } __rte_aligned(64);
-- 
2.39.1


  parent reply	other threads:[~2024-04-19  5:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  3:12 [PATCH 0/8] refactor logic to support secondary process Chaoyong He
2024-04-19  3:12 ` [PATCH 1/8] net/nfp: fix resource leak of " Chaoyong He
2024-04-19  3:12 ` [PATCH 2/8] net/nfp: fix configuration BAR problem Chaoyong He
2024-04-19  3:12 ` [PATCH 3/8] net/nfp: adjust the data field of Rx/Tx queue Chaoyong He
2024-04-19  3:12 ` [PATCH 4/8] net/nfp: add the process private structure Chaoyong He
2024-04-19  3:12 ` [PATCH 5/8] net/nfp: move device info data field Chaoyong He
2024-04-19  3:12 ` [PATCH 6/8] net/nfp: unify CPP acquire method Chaoyong He
2024-04-19  3:12 ` [PATCH 7/8] net/nfp: remove ethernet device data field Chaoyong He
2024-04-19  3:12 ` [PATCH 8/8] net/nfp: unify port create and destroy interface Chaoyong He
2024-04-19  5:23 ` [PATCH 0/8] refactor logic to support secondary process Chaoyong He
2024-04-19  5:23   ` [PATCH v2 1/8] net/nfp: fix resource leak of " Chaoyong He
2024-04-19  5:23   ` [PATCH v2 2/8] net/nfp: fix configuration BAR problem Chaoyong He
2024-04-19  5:23   ` Chaoyong He [this message]
2024-04-19  5:23   ` [PATCH v2 4/8] net/nfp: add the process private structure Chaoyong He
2024-04-19  5:23   ` [PATCH v2 5/8] net/nfp: move device info data field Chaoyong He
2024-04-19  5:23   ` [PATCH v2 6/8] net/nfp: unify CPP acquire method Chaoyong He
2024-04-19  5:23   ` [PATCH v2 7/8] net/nfp: remove ethernet device data field Chaoyong He
2024-04-19  5:23   ` [PATCH v2 8/8] net/nfp: unify port create and destroy interface Chaoyong He
2024-05-20 22:19   ` [PATCH 0/8] refactor logic to support secondary process Ferruh Yigit
2024-05-21  2:17     ` Chaoyong He
2024-05-21 11:09       ` Ferruh Yigit
2024-05-21 11:24         ` Chaoyong He
2024-05-21 12:54           ` Ferruh Yigit
2024-05-21 15:08   ` Ferruh Yigit

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=20240419052349.1294696-4-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.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).