* [PATCH] net/af_packet: register supported param fanout mode
@ 2025-03-20 8:15 Shaokai Zhang
2025-03-20 8:37 ` [PATCH v2 0/1] " Shaokai Zhang
0 siblings, 1 reply; 4+ messages in thread
From: Shaokai Zhang @ 2025-03-20 8:15 UTC (permalink / raw)
To: dev; +Cc: linville, stable, Joey Xing
Although af_packet PMD supports setting the fanout algorithm, it is not
explicitly declared during registration. Add fanout parameter registration
to facilitate users in quickly obtaining supported fanout algorithms.
Additionally, add configuration parameter printing during initialization.
Fixes: d3bc77ab05a4 ("net/af_packet: allow changing fanout mode")
Cc: stable@dpdk.org
Signed-off-by: Shaokai Zhang <felix.zhang@jaguarmicro.com>
Reviewed-by: Joey Xing <joey.xing@jaguarmicro.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index ab34285ed9..76f09dbe01 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -791,8 +791,8 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
unsigned int blockcnt,
unsigned int framesize,
unsigned int framecnt,
- unsigned int qdisc_bypass,
- const char *fanout_mode,
+ unsigned int qdisc_bypass,
+ const char *fanout_mode,
struct pmd_internals **internals,
struct rte_eth_dev **eth_dev,
struct rte_kvargs *kvlist)
@@ -1172,6 +1172,11 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
PMD_LOG(INFO, "%s:\tblock count %d", name, blockcount);
PMD_LOG(INFO, "%s:\tframe size %d", name, framesize);
PMD_LOG(INFO, "%s:\tframe count %d", name, framecount);
+ PMD_LOG(INFO, "%s:\tqdisc bypass %d", name, qdisc_bypass);
+ if (fanout_mode)
+ PMD_LOG(INFO, "%s:\tfanout mode %s", name, fanout_mode);
+ else
+ PMD_LOG(INFO, "%s:\tfanout mode %s", name, "default PACKET_FANOUT_HASH");
if (rte_pmd_init_internals(dev, *sockfd, qpairs,
blocksize, blockcount,
@@ -1274,4 +1279,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_packet,
"blocksz=<int> "
"framesz=<int> "
"framecnt=<int> "
- "qdisc_bypass=<0|1>");
+ "qdisc_bypass=<0|1> "
+ "fanout_mode=<hash|lb|cpu|rollover|rnd|qm>");
--
2.47.1.windows.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 0/1] net/af_packet: register supported param fanout mode
2025-03-20 8:15 [PATCH] net/af_packet: register supported param fanout mode Shaokai Zhang
@ 2025-03-20 8:37 ` Shaokai Zhang
2025-03-20 8:37 ` [PATCH v2 1/1] " Shaokai Zhang
0 siblings, 1 reply; 4+ messages in thread
From: Shaokai Zhang @ 2025-03-20 8:37 UTC (permalink / raw)
To: dev; +Cc: linville
*** BLURB HERE ***
Shaokai Zhang (1):
net/af_packet: register supported param fanout mode
drivers/net/af_packet/rte_eth_af_packet.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--
2.47.1.windows.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/1] net/af_packet: register supported param fanout mode
2025-03-20 8:37 ` [PATCH v2 0/1] " Shaokai Zhang
@ 2025-03-20 8:37 ` Shaokai Zhang
2025-03-20 17:45 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Shaokai Zhang @ 2025-03-20 8:37 UTC (permalink / raw)
To: dev; +Cc: linville, stable, Joey Xing
Although af_packet PMD supports setting the fanout algorithm, it is not
explicitly declared during registration. Add fanout parameter registration
to facilitate users in quickly obtaining supported fanout algorithms.
Additionally, add configuration parameter printing during initialization.
Fixes: d3bc77ab05a4 ("net/af_packet: allow changing fanout mode")
Cc: stable@dpdk.org
Signed-off-by: Shaokai Zhang <felix.zhang@jaguarmicro.com>
Reviewed-by: Joey Xing <joey.xing@jaguarmicro.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index ab34285ed9..55171944cc 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -1172,6 +1172,11 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
PMD_LOG(INFO, "%s:\tblock count %d", name, blockcount);
PMD_LOG(INFO, "%s:\tframe size %d", name, framesize);
PMD_LOG(INFO, "%s:\tframe count %d", name, framecount);
+ PMD_LOG(INFO, "%s:\tqdisc bypass %d", name, qdisc_bypass);
+ if (fanout_mode)
+ PMD_LOG(INFO, "%s:\tfanout mode %s", name, fanout_mode);
+ else
+ PMD_LOG(INFO, "%s:\tfanout mode %s", name, "default PACKET_FANOUT_HASH");
if (rte_pmd_init_internals(dev, *sockfd, qpairs,
blocksize, blockcount,
@@ -1274,4 +1279,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_packet,
"blocksz=<int> "
"framesz=<int> "
"framecnt=<int> "
- "qdisc_bypass=<0|1>");
+ "qdisc_bypass=<0|1> "
+ "fanout_mode=<hash|lb|cpu|rollover|rnd|qm>");
--
2.47.1.windows.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] net/af_packet: register supported param fanout mode
2025-03-20 8:37 ` [PATCH v2 1/1] " Shaokai Zhang
@ 2025-03-20 17:45 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2025-03-20 17:45 UTC (permalink / raw)
To: Shaokai Zhang; +Cc: dev, linville, stable, Joey Xing
On Thu, 20 Mar 2025 16:37:07 +0800
Shaokai Zhang <felix.zhang@jaguarmicro.com> wrote:
> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
> index ab34285ed9..55171944cc 100644
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -1172,6 +1172,11 @@ rte_eth_from_packet(struct rte_vdev_device *dev,
> PMD_LOG(INFO, "%s:\tblock count %d", name, blockcount);
> PMD_LOG(INFO, "%s:\tframe size %d", name, framesize);
> PMD_LOG(INFO, "%s:\tframe count %d", name, framecount);
> + PMD_LOG(INFO, "%s:\tqdisc bypass %d", name, qdisc_bypass);
> + if (fanout_mode)
> + PMD_LOG(INFO, "%s:\tfanout mode %s", name, fanout_mode);
> + else
> + PMD_LOG(INFO, "%s:\tfanout mode %s", name, "default PACKET_FANOUT_HASH")
All these debug messages are too noisy for my taste.
Should all be removed or made DEBUG level.
There is no point in echoing the arguments in a working driver.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-20 17:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20 8:15 [PATCH] net/af_packet: register supported param fanout mode Shaokai Zhang
2025-03-20 8:37 ` [PATCH v2 0/1] " Shaokai Zhang
2025-03-20 8:37 ` [PATCH v2 1/1] " Shaokai Zhang
2025-03-20 17:45 ` Stephen Hemminger
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).