* [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add
@ 2025-08-05 21:33 Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 1/3] netdevsim: Support ethtool stats Dennis Chen
2025-08-05 22:55 ` [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Jakub Kicinski
0 siblings, 2 replies; 8+ messages in thread
From: Dennis Chen @ 2025-08-05 21:33 UTC (permalink / raw)
To: netdev; +Cc: dechen, dchen27, kuba, davem, edumazet, pabeni, andrew+netdev,
petrm
This series adds support for querying standard interface stats and
driver-specific stats with ethtool -S. This allows hardware-independent
testing of ethtool stats reporting. Driver-specific stats are incremented
every 100ms once enabled through a debugfs toggle.
Also adds a selftest for ethtool -S for netdevsim.
The implementation of mock stats is heavily based on the mock L3 stats
support added by commit 1a6d7ae7d63c45("netdevsim: Introduce support for
L3 offload xstats").
Note: Further replies will come from my school email address,
dchen27@ncsu.edu, as I will soon lose access to my Red Hat email.
Dennis Chen (2):
netdevsim: Add mock stats for ethtool
selftests: netdevsim: Add test for ethtool stats
Kamal Heib (1):
netdevsim: Support ethtool stats
drivers/net/netdevsim/ethtool.c | 183 ++++++++++++++++++
drivers/net/netdevsim/netdev.c | 1 +
drivers/net/netdevsim/netdevsim.h | 11 ++
.../selftests/drivers/net/netdevsim/Makefile | 1 +
.../drivers/net/netdevsim/ethtool-common.sh | 13 ++
.../drivers/net/netdevsim/ethtool-stats.sh | 36 ++++
6 files changed, 245 insertions(+)
create mode 100755 tools/testing/selftests/drivers/net/netdevsim/ethtool-stats.sh
--
2.50.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 1/3] netdevsim: Support ethtool stats
2025-08-05 21:33 [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Dennis Chen
@ 2025-08-05 21:33 ` Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 2/3] netdevsim: Add mock stats for ethtool Dennis Chen
2025-08-05 22:55 ` [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Jakub Kicinski
1 sibling, 1 reply; 8+ messages in thread
From: Dennis Chen @ 2025-08-05 21:33 UTC (permalink / raw)
To: netdev
Cc: dechen, dchen27, kuba, davem, edumazet, pabeni, andrew+netdev,
petrm, Kamal Heib
From: Kamal Heib <kheib@redhat.com>
Add support for reporting the netdevsim stats via ethtool.
Signed-off-by: Kamal Heib <kheib@redhat.com>
---
drivers/net/netdevsim/ethtool.c | 58 +++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/drivers/net/netdevsim/ethtool.c b/drivers/net/netdevsim/ethtool.c
index f631d90c428a..33d39dfdd6d9 100644
--- a/drivers/net/netdevsim/ethtool.c
+++ b/drivers/net/netdevsim/ethtool.c
@@ -7,6 +7,26 @@
#include "netdevsim.h"
+struct nsim_stat_desc {
+ char desc[ETH_GSTRING_LEN];
+ size_t offset;
+};
+
+#define NSIM_STAT_ENTRY(s) { \
+ .desc = #s, \
+ .offset = offsetof(struct rtnl_link_stats64, s) }
+
+static const struct nsim_stat_desc nsim_stats_desc[] = {
+ NSIM_STAT_ENTRY(tx_packets),
+ NSIM_STAT_ENTRY(rx_packets),
+ NSIM_STAT_ENTRY(tx_bytes),
+ NSIM_STAT_ENTRY(rx_bytes),
+ NSIM_STAT_ENTRY(tx_dropped),
+ NSIM_STAT_ENTRY(rx_dropped),
+};
+
+#define NSIM_STATS_LEN ARRAY_SIZE(nsim_stats_desc)
+
static void
nsim_get_pause_stats(struct net_device *dev,
struct ethtool_pause_stats *pause_stats)
@@ -182,6 +202,41 @@ static int nsim_get_ts_info(struct net_device *dev,
return 0;
}
+static int nsim_sset_count(struct net_device *dev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return NSIM_STATS_LEN;
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+static void nsim_get_strings(struct net_device *dev, u32 sset, u8 *data)
+{
+ int i;
+
+ switch (sset) {
+ case ETH_SS_STATS:
+ for (i = 0; i < NSIM_STATS_LEN; i++)
+ ethtool_puts(&data, nsim_stats_desc[i].desc);
+ break;
+ }
+}
+
+static void nsim_get_ethtool_stats(struct net_device *dev,
+ struct ethtool_stats *stats,
+ u64 *data)
+{
+ struct rtnl_link_stats64 rtstats = {};
+ int i;
+
+ dev_get_stats(dev, &rtstats);
+
+ for (i = 0; i < NSIM_STATS_LEN; i++)
+ data[i] = *(u64 *)((u8 *)&rtstats + nsim_stats_desc[i].offset);
+}
+
static const struct ethtool_ops nsim_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_ALL_PARAMS,
.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT |
@@ -199,6 +254,9 @@ static const struct ethtool_ops nsim_ethtool_ops = {
.set_fecparam = nsim_set_fecparam,
.get_fec_stats = nsim_get_fec_stats,
.get_ts_info = nsim_get_ts_info,
+ .get_sset_count = nsim_sset_count,
+ .get_strings = nsim_get_strings,
+ .get_ethtool_stats = nsim_get_ethtool_stats,
};
static void nsim_ethtool_ring_init(struct netdevsim *ns)
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 2/3] netdevsim: Add mock stats for ethtool
2025-08-05 21:33 ` [PATCH net-next 1/3] netdevsim: Support ethtool stats Dennis Chen
@ 2025-08-05 21:33 ` Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 3/3] selftests: netdevsim: Add test for ethtool stats Dennis Chen
0 siblings, 1 reply; 8+ messages in thread
From: Dennis Chen @ 2025-08-05 21:33 UTC (permalink / raw)
To: netdev; +Cc: dechen, dchen27, kuba, davem, edumazet, pabeni, andrew+netdev,
petrm
Add mock stats exposed through ethtool -S for netdevsim. The stats are
incremented every 100ms. Mock stats are enabled/disabled through a
debugfs toggle.
# echo y > /sys/kernel/debug/netdevsim/$DEV/ports/0/ethtool/mock_stats/enabled
Signed-off-by: Dennis Chen <dechen@redhat.com>
---
drivers/net/netdevsim/ethtool.c | 127 +++++++++++++++++++++++++++++-
drivers/net/netdevsim/netdev.c | 1 +
drivers/net/netdevsim/netdevsim.h | 11 +++
3 files changed, 138 insertions(+), 1 deletion(-)
diff --git a/drivers/net/netdevsim/ethtool.c b/drivers/net/netdevsim/ethtool.c
index 33d39dfdd6d9..78aea02f8bf1 100644
--- a/drivers/net/netdevsim/ethtool.c
+++ b/drivers/net/netdevsim/ethtool.c
@@ -16,6 +16,10 @@ struct nsim_stat_desc {
.desc = #s, \
.offset = offsetof(struct rtnl_link_stats64, s) }
+#define NSIM_MOCK_STAT_ENTRY(s) { \
+ .desc = #s, \
+ .offset = offsetof(struct nsim_mock_stats, s) }
+
static const struct nsim_stat_desc nsim_stats_desc[] = {
NSIM_STAT_ENTRY(tx_packets),
NSIM_STAT_ENTRY(rx_packets),
@@ -27,6 +31,14 @@ static const struct nsim_stat_desc nsim_stats_desc[] = {
#define NSIM_STATS_LEN ARRAY_SIZE(nsim_stats_desc)
+#define NSIM_MOCK_STATS_LEN ARRAY_SIZE(nsim_mock_stats_desc)
+
+static const struct nsim_stat_desc nsim_mock_stats_desc[] = {
+ NSIM_MOCK_STAT_ENTRY(hw_out_of_sequence),
+ NSIM_MOCK_STAT_ENTRY(hw_out_of_buffer),
+ NSIM_MOCK_STAT_ENTRY(hw_packet_seq_err),
+};
+
static void
nsim_get_pause_stats(struct net_device *dev,
struct ethtool_pause_stats *pause_stats)
@@ -204,9 +216,12 @@ static int nsim_get_ts_info(struct net_device *dev,
static int nsim_sset_count(struct net_device *dev, int sset)
{
+ struct netdevsim *ns = netdev_priv(dev);
+
switch (sset) {
case ETH_SS_STATS:
- return NSIM_STATS_LEN;
+ return ns->ethtool.mock_stats.enabled ?
+ NSIM_STATS_LEN + NSIM_MOCK_STATS_LEN : NSIM_STATS_LEN;
default:
return -EOPNOTSUPP;
}
@@ -214,20 +229,51 @@ static int nsim_sset_count(struct net_device *dev, int sset)
static void nsim_get_strings(struct net_device *dev, u32 sset, u8 *data)
{
+ struct netdevsim *ns = netdev_priv(dev);
+
int i;
switch (sset) {
case ETH_SS_STATS:
for (i = 0; i < NSIM_STATS_LEN; i++)
ethtool_puts(&data, nsim_stats_desc[i].desc);
+ if (ns->ethtool.mock_stats.enabled)
+ for (i = 0; i < NSIM_MOCK_STATS_LEN; i++)
+ ethtool_puts(&data,
+ nsim_mock_stats_desc[i].desc);
+
break;
}
}
+static void nsim_ethtool_add_mock_stats(struct netdevsim *ns,
+ u64 *data)
+{
+ unsigned int start, i;
+ const u8 *stats_base;
+ const u64_stats_t *p;
+ size_t offset;
+
+ stats_base = (const u8 *)&ns->ethtool.mock_stats;
+
+ data += NSIM_STATS_LEN;
+
+ do {
+ start = u64_stats_fetch_begin(&ns->ethtool.mock_stats.syncp);
+ for (i = 0; i < NSIM_MOCK_STATS_LEN; i++) {
+ offset = nsim_mock_stats_desc[i].offset;
+
+ p = (const u64_stats_t *)(stats_base + offset);
+ data[i] = u64_stats_read(p);
+ }
+ } while (u64_stats_fetch_retry(&ns->ethtool.mock_stats.syncp, start));
+}
+
static void nsim_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats,
u64 *data)
{
+ struct netdevsim *ns;
struct rtnl_link_stats64 rtstats = {};
int i;
@@ -235,6 +281,33 @@ static void nsim_get_ethtool_stats(struct net_device *dev,
for (i = 0; i < NSIM_STATS_LEN; i++)
data[i] = *(u64 *)((u8 *)&rtstats + nsim_stats_desc[i].offset);
+
+ ns = netdev_priv(dev);
+
+ if (ns->ethtool.mock_stats.enabled)
+ nsim_ethtool_add_mock_stats(ns, data);
+}
+
+#define NSIM_MOCK_STATS_INTERVAL_MS 100
+
+static void nsim_mock_stats_traffic_bump(struct nsim_mock_stats *stats)
+{
+ if (stats->enabled) {
+ stats->hw_out_of_buffer += 1;
+ stats->hw_out_of_sequence += 1;
+ stats->hw_packet_seq_err += 1;
+ }
+}
+
+static void nsim_mock_stats_traffic_work(struct work_struct *work)
+{
+ struct nsim_mock_stats *stats;
+
+ stats = container_of(work, struct nsim_mock_stats, traffic_dw.work);
+ nsim_mock_stats_traffic_bump(stats);
+
+ schedule_delayed_work(&stats->traffic_dw,
+ msecs_to_jiffies(NSIM_MOCK_STATS_INTERVAL_MS));
}
static const struct ethtool_ops nsim_ethtool_ops = {
@@ -269,6 +342,44 @@ static void nsim_ethtool_ring_init(struct netdevsim *ns)
ns->ethtool.ring.tx_max_pending = 4096;
}
+static void mock_stats_reset(struct nsim_mock_stats *mock_stats)
+{
+ mock_stats->hw_out_of_buffer = 0;
+ mock_stats->hw_out_of_sequence = 0;
+ mock_stats->hw_packet_seq_err = 0;
+}
+
+static ssize_t mock_stats_enabled_write(struct file *filp,
+ const char __user *ubuf,
+ size_t count,
+ loff_t *offp)
+{
+ bool enabled;
+ int r;
+ struct nsim_mock_stats *mock_stats = filp->private_data;
+ struct dentry *dentry = filp->f_path.dentry;
+
+ r = kstrtobool_from_user(ubuf, count, &enabled);
+ if (!r) {
+ r = debugfs_file_get(dentry);
+ if (unlikely(r))
+ return r;
+
+ mock_stats->enabled = enabled;
+ if (!enabled)
+ mock_stats_reset(mock_stats);
+
+ debugfs_file_put(dentry);
+ }
+
+ return count;
+}
+
+static struct debugfs_short_fops mock_stats_fops = {
+ .write = mock_stats_enabled_write,
+ .llseek = generic_file_llseek
+};
+
void nsim_ethtool_init(struct netdevsim *ns)
{
struct dentry *ethtool, *dir;
@@ -305,4 +416,18 @@ void nsim_ethtool_init(struct netdevsim *ns)
&ns->ethtool.ring.rx_mini_max_pending);
debugfs_create_u32("tx_max_pending", 0600, dir,
&ns->ethtool.ring.tx_max_pending);
+
+ dir = debugfs_create_dir("mock_stats", ethtool);
+ debugfs_create_file("enabled", 0600, dir, &ns->ethtool.mock_stats,
+ &mock_stats_fops);
+
+ INIT_DELAYED_WORK(&ns->ethtool.mock_stats.traffic_dw,
+ &nsim_mock_stats_traffic_work);
+ schedule_delayed_work(&ns->ethtool.mock_stats.traffic_dw,
+ msecs_to_jiffies(NSIM_MOCK_STATS_INTERVAL_MS));
+}
+
+void nsim_ethtool_exit(struct netdevsim *ns)
+{
+ cancel_delayed_work_sync(&ns->ethtool.mock_stats.traffic_dw);
}
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 39fe28af48b9..d1864b7cbbd5 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -1143,6 +1143,7 @@ void nsim_destroy(struct netdevsim *ns)
rtnl_unlock();
if (nsim_dev_port_is_pf(ns->nsim_dev_port))
nsim_exit_netdevsim(ns);
+ nsim_ethtool_exit(ns);
/* Put this intentionally late to exercise the orphaning path */
if (ns->page) {
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index bddd24c1389d..57631ec8887a 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -82,6 +82,15 @@ struct nsim_ethtool_pauseparam {
bool report_stats_tx;
};
+struct nsim_mock_stats {
+ u64 hw_out_of_sequence;
+ u64 hw_out_of_buffer;
+ u64 hw_packet_seq_err;
+ struct u64_stats_sync syncp;
+ struct delayed_work traffic_dw;
+ bool enabled;
+};
+
struct nsim_ethtool {
u32 get_err;
u32 set_err;
@@ -90,6 +99,7 @@ struct nsim_ethtool {
struct ethtool_coalesce coalesce;
struct ethtool_ringparam ring;
struct ethtool_fecparam fec;
+ struct nsim_mock_stats mock_stats;
};
struct nsim_rq {
@@ -150,6 +160,7 @@ void nsim_destroy(struct netdevsim *ns);
bool netdev_is_nsim(struct net_device *dev);
void nsim_ethtool_init(struct netdevsim *ns);
+void nsim_ethtool_exit(struct netdevsim *ns);
void nsim_udp_tunnels_debugfs_create(struct nsim_dev *nsim_dev);
int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 3/3] selftests: netdevsim: Add test for ethtool stats
2025-08-05 21:33 ` [PATCH net-next 2/3] netdevsim: Add mock stats for ethtool Dennis Chen
@ 2025-08-05 21:33 ` Dennis Chen
0 siblings, 0 replies; 8+ messages in thread
From: Dennis Chen @ 2025-08-05 21:33 UTC (permalink / raw)
To: netdev; +Cc: dechen, dchen27, kuba, davem, edumazet, pabeni, andrew+netdev,
petrm
Add a test that verifies ethtool correctly exposes driver-specific
stats.
Signed-off-by: Dennis Chen <dechen@redhat.com>
---
.../selftests/drivers/net/netdevsim/Makefile | 1 +
.../drivers/net/netdevsim/ethtool-common.sh | 13 +++++++
.../drivers/net/netdevsim/ethtool-stats.sh | 36 +++++++++++++++++++
3 files changed, 50 insertions(+)
create mode 100755 tools/testing/selftests/drivers/net/netdevsim/ethtool-stats.sh
diff --git a/tools/testing/selftests/drivers/net/netdevsim/Makefile b/tools/testing/selftests/drivers/net/netdevsim/Makefile
index 07b7c46d3311..67055a403e74 100644
--- a/tools/testing/selftests/drivers/net/netdevsim/Makefile
+++ b/tools/testing/selftests/drivers/net/netdevsim/Makefile
@@ -8,6 +8,7 @@ TEST_PROGS = devlink.sh \
ethtool-fec.sh \
ethtool-pause.sh \
ethtool-ring.sh \
+ ethtool-stats.sh \
fib.sh \
fib_notifications.sh \
hw_stats_l3.sh \
diff --git a/tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh b/tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh
index 80160579e0cc..556ff74f443d 100644
--- a/tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh
+++ b/tools/testing/selftests/drivers/net/netdevsim/ethtool-common.sh
@@ -42,6 +42,19 @@ function check {
((num_passes++))
}
+function check_code {
+ local code=$1
+ local msg=$2
+
+ if ((err)); then
+ echo -e $msg
+ ((num_errors++))
+ return
+ fi
+
+ ((num_passes++))
+}
+
function make_netdev {
# Make a netdevsim
old_netdevs=$(ls /sys/class/net)
diff --git a/tools/testing/selftests/drivers/net/netdevsim/ethtool-stats.sh b/tools/testing/selftests/drivers/net/netdevsim/ethtool-stats.sh
new file mode 100755
index 000000000000..281bc24ddcd2
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/netdevsim/ethtool-stats.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-only
+
+source ethtool-common.sh
+
+set -o pipefail
+
+NSIM_NETDEV=$(make_netdev)
+MOCK_STATS_DFS=$NSIM_DEV_DFS/ethtool/mock_stats/enabled
+
+echo y > $MOCK_STATS_DFS
+
+stat=$(ethtool -S $NSIM_NETDEV | grep "hw_out_of_buffer" | awk '{print $2}')
+((stat == 0))
+check_code $? "ethtool stats show > 0 packets immediately after enabling"
+
+sleep 2.5
+
+stat=$(ethtool -S $NSIM_NETDEV | grep "hw_out_of_buffer" | awk '{print $2}')
+((stat >= 20))
+check_code $? "ethtool stats show < 20 packets after 2.5s passed"
+
+echo n > $MOCK_STATS_DFS
+echo y > $MOCK_STATS_DFS
+
+stat=$(ethtool -S $NSIM_NETDEV | grep "hw_out_of_buffer" | awk '{print $2}')
+((stat == 0))
+check_code $? "ethtool stats show > 0 packets after disabling and re-enabling"
+
+if [ $num_errors -eq 0 ]; then
+ echo "PASSED all $((num_passes)) checks"
+ exit 0
+else
+ echo "FAILED $num_errors/$((num_errors+num_passes)) checks"
+ exit 1
+fi
--
2.50.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add
2025-08-05 21:33 [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 1/3] netdevsim: Support ethtool stats Dennis Chen
@ 2025-08-05 22:55 ` Jakub Kicinski
2025-08-06 14:05 ` Dennis Chen
1 sibling, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2025-08-05 22:55 UTC (permalink / raw)
To: Dennis Chen
Cc: netdev, dchen27, davem, edumazet, pabeni, andrew+netdev, petrm
On Tue, 5 Aug 2025 17:33:53 -0400 Dennis Chen wrote:
> This series adds support for querying standard interface stats and
> driver-specific stats with ethtool -S. This allows hardware-independent
> testing of ethtool stats reporting. Driver-specific stats are incremented
> every 100ms once enabled through a debugfs toggle.
>
> Also adds a selftest for ethtool -S for netdevsim.
>
> The implementation of mock stats is heavily based on the mock L3 stats
> support added by commit 1a6d7ae7d63c45("netdevsim: Introduce support for
> L3 offload xstats").
>
> Note: Further replies will come from my school email address,
> dchen27@ncsu.edu, as I will soon lose access to my Red Hat email.
The tests for netdevsim must test something meaningful in the kernel.
This submission really looks like you need it to test some user space
code.
--
pw-bot: reject
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add
2025-08-05 22:55 ` [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Jakub Kicinski
@ 2025-08-06 14:05 ` Dennis Chen
2025-08-06 14:48 ` Jakub Kicinski
0 siblings, 1 reply; 8+ messages in thread
From: Dennis Chen @ 2025-08-06 14:05 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Dennis Chen, netdev, davem, edumazet, pabeni, andrew+netdev,
petrm
On Tue, Aug 5, 2025 at 6:55 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 5 Aug 2025 17:33:53 -0400 Dennis Chen wrote:
> > This series adds support for querying standard interface stats and
> > driver-specific stats with ethtool -S. This allows hardware-independent
> > testing of ethtool stats reporting. Driver-specific stats are incremented
> > every 100ms once enabled through a debugfs toggle.
> >
> > Also adds a selftest for ethtool -S for netdevsim.
> >
> > The implementation of mock stats is heavily based on the mock L3 stats
> > support added by commit 1a6d7ae7d63c45("netdevsim: Introduce support for
> > L3 offload xstats").
> >
> > Note: Further replies will come from my school email address,
> > dchen27@ncsu.edu, as I will soon lose access to my Red Hat email.
>
> The tests for netdevsim must test something meaningful in the kernel.
> This submission really looks like you need it to test some user space
> code.
> --
> pw-bot: reject
Hi Jakub,
This test would help verify that ethtool_ops correctly propagates stats to
userspace, would that not be significant enough for a test?
My thought was that it would be similar to the patches for ethtool
--show-phys here:
https://lore.kernel.org/netdev/20250710062248.378459-1-maxime.chevallier@bootlin.com/
Thanks,
Dennis Chen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add
2025-08-06 14:05 ` Dennis Chen
@ 2025-08-06 14:48 ` Jakub Kicinski
2025-08-07 9:48 ` Simon Horman
0 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2025-08-06 14:48 UTC (permalink / raw)
To: Dennis Chen
Cc: Dennis Chen, netdev, davem, edumazet, pabeni, andrew+netdev,
petrm, Simon Horman
On Wed, 6 Aug 2025 10:05:27 -0400 Dennis Chen wrote:
> > The tests for netdevsim must test something meaningful in the kernel.
> > This submission really looks like you need it to test some user space
> > code.
>
> This test would help verify that ethtool_ops correctly propagates stats to
> userspace, would that not be significant enough for a test?
>
> My thought was that it would be similar to the patches for ethtool
> --show-phys here:
> https://lore.kernel.org/netdev/20250710062248.378459-1-maxime.chevallier@bootlin.com/
What are you trying to test. Like, what _actually_ made you and Kamal
write these patches? I can't think of many bugs in the area. And you
clearly have zero familiarity with our recommendation of what stats
to report and how :/ so if anything your code is hurting more than
helping.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add
2025-08-06 14:48 ` Jakub Kicinski
@ 2025-08-07 9:48 ` Simon Horman
0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2025-08-07 9:48 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Dennis Chen, Dennis Chen, netdev, davem, edumazet, pabeni,
andrew+netdev, petrm
On Wed, Aug 06, 2025 at 07:48:00AM -0700, Jakub Kicinski wrote:
> On Wed, 6 Aug 2025 10:05:27 -0400 Dennis Chen wrote:
> > > The tests for netdevsim must test something meaningful in the kernel.
> > > This submission really looks like you need it to test some user space
> > > code.
> >
> > This test would help verify that ethtool_ops correctly propagates stats to
> > userspace, would that not be significant enough for a test?
> >
> > My thought was that it would be similar to the patches for ethtool
> > --show-phys here:
> > https://lore.kernel.org/netdev/20250710062248.378459-1-maxime.chevallier@bootlin.com/
>
> What are you trying to test. Like, what _actually_ made you and Kamal
> write these patches? I can't think of many bugs in the area. And you
> clearly have zero familiarity with our recommendation of what stats
> to report and how :/ so if anything your code is hurting more than
> helping.
Thanks Jakub,
I'll work with the team to find a better approach.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-08-07 9:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-05 21:33 [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 1/3] netdevsim: Support ethtool stats Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 2/3] netdevsim: Add mock stats for ethtool Dennis Chen
2025-08-05 21:33 ` [PATCH net-next 3/3] selftests: netdevsim: Add test for ethtool stats Dennis Chen
2025-08-05 22:55 ` [PATCH net-next 0/3] netdevsim: Add support for ethtool stats and add Jakub Kicinski
2025-08-06 14:05 ` Dennis Chen
2025-08-06 14:48 ` Jakub Kicinski
2025-08-07 9:48 ` Simon Horman
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).