DPDK patches and discussions
 help / color / mirror / Atom feed
From: John Daley <johndale@cisco.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>
Subject: [dpdk-dev] [PATCH v2 10/15] net/enic: reduce Tx completion updates
Date: Fri, 29 Jun 2018 02:29:39 -0700	[thread overview]
Message-ID: <20180629092944.15576-11-johndale@cisco.com> (raw)
In-Reply-To: <20180629092944.15576-1-johndale@cisco.com>

From: Hyong Youb Kim <hyonkim@cisco.com>

Request one completion update per roughly 32 buffers. It saves DMA
resources on the NIC, PCIe utilization, and cache miss rates.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/base/vnic_wq.c |  1 +
 drivers/net/enic/base/vnic_wq.h |  1 +
 drivers/net/enic/enic_res.h     |  3 +++
 drivers/net/enic/enic_rxtx.c    | 23 +++++++++++++++++------
 4 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c
index a4c08a769..c9bf3572c 100644
--- a/drivers/net/enic/base/vnic_wq.c
+++ b/drivers/net/enic/base/vnic_wq.c
@@ -113,6 +113,7 @@ void vnic_wq_init(struct vnic_wq *wq, unsigned int cq_index,
 	vnic_wq_init_start(wq, cq_index, 0, 0,
 		error_interrupt_enable,
 		error_interrupt_offset);
+	wq->cq_pend = 0;
 	wq->last_completed_index = 0;
 }
 
diff --git a/drivers/net/enic/base/vnic_wq.h b/drivers/net/enic/base/vnic_wq.h
index 6622a8a2d..236cf6962 100644
--- a/drivers/net/enic/base/vnic_wq.h
+++ b/drivers/net/enic/base/vnic_wq.h
@@ -44,6 +44,7 @@ struct vnic_wq {
 	struct vnic_dev_ring ring;
 	struct rte_mbuf **bufs;
 	unsigned int head_idx;
+	unsigned int cq_pend;
 	unsigned int tail_idx;
 	unsigned int socket_id;
 	const struct rte_memzone *cqmsg_rz;
diff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h
index 6a3a0c5cc..6b1f6acad 100644
--- a/drivers/net/enic/enic_res.h
+++ b/drivers/net/enic/enic_res.h
@@ -20,6 +20,9 @@
 #define ENIC_ALIGN_DESCS		32
 #define ENIC_ALIGN_DESCS_MASK		~(ENIC_ALIGN_DESCS - 1)
 
+/* Request a completion index every 32 buffers (roughly packets) */
+#define ENIC_WQ_CQ_THRESH		32
+
 #define ENIC_MIN_MTU			68
 
 /* Does not include (possible) inserted VLAN tag and FCS */
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 89a1e66fe..7cddb53d9 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -603,7 +603,7 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	struct wq_enet_desc *descs, *desc_p, desc_tmp;
 	uint16_t mss;
 	uint8_t vlan_tag_insert;
-	uint8_t eop;
+	uint8_t eop, cq;
 	uint64_t bus_addr;
 	uint8_t offload_mode;
 	uint16_t header_len;
@@ -686,10 +686,14 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 				break;
 			}
 		}
-
-
+		wq->cq_pend++;
+		cq = 0;
+		if (eop && wq->cq_pend >= ENIC_WQ_CQ_THRESH) {
+			cq = 1;
+			wq->cq_pend = 0;
+		}
 		wq_enet_desc_enc(&desc_tmp, bus_addr, data_len, mss, header_len,
-				 offload_mode, eop, eop, 0, vlan_tag_insert,
+				 offload_mode, eop, cq, 0, vlan_tag_insert,
 				 vlan_id, 0);
 
 		*desc_p = desc_tmp;
@@ -702,14 +706,21 @@ uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    tx_pkt->next) {
 				data_len = tx_pkt->data_len;
 
-				if (tx_pkt->next == NULL)
+				wq->cq_pend++;
+				cq = 0;
+				if (tx_pkt->next == NULL) {
 					eop = 1;
+					if (wq->cq_pend >= ENIC_WQ_CQ_THRESH) {
+						cq = 1;
+						wq->cq_pend = 0;
+					}
+				}
 				desc_p = descs + head_idx;
 				bus_addr = (dma_addr_t)(tx_pkt->buf_iova
 					   + tx_pkt->data_off);
 				wq_enet_desc_enc((struct wq_enet_desc *)
 						 &desc_tmp, bus_addr, data_len,
-						 mss, 0, offload_mode, eop, eop,
+						 mss, 0, offload_mode, eop, cq,
 						 0, vlan_tag_insert, vlan_id,
 						 0);
 
-- 
2.16.2

  parent reply	other threads:[~2018-06-29  9:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28  3:19 [dpdk-dev] [PATCH 01/14] net/enic: fix receive packet types John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 02/14] net/enic: update the UDP RSS detection mechanism John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 03/14] net/enic: do not overwrite admin Tx queue limit John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 04/14] net/enic: initialize RQ fetch index before enabling RQ John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 05/14] net/enic: report ring limits and preferred default values John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 06/14] net/enic: add devarg to specify ingress VLAN rewrite mode John Daley
2018-06-28 16:04   ` Ferruh Yigit
2018-06-28  3:19 ` [dpdk-dev] [PATCH 07/14] net/enic: add handlers to add/delete vxlan port number John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 08/14] net/enic: use mbuf pointer array for inflight Tx packets John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 09/14] net/enic: support mbuf fast free offload John Daley
2018-06-28 16:05   ` Ferruh Yigit
2018-06-28  3:19 ` [dpdk-dev] [PATCH 10/14] net/enic: reduce Tx completion updates John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 11/14] net/enic: add the simple version of Tx handler John Daley
2018-06-28 16:05   ` Ferruh Yigit
2018-06-28  3:19 ` [dpdk-dev] [PATCH 12/14] net/enic: check maximum packet size in Tx prepare handler John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 13/14] net/enic: add simple Rx handler John Daley
2018-06-28  3:19 ` [dpdk-dev] [PATCH 14/14] net/enic: cap Rx packet processing to end of desc ring John Daley
2018-06-28 16:08 ` [dpdk-dev] [PATCH 01/14] net/enic: fix receive packet types Ferruh Yigit
2018-06-29  9:29 ` [dpdk-dev] [PATCH v2 00/15] enic PMD fixes and performance improvements John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 01/15] net/enic: fix receive packet types John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 02/15] net/enic: update the UDP RSS detection mechanism John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 03/15] net/enic: do not overwrite admin Tx queue limit John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 04/15] net/enic: initialize RQ fetch index before enabling RQ John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 05/15] net/enic: report ring limits and preferred default values John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 06/15] net/enic: add devarg to specify ingress VLAN rewrite mode John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 07/15] net/enic: add handlers to add/delete vxlan port number John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 08/15] net/enic: use mbuf pointer array for inflight Tx packets John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 09/15] net/enic: support mbuf fast free offload John Daley
2018-06-29  9:29   ` John Daley [this message]
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 11/15] net/enic: add the simple version of Tx handler John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 12/15] net/enic: check maximum packet size in Tx prepare handler John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 13/15] net/enic: add simple Rx handler John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 14/15] net/enic: cap Rx packet processing to end of desc ring John Daley
2018-06-29  9:29   ` [dpdk-dev] [PATCH v2 15/15] doc: update release notes with new enic features John Daley
2018-07-02 23:10   ` [dpdk-dev] [PATCH v2 00/15] enic PMD fixes and performance improvements Ferruh Yigit
2018-07-25 18:37   ` Kevin Traynor
2018-07-25 19:46     ` John Daley (johndale)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180629092944.15576-11-johndale@cisco.com \
    --to=johndale@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hyonkim@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).