From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id EB01F1B1BE; Wed, 3 Jan 2018 11:32:40 +0100 (CET) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id C1B6F11CAC8; Wed, 3 Jan 2018 11:31:50 +0100 (CET) From: Olivier Matz To: dev@dpdk.org, Ajit Khaparde Cc: Ferruh Yigit , stable@dpdk.org Date: Wed, 3 Jan 2018 11:32:25 +0100 Message-Id: <20180103103225.7120-2-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180103103225.7120-1-olivier.matz@6wind.com> References: <20171214142825.28176-1-olivier.matz@6wind.com> <20180103103225.7120-1-olivier.matz@6wind.com> Subject: [dpdk-stable] [PATCH v2 2/2] net/bnxt: fix headroom initialization X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 10:32:41 -0000 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 Acked-by: Ajit Khaparde --- v1 -> v2: - invert patches 1/2 and 2/2 Note for backport: the first version of this patch [1] may apply more easily. [1] https://dpdk.org/dev/patchwork/patch/32266/ drivers/net/bnxt/bnxt_rxr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 89114ccb7..82c93d6dc 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -75,7 +75,7 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq, rx_buf->mbuf = mbuf; - rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf)); + rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf)); return 0; } @@ -102,7 +102,7 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq, rx_buf->mbuf = mbuf; - rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf)); + rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf)); return 0; } @@ -123,7 +123,7 @@ static inline void bnxt_reuse_rx_mbuf(struct bnxt_rx_ring_info *rxr, prod_bd = &rxr->rx_desc_ring[prod]; - prod_bd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf)); + prod_bd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf)); rxr->rx_prod = prod; } @@ -442,6 +442,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, rte_prefetch0(mbuf); + mbuf->data_off = RTE_PKTMBUF_HEADROOM; mbuf->nb_segs = 1; mbuf->next = NULL; mbuf->pkt_len = rxcmp->len; -- 2.11.0