<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi Bruce,<br>
</p>
<div class="moz-cite-prefix">On 02/12/2024 11:24, Bruce Richardson
wrote:<br>
</div>
<blockquote type="cite" cite="mid:20241202112444.1517416-10-bruce.richardson@intel.com">
<pre wrap="" class="moz-quote-pre">Merge in additional fields used by the ixgbe driver and then convert it
over to using the common Tx queue structure.
Signed-off-by: Bruce Richardson <a class="moz-txt-link-rfc2396E" href="mailto:bruce.richardson@intel.com"><bruce.richardson@intel.com></a>
---
drivers/net/_common_intel/tx.h | 14 +++-
drivers/net/ixgbe/ixgbe_ethdev.c | 4 +-
.../ixgbe/ixgbe_recycle_mbufs_vec_common.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 64 +++++++++----------
drivers/net/ixgbe/ixgbe_rxtx.h | 56 ++--------------
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 26 ++++----
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 14 ++--
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 14 ++--
8 files changed, 80 insertions(+), 114 deletions(-)
diff --git a/drivers/net/_common_intel/tx.h b/drivers/net/_common_intel/tx.h
index c4a1a0c816..51ae3b051d 100644
--- a/drivers/net/_common_intel/tx.h
+++ b/drivers/net/_common_intel/tx.h
@@ -34,9 +34,13 @@ struct ci_tx_queue {
volatile struct i40e_tx_desc *i40e_tx_ring;
volatile struct iavf_tx_desc *iavf_tx_ring;
volatile struct ice_tx_desc *ice_tx_ring;
+ volatile union ixgbe_adv_tx_desc *ixgbe_tx_ring;
};
volatile uint8_t *qtx_tail; /* register address of tail */
- struct ci_tx_entry *sw_ring; /* virtual address of SW ring */
+ union {
+ struct ci_tx_entry *sw_ring; /* virtual address of SW ring */
+ struct ci_tx_entry_vec *sw_ring_vec;
+ };
rte_iova_t tx_ring_dma; /* TX ring DMA address */
uint16_t nb_tx_desc; /* number of TX descriptors */
uint16_t tx_tail; /* current value of tail register */
@@ -87,6 +91,14 @@ struct ci_tx_queue {
uint8_t tc;
bool use_ctx; /* with ctx info, each pkt needs two descriptors */
};
+ struct { /* ixgbe specific values */
+ const struct ixgbe_txq_ops *ops;
+ struct ixgbe_advctx_info *ctx_cache;</pre>
</blockquote>
'struct ixgbe_advctx_info ctx_cache[<span data-teams="true">IXGBE_CTX_NUM</span>];'
<span data-teams="true">takes only 80 bytes of memory, so </span><span data-teams="true">using a pointer saves 72 bytes. Since the final
version of the 'struct ci_tx_queue' without driver specific fields
takes 96 bytes, embedding 'ixgbe_advctx_info </span>ctx_cache<span data-teams="true">[2]' array will take one more cache line, which
is hot a huge deal in my opinion.</span><span data-teams="true">
<p>Or consider another (possibly better) approach, where for non
IXGBE <span data-teams="true">'struct ci_tx_queue' will remain
the same size, but only for IXGBE an extra 80 bytes will be
alllocated</span>:</p>
<p><span data-teams="true">
<p>struct {<span style="color: rgb(43, 155, 98);"> /* ixgbe
specific values */</span></p>
<p> const struct ixgbe_txq_ops *ops;</p>
<p> uint32_t ctx_curr;</p>
<p> uint8_t pthresh;<span style="color: rgb(43, 155, 98);"> /**< Prefetch
threshold register. */</span></p>
<p> uint8_t hthresh;<span style="color: rgb(43, 155, 98);"> /**< Host threshold
register. */</span></p>
<p> uint8_t wthresh;<span style="color: rgb(43, 155, 98);"> /**< Write-back
threshold reg. */</span></p>
<p> uint8_t using_ipsec;<span style="color: rgb(43, 155, 98);"> /**< indicates that
IPsec TX feature is in use */</span><br>
<span style="color: rgb(43, 155, 98);">
</span><span style="color: inherit;">struct
ixgbe_advctx_info ctx_cache[0];</span></p>
<p> };</p>
</span></p>
</span>
<blockquote type="cite" cite="mid:20241202112444.1517416-10-bruce.richardson@intel.com">
<pre wrap="" class="moz-quote-pre">
+ uint32_t ctx_curr;
+#ifdef RTE_LIB_SECURITY
+ uint8_t using_ipsec; /**< indicates that IPsec TX feature is in use */
+#endif
+ };
};
};
</pre>
</blockquote>
<snip><br>
<blockquote type="cite" cite="mid:20241202112444.1517416-10-bruce.richardson@intel.com">
<pre wrap="" class="moz-quote-pre">
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Regards,
Vladimir</pre>
</body>
</html>