DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shuzo Ichiyoshi <deadcafe.beef@gmail.com>
To: David Zage <david.zage@intel.com>,
	Song Yoong Siang <yoong.siang.song@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Shuzo Ichiyoshi <deadcafe.beef@gmail.com>, stable@dpdk.org
Subject: [PATCH 2/2] net/e1000: fix igc Tx descriptor ring wrap
Date: Mon, 29 Jun 2026 13:51:14 +0900	[thread overview]
Message-ID: <20260629045511.473850-2-deadcafe.beef@gmail.com> (raw)
In-Reply-To: <20260629045511.473850-1-deadcafe.beef@gmail.com>

igc_xmit_pkts() reserves two extra descriptors for launch time.
It indexed sw_ring[tx_last + 2] without wrapping the descriptor
index first.

If tx_last is one of the last two descriptors in the ring, this
reads past the software ring. Wrap the index before looking up
last_id.

Fixes: 2e79349dcd07 ("net/e1000: fix igc launch time calculation")
Cc: stable@dpdk.org
Signed-off-by: Shuzo Ichiyoshi <deadcafe.beef@gmail.com>
---
 drivers/net/intel/e1000/igc_txrx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/intel/e1000/igc_txrx.c b/drivers/net/intel/e1000/igc_txrx.c
index 1ab8f2079d..d61fdb33a8 100644
--- a/drivers/net/intel/e1000/igc_txrx.c
+++ b/drivers/net/intel/e1000/igc_txrx.c
@@ -1834,7 +1834,11 @@ igc_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		 * The "last descriptor" of the previously sent packet, if any,
 		 * which used the last descriptor to allocate.
 		 */
-		tx_end = sw_ring[tx_last + 2].last_id;
+		tx_end = (uint16_t)(tx_last + 2);
+		if (tx_end >= txq->nb_tx_desc)
+			tx_end = (uint16_t)(tx_end - txq->nb_tx_desc);
+
+		tx_end = sw_ring[tx_end].last_id;
 
 		/*
 		 * The next descriptor following that "last descriptor" in the
-- 
2.43.0


  reply	other threads:[~2026-06-29  4:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  4:51 [PATCH 1/2] net/e1000: fix igc RSS redirection table Shuzo Ichiyoshi
2026-06-29  4:51 ` Shuzo Ichiyoshi [this message]
2026-06-29  5:59   ` [PATCH 2/2] net/e1000: fix igc Tx descriptor ring wrap Song, Yoong Siang
2026-06-29 15:27     ` Bruce Richardson
2026-06-29 15:21 ` [PATCH 1/2] net/e1000: fix igc RSS redirection table Bruce Richardson
2026-06-29 15:50   ` 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=20260629045511.473850-2-deadcafe.beef@gmail.com \
    --to=deadcafe.beef@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.zage@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=yoong.siang.song@intel.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