From: Pawel Wodkowski Date: Thu, 19 Mar 2015 16:09:16 +0000 (+0100) Subject: ixgbe: fix buffer overrun in non-bulk alloc mode X-Git-Tag: spdx-start~9401 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6cb0bf33838aa15f8eaf6dbde522f10355629603;p=dpdk.git ixgbe: fix buffer overrun in non-bulk alloc mode 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: 01fa1d6215fa ("ixgbe: unify Rx setup") Signed-off-by: Pawel Wodkowski Acked-by: Pablo de Lara Acked-by: Konstantin Ananyev --- diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 7b603d0c2a..9da2c7e64a 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -2122,8 +2122,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;