dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ixgbe: fix buffer overrun bug in non-bulk alloc mode setup
@ 2015-03-19 16:09 Pawel Wodkowski
       [not found] ` <1426781356-13999-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Pawel Wodkowski @ 2015-03-19 16:09 UTC (permalink / raw)
  To: dev-VfR2kkLFssw; +Cc: Pawel Wodkowski

From: Pawel Wodkowski <pawelx.wdkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-23  2:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 16:09 [PATCH] ixgbe: fix buffer overrun bug in non-bulk alloc mode setup Pawel Wodkowski
     [not found] ` <1426781356-13999-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-19 17:02   ` De Lara Guarch, Pablo
2015-03-19 19:42   ` Ananyev, Konstantin
     [not found]     ` <2601191342CEEE43887BDE71AB977258213F78FC-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-20 21:46       ` Thomas Monjalon
2015-03-20  6:50   ` Jiajia, SunX
     [not found]     ` <F21F274FCF2C0948830A3ED0034529772D3F50-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-20 21:45       ` Thomas Monjalon
2015-03-23  2:10         ` Jiajia, SunX

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).