DPDK patches and discussions
 help / color / mirror / Atom feed
From: Roger Melton <rmelton@cisco.com>
To: dev@dpdk.org
Cc: Roger Melton <rmelton@cisco.com>
Subject: [PATCH] net/e1000: support Rx/Tx burst mode info
Date: Wed, 16 Apr 2025 13:30:57 -0400	[thread overview]
Message-ID: <20250416173057.372482-1-rmelton@cisco.com> (raw)

Return burst mode according to the selected Rx/Tx burst
function name.
Update 25.07 release notes with this information.

Signed-off-by: Roger Melton <rmelton@cisco.com>
---
 doc/guides/rel_notes/release_25_07.rst |  3 ++
 drivers/net/intel/e1000/igb_ethdev.c   | 64 ++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/doc/guides/rel_notes/release_25_07.rst b/doc/guides/rel_notes/release_25_07.rst
index 093b85d206..794ebbee5e 100644
--- a/doc/guides/rel_notes/release_25_07.rst
+++ b/doc/guides/rel_notes/release_25_07.rst
@@ -55,6 +55,9 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated Intel e1000 driver.**
+
+  * Added support for rx_burst_mode_get and tx_burst_mode_get.
 
 Removed Items
 -------------
diff --git a/drivers/net/intel/e1000/igb_ethdev.c b/drivers/net/intel/e1000/igb_ethdev.c
index cbd2f15f5f..7250e99af1 100644
--- a/drivers/net/intel/e1000/igb_ethdev.c
+++ b/drivers/net/intel/e1000/igb_ethdev.c
@@ -237,6 +237,10 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
 static void eth_igbvf_interrupt_handler(void *param);
 static void igbvf_mbx_process(struct rte_eth_dev *dev);
 static int igb_filter_restore(struct rte_eth_dev *dev);
+static int igb_tx_burst_mode_get(struct rte_eth_dev *dev,
+	__rte_unused uint16_t queue_id, struct rte_eth_burst_mode *mode);
+static int igb_rx_burst_mode_get(struct rte_eth_dev *dev,
+	__rte_unused uint16_t queue_id, struct rte_eth_burst_mode *mode);
 
 /*
  * Define VF Stats MACRO for Non "cleared on read" register
@@ -367,6 +371,8 @@ static const struct eth_dev_ops eth_igb_ops = {
 	.tx_queue_setup       = eth_igb_tx_queue_setup,
 	.tx_queue_release     = eth_igb_tx_queue_release,
 	.tx_done_cleanup      = eth_igb_tx_done_cleanup,
+	.rx_burst_mode_get    = igb_rx_burst_mode_get,
+	.tx_burst_mode_get    = igb_tx_burst_mode_get,
 	.dev_led_on           = eth_igb_led_on,
 	.dev_led_off          = eth_igb_led_off,
 	.flow_ctrl_get        = eth_igb_flow_ctrl_get,
@@ -425,6 +431,8 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = {
 	.tx_queue_setup       = eth_igb_tx_queue_setup,
 	.tx_queue_release     = eth_igb_tx_queue_release,
 	.tx_done_cleanup      = eth_igb_tx_done_cleanup,
+	.rx_burst_mode_get    = igb_rx_burst_mode_get,
+	.tx_burst_mode_get    = igb_tx_burst_mode_get,
 	.set_mc_addr_list     = eth_igb_set_mc_addr_list,
 	.rxq_info_get         = igb_rxq_info_get,
 	.txq_info_get         = igb_txq_info_get,
@@ -715,6 +723,62 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
+static const struct {
+	eth_tx_burst_t pkt_burst;
+	const char *info;
+} igb_tx_burst_info[] = {
+	{	eth_igb_xmit_pkts, "Scalar igb"},
+	{	eth_em_xmit_pkts, "Scalar em"},
+};
+
+int
+igb_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;
+	size_t i;
+
+	for (i = 0; i < RTE_DIM(igb_tx_burst_info); i++) {
+		if (pkt_burst == igb_tx_burst_info[i].pkt_burst) {
+			snprintf(mode->info, sizeof(mode->info), "%s",
+				 igb_tx_burst_info[i].info);
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
+static const struct {
+	eth_rx_burst_t pkt_burst;
+	const char *info;
+} igb_rx_burst_info[] = {
+	{	eth_igb_recv_pkts, "Scalar igb"},
+	{	eth_igb_recv_scattered_pkts, "Scalar igb scattered"},
+	{	eth_em_recv_pkts, "Scalar em"},
+	{	eth_em_recv_scattered_pkts, "Scalar em scattered"},
+};
+
+int
+igb_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;
+	size_t i;
+
+	for (i = 0; i < RTE_DIM(igb_rx_burst_info); i++) {
+		if (pkt_burst == igb_rx_burst_info[i].pkt_burst) {
+			snprintf(mode->info, sizeof(mode->info), "%s",
+				 igb_rx_burst_info[i].info);
+			return 0;
+		}
+	}
+
+	return -EINVAL;
+}
+
 static int
 eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 {
-- 
2.35.6


                 reply	other threads:[~2025-04-16 17:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250416173057.372482-1-rmelton@cisco.com \
    --to=rmelton@cisco.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).