All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haiyue Wang <haiyue.wang@intel.com>
To: dev@dpdk.org, ferruh.yigit@intel.com, xiaolong.ye@intel.com
Cc: ray.kinsella@intel.com, bernard.iremonger@intel.com,
	chenmin.sun@intel.com, Haiyue Wang <haiyue.wang@intel.com>
Subject: [dpdk-dev] [PATCH v4 3/4] net/ice: add Rx/Tx burst mode get callbacks
Date: Tue, 15 Oct 2019 15:51:32 +0800	[thread overview]
Message-ID: <20191015075133.38560-4-haiyue.wang@intel.com> (raw)
In-Reply-To: <20191015075133.38560-1-haiyue.wang@intel.com>

Retrieve burst mode options according to the selected Rx/Tx burst
function name.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 doc/guides/nics/features/ice.ini |  1 +
 drivers/net/ice/ice_ethdev.c     |  2 ++
 drivers/net/ice/ice_rxtx.c       | 58 ++++++++++++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h       |  4 +++
 4 files changed, 65 insertions(+)

diff --git a/doc/guides/nics/features/ice.ini b/doc/guides/nics/features/ice.ini
index 5e6cb4b7e..65923f0bc 100644
--- a/doc/guides/nics/features/ice.ini
+++ b/doc/guides/nics/features/ice.ini
@@ -10,6 +10,7 @@ Link status event    = Y
 Rx interrupt         = Y
 Fast mbuf free       = Y
 Queue start/stop     = Y
+Burst mode info      = Y
 MTU update           = Y
 Jumbo frame          = Y
 Scattered Rx         = Y
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 022b58c01..d848440a1 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -167,6 +167,8 @@ static const struct eth_dev_ops ice_eth_dev_ops = {
 	.vlan_pvid_set                = ice_vlan_pvid_set,
 	.rxq_info_get                 = ice_rxq_info_get,
 	.txq_info_get                 = ice_txq_info_get,
+	.rx_burst_mode_get            = ice_rx_burst_mode_get,
+	.tx_burst_mode_get            = ice_tx_burst_mode_get,
 	.get_eeprom_length            = ice_get_eeprom_length,
 	.get_eeprom                   = ice_get_eeprom,
 	.rx_queue_count               = ice_rx_queue_count,
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 8785cf8a3..c07aa4b81 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2435,6 +2435,39 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 	}
 }
 
+int
+ice_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		      struct rte_eth_burst_mode *mode)
+{
+	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
+	uint64_t options;
+
+	if (pkt_burst == ice_recv_scattered_pkts)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == ice_recv_pkts_bulk_alloc)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_BULK_ALLOC;
+	else if (pkt_burst == ice_recv_pkts)
+		options = RTE_ETH_BURST_SCALAR;
+#ifdef RTE_ARCH_X86
+	else if (pkt_burst == ice_recv_scattered_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2 |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == ice_recv_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2;
+	else if (pkt_burst == ice_recv_scattered_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == ice_recv_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE;
+#endif
+	else
+		options = 0;
+
+	mode->options = options;
+
+	return options != 0 ? 0 : -EINVAL;
+}
+
 void __attribute__((cold))
 ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq)
 {
@@ -2558,6 +2591,31 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 	}
 }
 
+int
+ice_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		      struct rte_eth_burst_mode *mode)
+{
+	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
+	uint64_t options;
+
+	if (pkt_burst == ice_xmit_pkts_simple)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SIMPLE;
+	else if (pkt_burst == ice_xmit_pkts)
+		options = RTE_ETH_BURST_SCALAR;
+#ifdef RTE_ARCH_X86
+	else if (pkt_burst == ice_xmit_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2;
+	else if (pkt_burst == ice_xmit_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE;
+#endif
+	else
+		options = 0;
+
+	mode->options = options;
+
+	return options != 0 ? 0 : -EINVAL;
+}
+
 /* For each value it means, datasheet of hardware can tell more details
  *
  * @note: fix ice_dev_supported_ptypes_get() if any change here.
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 25b3822df..31c53d535 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -168,6 +168,10 @@ void ice_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 		      struct rte_eth_rxq_info *qinfo);
 void ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 		      struct rte_eth_txq_info *qinfo);
+int ice_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			  struct rte_eth_burst_mode *mode);
+int ice_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			  struct rte_eth_burst_mode *mode);
 int ice_rx_descriptor_status(void *rx_queue, uint16_t offset);
 int ice_tx_descriptor_status(void *tx_queue, uint16_t offset);
 void ice_set_default_ptype_table(struct rte_eth_dev *dev);
-- 
2.17.1


  parent reply	other threads:[~2019-10-15  7:57 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15  7:51 [dpdk-dev] [PATCH v4 0/4] get Rx/Tx packet burst mode information Haiyue Wang
2019-10-15  7:51 ` [dpdk-dev] [PATCH v4 1/4] ethdev: add the API for getting " Haiyue Wang
2019-10-15 10:45   ` Ferruh Yigit
2019-10-15 11:23     ` Wang, Haiyue
2019-10-15 11:13   ` Ferruh Yigit
2019-10-25  9:36   ` Thomas Monjalon
2019-10-25 10:26     ` Jerin Jacob
2019-10-25 13:59     ` Wang, Haiyue
2019-10-25 14:08     ` Ferruh Yigit
2019-10-25 15:45       ` Thomas Monjalon
2019-10-25 16:02         ` Jerin Jacob
2019-10-25 22:27           ` Thomas Monjalon
2019-10-26  4:40             ` Wang, Haiyue
2019-10-26  6:24               ` Thomas Monjalon
2019-10-26  9:23                 ` Wang, Haiyue
2019-10-26 16:23                   ` Thomas Monjalon
2019-10-29 14:27                     ` Ferruh Yigit
2019-11-03 20:35                       ` Ray Kinsella
2019-11-03 22:41                         ` Thomas Monjalon
2019-11-04  9:49                           ` Ray Kinsella
2019-11-04  9:54                             ` Thomas Monjalon
2019-11-04 10:03                               ` Ray Kinsella
2019-11-04 10:46                                 ` Wang, Haiyue
2019-11-04 11:30                                 ` Thomas Monjalon
2019-11-04 12:07                                   ` Ray Kinsella
2019-11-04 13:09                                     ` Thomas Monjalon
2019-11-04 13:48                                       ` Ray Kinsella
2019-11-04 14:17                                         ` Wang, Haiyue
2019-10-26  6:40             ` Slava Ovsiienko
2019-10-26  9:31               ` Wang, Haiyue
2019-10-26  6:58             ` Jerin Jacob
2019-10-26  9:37               ` Wang, Haiyue
2019-10-29  3:37                 ` Jerin Jacob
2019-10-29  4:44                   ` Wang, Haiyue
2019-10-29  5:19                     ` Jerin Jacob
2019-10-29  5:42                       ` Wang, Haiyue
2019-10-29  5:47                         ` Jerin Jacob
2019-10-29  5:56                           ` Wang, Haiyue
2019-10-29  6:00                           ` Wang, Haiyue
2019-10-29  8:34                             ` Jerin Jacob
2019-10-29 11:26                               ` Wang, Haiyue
2019-10-29 12:56                                 ` Jerin Jacob
2019-10-29 13:51                                   ` Wang, Haiyue
2019-10-29 14:08                                     ` Jerin Jacob
2019-10-29 15:42                                       ` Wang, Haiyue
2019-10-29 15:59                                         ` Jerin Jacob
2019-10-29 16:16                                           ` Wang, Haiyue
2019-10-29 16:59               ` Ferruh Yigit
2019-10-30  4:38                 ` Jerin Jacob
2019-10-30  4:43                   ` Wang, Haiyue
2019-10-30  8:14                 ` Wang, Haiyue
2019-10-31 10:46                   ` Jerin Jacob
2019-10-31 11:15                     ` Ray Kinsella
2019-10-31 11:16                     ` Wang, Haiyue
2019-10-31 14:58                       ` Ferruh Yigit
2019-10-31 15:07                         ` Wang, Haiyue
2019-10-31 15:29                           ` Ferruh Yigit
2019-10-31 15:54                             ` Wang, Haiyue
2019-10-31 11:09                 ` Ray Kinsella
2019-10-15  7:51 ` [dpdk-dev] [PATCH v4 2/4] net/i40e: add Rx/Tx burst mode get callbacks Haiyue Wang
2019-10-15  7:51 ` Haiyue Wang [this message]
2019-10-15  7:51 ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: show the Rx/Tx burst mode description Haiyue Wang
2019-10-15 12:11 ` [dpdk-dev] [PATCH v4 0/4] get Rx/Tx packet burst mode information Ferruh Yigit

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=20191015075133.38560-4-haiyue.wang@intel.com \
    --to=haiyue.wang@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=chenmin.sun@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=ray.kinsella@intel.com \
    --cc=xiaolong.ye@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.