DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pawel Wodkowski <pawelx.wodkowski@intel.com>
To: dev@dpdk.org
Cc: Pawel Wodkowski <pawelx.wdkowski@intel.com>
Subject: [dpdk-dev] [PATCH] ixgbe: fix buffer overrun bug in non-bulk alloc mode setup
Date: Thu, 19 Mar 2015 17:09:16 +0100	[thread overview]
Message-ID: <1426781356-13999-1-git-send-email-pawelx.wodkowski@intel.com> (raw)

From: Pawel Wodkowski <pawelx.wdkowski@intel.com>

When bulk alloc is enabled at compile time but preconditions for
it are not met at runtime the ixgbe_reset_rx_queue() function
overrides rxq->sw_ring not allocated elements.

Fixes: 01fa1d6 ("ixgbe: unify Rx setup")
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index 42f0aa5..dddc12f 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -2111,8 +2111,8 @@ ixgbe_reset_rx_queue(struct ixgbe_hw *hw, struct ixgbe_rx_queue *rxq)
 	 * entries is always allocated
 	 */
 	memset(&rxq->fake_mbuf, 0x0, sizeof(rxq->fake_mbuf));
-	for (i = 0; i < RTE_PMD_IXGBE_RX_MAX_BURST; ++i) {
-		rxq->sw_ring[rxq->nb_rx_desc + i].mbuf = &rxq->fake_mbuf;
+	for (i = rxq->nb_rx_desc; i < len; ++i) {
+		rxq->sw_ring[i].mbuf = &rxq->fake_mbuf;
 	}
 
 	rxq->rx_nb_avail = 0;
-- 
1.9.1

             reply	other threads:[~2015-03-19 16:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 16:09 Pawel Wodkowski [this message]
2015-03-19 17:02 ` De Lara Guarch, Pablo
2015-03-19 19:42 ` Ananyev, Konstantin
2015-03-20 21:46   ` Thomas Monjalon
2015-03-20  6:50 ` Jiajia, SunX
2015-03-20 21:45   ` Thomas Monjalon
2015-03-23  2:10     ` Jiajia, SunX

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=1426781356-13999-1-git-send-email-pawelx.wodkowski@intel.com \
    --to=pawelx.wodkowski@intel.com \
    --cc=dev@dpdk.org \
    --cc=pawelx.wdkowski@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;
as well as URLs for NNTP newsgroup(s).