DPDK patches and discussions
 help / color / mirror / Atom feed
From: Haiyue Wang <haiyue.wang@intel.com>
To: dev@dpdk.org
Cc: Haiyue Wang <haiyue.wang@intel.com>
Subject: [dpdk-dev] [RFC v1 3/3] net/ice: support the Rx/Tx burst description field in queue information
Date: Mon, 12 Aug 2019 22:15:05 +0800	[thread overview]
Message-ID: <1565619305-17116-4-git-send-email-haiyue.wang@intel.com> (raw)
In-Reply-To: <1565619305-17116-1-git-send-email-haiyue.wang@intel.com>

According to the Rx/Tx burst function that's selected currently, format
the distinct burst description information for apps to query.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/ice_rxtx.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 0282b53..9e6b1f7 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -15,6 +15,16 @@
 
 #define ICE_RX_ERR_BITS 0x3f
 
+static uint16_t ice_recv_scattered_pkts(void *rx_queue,
+					struct rte_mbuf **rx_pkts,
+					uint16_t nb_pkts);
+static uint16_t ice_recv_pkts_bulk_alloc(void *rx_queue,
+					 struct rte_mbuf **rx_pkts,
+					 uint16_t nb_pkts);
+static uint16_t ice_xmit_pkts_simple(void *tx_queue,
+				     struct rte_mbuf **tx_pkts,
+				     uint16_t nb_pkts);
+
 static enum ice_status
 ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 {
@@ -935,6 +945,30 @@ ice_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 	qinfo->conf.rx_drop_en = rxq->drop_en;
 	qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+
+	if (dev->rx_pkt_burst == ice_recv_scattered_pkts)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_bulk_alloc)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Bulk Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Normal Rx");
+#ifdef RTE_ARCH_X86
+	else if (dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx2)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "AVX2 Vector Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_scattered_pkts_vec)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Vector Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_vec_avx2)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "AVX2 Vector Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_vec)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Vector Rx");
+#endif
 }
 
 void
@@ -955,6 +989,21 @@ ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
 	qinfo->conf.offloads = txq->offloads;
 	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+
+	if (dev->tx_pkt_burst == ice_xmit_pkts_simple)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Simple Tx");
+	else if (dev->tx_pkt_burst == ice_xmit_pkts)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Normal Tx");
+#ifdef RTE_ARCH_X86
+	else if (dev->tx_pkt_burst == ice_xmit_pkts_vec_avx2)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "AVX2 Vector Tx");
+	else if (dev->tx_pkt_burst == ice_xmit_pkts_vec)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Vector Tx");
+#endif
 }
 
 uint32_t
-- 
2.7.4


  parent reply	other threads:[~2019-08-12 14:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 14:15 [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field Haiyue Wang
2019-08-12 14:15 ` [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information Haiyue Wang
2019-08-12 15:37   ` Stephen Hemminger
2019-08-12 14:15 ` [dpdk-dev] [RFC v1 2/3] testpmd: show the Rx/Tx burst description field in queue Haiyue Wang
2019-08-12 14:15 ` Haiyue Wang [this message]
2019-08-12 14:27 ` [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field David Marchand
2019-08-12 15:38   ` Stephen Hemminger
2019-08-12 15:42     ` Wang, Haiyue
2019-08-12 15:54       ` Stephen Hemminger
2019-08-12 16:00         ` Wang, Haiyue
2019-08-12 17:28           ` Stephen Hemminger
2019-08-12 17:36             ` Wang, Haiyue
2019-08-12 15:39   ` Wang, Haiyue

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=1565619305-17116-4-git-send-email-haiyue.wang@intel.com \
    --to=haiyue.wang@intel.com \
    --cc=dev@dpdk.org \
    /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).