patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/bnxt: fix headroom initialization
@ 2018-02-14  8:39 Olivier Matz
  2018-02-14 10:26 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Matz @ 2018-02-14  8:39 UTC (permalink / raw)
  To: stable, luca.boccassi

[ backported from upstream commit 35906acbf34daa32469fa63d759846057f36e6fb ]

When allocating a new mbuf for Rx, the value of m->data_off should not
be reset to its default value (RTE_PKTMBUF_HEADROOM), instead of reusing
the previous undefined value, which could cause the packet to have a too
small or too high headroom.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---

Hi Luca,

This patch is for the v16.11 stable branch.

Thanks,
Olivier


 drivers/net/bnxt/bnxt_rxr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 825337160..5698f02f3 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -72,7 +72,7 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq,
 
 	rx_buf->mbuf = data;
 
-	rxbd->addr = rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR(rx_buf->mbuf));
+	rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(data));
 
 	return 0;
 }
@@ -126,6 +126,7 @@ static uint16_t bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	mbuf = rx_buf->mbuf;
 	rte_prefetch0(mbuf);
 
+	mbuf->data_off = RTE_PKTMBUF_HEADROOM;
 	mbuf->nb_segs = 1;
 	mbuf->next = NULL;
 	mbuf->pkt_len = rxcmp->len;
-- 
2.11.0

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

* Re: [dpdk-stable] [PATCH] net/bnxt: fix headroom initialization
  2018-02-14  8:39 [dpdk-stable] [PATCH] net/bnxt: fix headroom initialization Olivier Matz
@ 2018-02-14 10:26 ` Luca Boccassi
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Boccassi @ 2018-02-14 10:26 UTC (permalink / raw)
  To: Olivier Matz, stable

On Wed, 2018-02-14 at 09:39 +0100, Olivier Matz wrote:
> [ backported from upstream commit
> 35906acbf34daa32469fa63d759846057f36e6fb ]
> 
> When allocating a new mbuf for Rx, the value of m->data_off should
> not
> be reset to its default value (RTE_PKTMBUF_HEADROOM), instead of
> reusing
> the previous undefined value, which could cause the packet to have a
> too
> small or too high headroom.
> 
> Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> 
> Hi Luca,
> 
> This patch is for the v16.11 stable branch.
> 
> Thanks,
> Olivier

Thank you very much, applied&pushed.

-- 
Kind regards,
Luca Boccassi

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

end of thread, other threads:[~2018-02-14 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14  8:39 [dpdk-stable] [PATCH] net/bnxt: fix headroom initialization Olivier Matz
2018-02-14 10:26 ` Luca Boccassi

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