[PATCH v4 23/35] net/intel: add special handling for single desc packets

Bruce Richardson
2026-02-09T16:48:29Z

Within the scalar packets, add a shortcut path for packets that don't
use TSO and have only a single data descriptor.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/common/tx_scalar.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

diff --git a/drivers/net/intel/common/tx_scalar.h b/drivers/net/intel/common/tx_scalar.h
index cee8f11c7f..342e271c5f 100644
--- a/drivers/net/intel/common/tx_scalar.h
+++ b/drivers/net/intel/common/tx_scalar.h
@@ -298,6 +298,31 @@ ci_xmit_pkts(struct ci_tx_queue *txq,
ci_txd_enable_checksum(ol_flags, &td_cmd,
&td_offset, tx_offload);

+ /* special case for single descriptor packet, without TSO offload */
+ if (nb_used == 1 &&
+ (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) == 0) {
+ txd = &ci_tx_ring[tx_id];
+ tx_id = txe->next_id;
+
+ if (txe->mbuf)
+ rte_pktmbuf_free_seg(txe->mbuf);
+ *txe = (struct ci_tx_entry){
+ .mbuf = tx_pkt, .last_id = tx_last, .next_id = tx_id
+ };
+
+ /* Setup TX Descriptor */
+ td_cmd |= CI_TX_DESC_CMD_EOP;
+ const uint64_t cmd_type_offset_bsz = CI_TX_DESC_DTYPE_DATA |
+ ((uint64_t)td_cmd << CI_TXD_QW1_CMD_S) |
+ ((uint64_t)td_offset << CI_TXD_QW1_OFFSET_S) |
+ ((uint64_t)tx_pkt->data_len << CI_TXD_QW1_TX_BUF_SZ_S) |
+ ((uint64_t)td_tag << CI_TXD_QW1_L2TAG1_S);
+ write_txd(txd, rte_mbuf_data_iova(tx_pkt), cmd_type_offset_bsz);
+
+ txe = &sw_ring[tx_id];
+ goto end_pkt;
+ }
+
if (nb_ctx) {
/* Setup TX context descriptor if required */
uint64_t *ctx_txd = RTE_CAST_PTR(uint64_t *, &ci_tx_ring[tx_id]);
@@ -389,6 +414,7 @@ ci_xmit_pkts(struct ci_tx_queue *txq,
txe = txn;
m_seg = m_seg->next;
} while (m_seg);
+end_pkt:
txq->nb_tx_used = (uint16_t)(txq->nb_tx_used + nb_used);
txq->nb_tx_free = (uint16_t)(txq->nb_tx_free - nb_used);

--
2.51.0