summaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-04-27 16:43:44 -0400
committerDave Barach <openvpp@barachs.net>2016-04-27 21:11:12 +0000
commitacc22d7c45f3838fde53e759fcc44117e2668f26 (patch)
tree2962719c715853207c13c2a588a21f78f5b892f2 /dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch
parent2a00d171a04f00a95b131b089d100b7a62a99adc (diff)
ENIC driver updates for DPDK 16.04 and 2.2.0
Change-Id: I896925ea2208d318d353d486707b97f295c78426 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch')
-rw-r--r--dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch b/dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch
new file mode 100644
index 00000000000..69ca3f31087
--- /dev/null
+++ b/dpdk/dpdk-2.2.0_patches/0025-enic-fix-misalignment-of-Rx-mbuf-data.patch
@@ -0,0 +1,55 @@
+From 454eb71eca1912e32a509c738a99a340cc2488cf Mon Sep 17 00:00:00 2001
+From: John Daley <johndale@cisco.com>
+Date: Mon, 25 Apr 2016 16:24:53 -0700
+Subject: [PATCH 2/3] enic: fix misalignment of Rx mbuf data
+
+Data DMA used m->data_off of uninitialized mbufs instead of
+RTE_PKTMBUF_HEADROOM, potentially causing Rx data to be
+placed at the wrong alignment in the mbuf.
+
+Fixes: 947d860c821f ("enic: improve Rx performance")
+Signed-off-by: John Daley <johndale@cisco.com>
+---
+ drivers/net/enic/enic_main.c | 5 +++--
+ drivers/net/enic/enic_rx.c | 6 ++++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
+index be4e9e5..646d87f 100644
+--- a/drivers/net/enic/enic_main.c
++++ b/drivers/net/enic/enic_main.c
+@@ -354,10 +354,11 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
+ return -ENOMEM;
+ }
+
+- dma_addr = (dma_addr_t)(mb->buf_physaddr + mb->data_off);
++ dma_addr = (dma_addr_t)(mb->buf_physaddr
++ + RTE_PKTMBUF_HEADROOM);
+
+ rq_enet_desc_enc(rqd, dma_addr, RQ_ENET_TYPE_ONLY_SOP,
+- mb->buf_len);
++ mb->buf_len - RTE_PKTMBUF_HEADROOM);
+ rq->mbuf_ring[i] = mb;
+ }
+
+diff --git a/drivers/net/enic/enic_rx.c b/drivers/net/enic/enic_rx.c
+index 232987a..39bb55c 100644
+--- a/drivers/net/enic/enic_rx.c
++++ b/drivers/net/enic/enic_rx.c
+@@ -314,9 +314,11 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+ + rx_id);
+
+ /* Push descriptor for newly allocated mbuf */
+- dma_addr = (dma_addr_t)(nmb->buf_physaddr + nmb->data_off);
++ dma_addr = (dma_addr_t)(nmb->buf_physaddr
++ + RTE_PKTMBUF_HEADROOM);
+ rqd_ptr->address = rte_cpu_to_le_64(dma_addr);
+- rqd_ptr->length_type = cpu_to_le16(nmb->buf_len);
++ rqd_ptr->length_type = cpu_to_le16(nmb->buf_len
++ - RTE_PKTMBUF_HEADROOM);
+
+ /* Fill in the rest of the mbuf */
+ rxmb->data_off = RTE_PKTMBUF_HEADROOM;
+--
+2.7.0
+