From: Wenbo Cao <caowenbo@mucse.com>
To: thomas@monjalon.net, Wenbo Cao <caowenbo@mucse.com>
Cc: stephen@networkplumber.org, dev@dpdk.org, yaojun@mucse.com
Subject: [PATCH v16 28/29] net/rnp: support Rx/Tx burst mode info
Date: Wed, 26 Feb 2025 15:42:15 +0800 [thread overview]
Message-ID: <1740555736-19894-29-git-send-email-caowenbo@mucse.com> (raw)
In-Reply-To: <1740555736-19894-1-git-send-email-caowenbo@mucse.com>
add platform method for get rx/tx burst function select
by upload func name.
Signed-off-by: Wenbo Cao <caowenbo@mucse.com>
---
doc/guides/nics/rnp.rst | 2 ++
drivers/net/rnp/rnp_ethdev.c | 2 ++
drivers/net/rnp/rnp_rxtx.c | 58 ++++++++++++++++++++++++++++++++++++
drivers/net/rnp/rnp_rxtx.h | 6 ++++
4 files changed, 68 insertions(+)
diff --git a/doc/guides/nics/rnp.rst b/doc/guides/nics/rnp.rst
index c3e8d514d9..e9f96c4eb0 100644
--- a/doc/guides/nics/rnp.rst
+++ b/doc/guides/nics/rnp.rst
@@ -114,8 +114,10 @@ Listed below are the rte_eth functions supported:
* ``rte_eth_allmulticast_get``
* ``rte_eth_rx_queue_setup``
* ``rte_eth_rx_queue_info_get``
+* ``rte_eth_rx_burst_mode_get``
* ``rte_eth_tx_queue_setup``
* ``rte_eth_tx_queue_info_get``
+* ``rte_eth_tx_burst_mode_get``
* ``rte_eth_link_get``
* ``rte_eth_link_get_nowait``
* ``rte_eth_stats_get``
diff --git a/drivers/net/rnp/rnp_ethdev.c b/drivers/net/rnp/rnp_ethdev.c
index 84ff746ecd..227dc8e4ca 100644
--- a/drivers/net/rnp/rnp_ethdev.c
+++ b/drivers/net/rnp/rnp_ethdev.c
@@ -1481,11 +1481,13 @@ static const struct eth_dev_ops rnp_eth_dev_ops = {
.rx_queue_stop = rnp_rx_queue_stop,
.rx_queue_start = rnp_rx_queue_start,
.rxq_info_get = rnp_rx_queue_info_get,
+ .rx_burst_mode_get = rnp_rx_burst_mode_get,
.tx_queue_setup = rnp_tx_queue_setup,
.tx_queue_release = rnp_dev_tx_queue_release,
.tx_queue_stop = rnp_tx_queue_stop,
.tx_queue_start = rnp_tx_queue_start,
.txq_info_get = rnp_tx_queue_info_get,
+ .tx_burst_mode_get = rnp_tx_burst_mode_get,
/* rss impl */
.reta_update = rnp_dev_rss_reta_update,
.reta_query = rnp_dev_rss_reta_query,
diff --git a/drivers/net/rnp/rnp_rxtx.c b/drivers/net/rnp/rnp_rxtx.c
index d58b0412ce..da08728198 100644
--- a/drivers/net/rnp/rnp_rxtx.c
+++ b/drivers/net/rnp/rnp_rxtx.c
@@ -1762,3 +1762,61 @@ rnp_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
qinfo->conf.tx_thresh.hthresh = txq->pburst;
qinfo->conf.offloads = txq->tx_offloads;
}
+
+static const struct {
+ eth_rx_burst_t pkt_burst;
+ const char *info;
+} rnp_rx_burst_infos[] = {
+ { rnp_scattered_rx, "Scalar Scattered" },
+ { rnp_recv_pkts, "Scalar" },
+};
+
+static const struct {
+ eth_tx_burst_t pkt_burst;
+ const char *info;
+} rnp_tx_burst_infos[] = {
+ { rnp_xmit_simple, "Scalar Simple" },
+ { rnp_multiseg_xmit_pkts, "Scalar" },
+};
+
+int
+rnp_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;
+ int ret = -EINVAL;
+ unsigned int i;
+
+ for (i = 0; i < RTE_DIM(rnp_rx_burst_infos); ++i) {
+ if (pkt_burst == rnp_rx_burst_infos[i].pkt_burst) {
+ snprintf(mode->info, sizeof(mode->info), "%s",
+ rnp_rx_burst_infos[i].info);
+ ret = 0;
+ break;
+ }
+ }
+
+ return ret;
+}
+
+int
+rnp_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;
+ int ret = -EINVAL;
+ unsigned int i;
+
+ for (i = 0; i < RTE_DIM(rnp_tx_burst_infos); ++i) {
+ if (pkt_burst == rnp_tx_burst_infos[i].pkt_burst) {
+ snprintf(mode->info, sizeof(mode->info), "%s",
+ rnp_tx_burst_infos[i].info);
+ ret = 0;
+ break;
+ }
+ }
+
+ return ret;
+}
diff --git a/drivers/net/rnp/rnp_rxtx.h b/drivers/net/rnp/rnp_rxtx.h
index dc4a8ea9dd..8639f0892d 100644
--- a/drivers/net/rnp/rnp_rxtx.h
+++ b/drivers/net/rnp/rnp_rxtx.h
@@ -152,5 +152,11 @@ void rnp_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
struct rte_eth_rxq_info *qinfo);
void rnp_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
struct rte_eth_txq_info *qinfo);
+int rnp_rx_burst_mode_get(struct rte_eth_dev *dev,
+ __rte_unused uint16_t queue_id,
+ struct rte_eth_burst_mode *mode);
+int rnp_tx_burst_mode_get(struct rte_eth_dev *dev,
+ __rte_unused uint16_t queue_id,
+ struct rte_eth_burst_mode *mode);
#endif /* _RNP_RXTX_H_ */
--
2.25.1
next prev parent reply other threads:[~2025-02-26 7:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 7:41 [PATCH v16 00/28] [v16]drivers/net Add Support mucse N10 Pmd Driver Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 01/29] net/rnp: add skeleton Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 02/29] net/rnp: add ethdev probe and remove Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 03/29] net/rnp: add log Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 04/29] net/rnp: support mailbox basic operate Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 05/29] net/rnp: add device init and uninit Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 06/29] net/rnp: add get device information operation Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 07/29] net/rnp: add support MAC promisc mode Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 08/29] net/rnp: add queue setup and release operations Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 09/29] net/rnp: add queue stop and start operations Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 10/29] net/rnp: add support device start stop operations Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 11/29] net/rnp: add RSS support operations Wenbo Cao
2025-02-26 7:41 ` [PATCH v16 12/29] net/rnp: add support link update operations Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 13/29] net/rnp: add support link setup operations Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 14/29] net/rnp: add Rx burst simple support Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 15/29] net/rnp: add Tx " Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 16/29] net/rnp: add MTU set operation Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 17/29] net/rnp: add Rx scatter segment version Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 18/29] net/rnp: add Tx multiple " Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 19/29] net/rnp: add support basic stats operation Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 20/29] net/rnp: add support xstats operation Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 21/29] net/rnp: add unicast MAC filter operation Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 22/29] net/rnp: add supported packet types Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 23/29] net/rnp: add support Rx checksum offload Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 24/29] net/rnp: add support Tx TSO offload Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 25/29] net/rnp: support VLAN offloads Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 26/29] net/rnp: add support VLAN filters operations Wenbo Cao
2025-02-26 7:42 ` [PATCH v16 27/29] net/rnp: add queue info operation Wenbo Cao
2025-02-26 7:42 ` Wenbo Cao [this message]
2025-02-26 7:42 ` [PATCH v16 29/29] net/rnp: add multicast MAC filter operation Wenbo Cao
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=1740555736-19894-29-git-send-email-caowenbo@mucse.com \
--to=caowenbo@mucse.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=yaojun@mucse.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).