summaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch
diff options
context:
space:
mode:
authorTodd Foggoa <tfoggoa@cisco.com>2016-04-06 09:57:01 -0400
committerTodd Foggoa <tfoggoa@cisco.com>2016-04-06 09:57:01 -0400
commita292c8c35794531d27a068310a76d067f2ccf56a (patch)
tree7b3ed299ee3f1c4d5e9b91f7da186ea3d65f596d /dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch
parent83cc4e140d4fdf915ae027851b442b2ff0a682e8 (diff)
Fix DPDK patch files so git am works smoothly
Change-Id: Ic2a6e6f1ceea81f2e34f3db370682569327b44ad Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
Diffstat (limited to 'dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch')
-rw-r--r--dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch b/dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch
new file mode 100644
index 00000000000..154e6f1e7ef
--- /dev/null
+++ b/dpdk/dpdk-2.2.0_patches/0021-enic-fix-TX-hang-when-number-of-packets-queue-size.patch
@@ -0,0 +1,89 @@
+From e89ea2a038987102d9eb0a7ea217d7a301b484cb Mon Sep 17 00:00:00 2001
+From: John Daley <johndale@cisco.com>
+Date: Thu, 24 Mar 2016 14:00:39 -0700
+Subject: [PATCH 21/22] enic: fix TX hang when number of packets > queue
+ size
+
+ If the nb_pkts parameter to rte_eth_tx_burst() was greater than
+ the TX descriptor count, a completion was not being requested
+ from the NIC, so descriptors would not be released back to the
+ host causing a lock-up.
+
+ Introduce a limit of how many TX descriptors can be used in a single
+ call to the enic PMD burst TX function before requesting a completion.
+
+ Fixes: d739ba4c6abf ("enic: improve Tx packet rate")
+
+ Signed-off-by: John Daley <johndale@cisco.com>
+---
+ drivers/net/enic/enic_ethdev.c | 20 ++++++++++++++++----
+ drivers/net/enic/enic_res.h | 1 +
+ 2 files changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
+index 6c3c734..61bb83c 100644
+--- a/drivers/net/enic/enic_ethdev.c
++++ b/drivers/net/enic/enic_ethdev.c
+@@ -510,7 +510,7 @@ static void enicpmd_remove_mac_addr(struct rte_eth_dev *eth_dev, __rte_unused ui
+ static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts)
+ {
+- unsigned int index;
++ uint16_t index;
+ unsigned int frags;
+ unsigned int pkt_len;
+ unsigned int seg_len;
+@@ -522,6 +522,7 @@ static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+ unsigned short vlan_id;
+ unsigned short ol_flags;
+ uint8_t last_seg, eop;
++ unsigned int host_tx_descs = 0;
+
+ for (index = 0; index < nb_pkts; index++) {
+ tx_pkt = *tx_pkts++;
+@@ -537,6 +538,7 @@ static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+ return index;
+ }
+ }
++
+ pkt_len = tx_pkt->pkt_len;
+ vlan_id = tx_pkt->vlan_tci;
+ ol_flags = tx_pkt->ol_flags;
+@@ -546,9 +548,19 @@ static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+ next_tx_pkt = tx_pkt->next;
+ seg_len = tx_pkt->data_len;
+ inc_len += seg_len;
+- eop = (pkt_len == inc_len) || (!next_tx_pkt);
+- last_seg = eop &&
+- (index == ((unsigned int)nb_pkts - 1));
++
++ host_tx_descs++;
++ last_seg = 0;
++ eop = 0;
++ if ((pkt_len == inc_len) || !next_tx_pkt) {
++ eop = 1;
++ /* post if last packet in batch or > thresh */
++ if ((index == (nb_pkts - 1)) ||
++ (host_tx_descs > ENIC_TX_POST_THRESH)) {
++ last_seg = 1;
++ host_tx_descs = 0;
++ }
++ }
+ enic_send_pkt(enic, wq, tx_pkt, (unsigned short)seg_len,
+ !frags, eop, last_seg, ol_flags, vlan_id);
+ tx_pkt = next_tx_pkt;
+diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
+index 33f2e84..00fa71d 100644
+--- a/drivers/net/enic/enic_res.h
++++ b/drivers/net/enic/enic_res.h
+@@ -53,6 +53,7 @@
+
+ #define ENIC_NON_TSO_MAX_DESC 16
+ #define ENIC_DEFAULT_RX_FREE_THRESH 32
++#define ENIC_TX_POST_THRESH (ENIC_MIN_WQ_DESCS / 2)
+
+ #define ENIC_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0)
+
+--
+1.9.1
+