aboutsummaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-07-20 16:14:57 -0400
committerJohn Lo <loj@cisco.com>2016-07-20 16:14:57 -0400
commit84bde8dc132f9be5cd208cf1ff446f366896a103 (patch)
tree4b7b213800ed7814b77471d8641e00193443e76f /dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch
parent914f91b837564416b3a8b15566c627aae6d567d2 (diff)
ENIC driver update to init mbuf data offset to RTE_PKTMBUF_HEADROOM
Change-Id: I19e3e2b28c45d9f7efdd791d6dab126f6508df3e Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch')
-rw-r--r--dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch b/dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch
new file mode 100644
index 00000000000..6bb043eb363
--- /dev/null
+++ b/dpdk/dpdk-16.04_patches/0030-net-enic-fix-possible-Rx-corruption.patch
@@ -0,0 +1,47 @@
+From cee88bcfd49cbf142c13ee7b6d2e77166c80bb48 Mon Sep 17 00:00:00 2001
+From: John Daley <johndale@cisco.com>
+Date: Tue, 19 Jul 2016 13:41:14 -0700
+Subject: [PATCH] net/enic: fix possible Rx corruption
+
+Initialize the mbuf data offset to RTE_PKTMBUF_HEADROOM as the
+enic takes ownership of them. If allocated mbufs had some offset
+other than RTE_PKTMBUF_HEADROOM, the application would read mbuf
+data starting at the wrong place and misinterpret the packet.
+
+Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")
+
+Reviewed-by: Nelson Escobar <neescoba@cisco.com>
+Signed-off-by: John Daley <johndale@cisco.com>
+---
+ drivers/net/enic/enic_main.c | 1 +
+ drivers/net/enic/enic_rxtx.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
+index 8cedebf..774fcb1 100644
+--- a/drivers/net/enic/enic_main.c
++++ b/drivers/net/enic/enic_main.c
+@@ -328,6 +328,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
+ return -ENOMEM;
+ }
+
++ mb->data_off = RTE_PKTMBUF_HEADROOM;
+ dma_addr = (dma_addr_t)(mb->buf_physaddr + RTE_PKTMBUF_HEADROOM);
+ rq_enet_desc_enc(rqd, dma_addr,
+ (rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
+diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
+index c68bbfb..60f5062 100644
+--- a/drivers/net/enic/enic_rxtx.c
++++ b/drivers/net/enic/enic_rxtx.c
+@@ -317,7 +317,7 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+ ciflags = enic_cq_rx_desc_ciflags((struct cq_enet_rq_desc *) &cqd);
+
+ /* Push descriptor for newly allocated mbuf */
+-
++ nmb->data_off = RTE_PKTMBUF_HEADROOM;
+ dma_addr = (dma_addr_t)(nmb->buf_physaddr + RTE_PKTMBUF_HEADROOM);
+ rq_enet_desc_enc(rqd_ptr, dma_addr,
+ (rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
+--
+2.7.0
+