* [net-next 0/3] psp: Support PSP reset statistics
@ 2026-03-02 19:53 Akhilesh Samineni
2026-03-02 19:53 ` [net-next 1/3] psp: Support resetting statistics on a device Akhilesh Samineni
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-02 19:53 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
kiran.kella, akhilesh.samineni, sachin.suman
The series adds a netlink command to reset per-device PSP statistics
and implements it in netdevsim with reset stats in data traffic test.
Ran selftest for PSP :
# python psp.py
TAP version 13
1..28
ok 1 psp.data_basic_send_v0_ip4
ok 2 psp.data_basic_send_v0_ip6
ok 3 psp.data_basic_send_v1_ip4
ok 4 psp.data_basic_send_v1_ip6
ok 5 psp.data_basic_send_v2_ip4
ok 6 psp.data_basic_send_v2_ip6
ok 7 psp.data_basic_send_v3_ip4
ok 8 psp.data_basic_send_v3_ip6
ok 9 psp.data_mss_adjust_ip4
ok 10 psp.data_mss_adjust_ip6
ok 11 psp.dev_list_devices
ok 12 psp.dev_get_device
ok 13 psp.dev_get_device_bad
ok 14 psp.dev_rotate
ok 15 psp.dev_rotate_spi
ok 16 psp.assoc_basic
ok 17 psp.assoc_bad_dev
ok 18 psp.assoc_sk_only_conn
ok 19 psp.assoc_sk_only_mismatch
ok 20 psp.assoc_sk_only_mismatch_tx
ok 21 psp.assoc_sk_only_unconn
ok 22 psp.assoc_version_mismatch
ok 23 psp.assoc_twice
ok 24 psp.data_send_bad_key
ok 25 psp.data_send_disconnect
ok 26 psp.data_stale_key
ok 27 psp.removal_device_rx
ok 28 psp.removal_device_bi
# Totals: pass:28 fail:0 xfail:0 xpass:0 skip:0 error:0
#
# Responder logs (0):
# STDERR:
# # Set PSP enable on device 3 to 0xf
# # Set PSP enable on device 3 to 0x0
#
Akhilesh Samineni (3):
psp: Support resetting statistics on a device
netdevsim: psp: Handle statistics reset
selftests: drv-net: psp: add reset statistics test
Documentation/netlink/specs/psp.yaml | 13 +++++++++++++
drivers/net/netdevsim/psp.c | 14 ++++++++++++++
include/net/psp/types.h | 6 ++++++
include/uapi/linux/psp.h | 1 +
net/psp/psp-nl-gen.c | 14 ++++++++++++++
net/psp/psp-nl-gen.h | 1 +
net/psp/psp_nl.c | 24 ++++++++++++++++++++++++
tools/testing/selftests/drivers/net/psp.py | 18 ++++++++++++++++++
8 files changed, 91 insertions(+)
--
2.45.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [net-next 1/3] psp: Support resetting statistics on a device
2026-03-02 19:53 [net-next 0/3] psp: Support PSP reset statistics Akhilesh Samineni
@ 2026-03-02 19:53 ` Akhilesh Samineni
2026-03-02 21:15 ` Willem de Bruijn
2026-03-02 19:53 ` [net-next 2/3] netdevsim: psp: Handle statistics reset Akhilesh Samineni
2026-03-02 19:53 ` [net-next 3/3] selftests: drv-net: psp: add reset statistics test Akhilesh Samineni
2 siblings, 1 reply; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-02 19:53 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
kiran.kella, akhilesh.samineni, sachin.suman
Drivers may need to reset per-device PSP statistics to zero.
Add a reset-stats netlink command and a corresponding optional
driver callback to support this.
Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
Documentation/netlink/specs/psp.yaml | 13 +++++++++++++
include/net/psp/types.h | 6 ++++++
include/uapi/linux/psp.h | 1 +
net/psp/psp-nl-gen.c | 14 ++++++++++++++
net/psp/psp-nl-gen.h | 1 +
net/psp/psp_nl.c | 24 ++++++++++++++++++++++++
6 files changed, 59 insertions(+)
diff --git a/Documentation/netlink/specs/psp.yaml b/Documentation/netlink/specs/psp.yaml
index f3a57782d2cf..e37ca142af54 100644
--- a/Documentation/netlink/specs/psp.yaml
+++ b/Documentation/netlink/specs/psp.yaml
@@ -272,6 +272,19 @@ operations:
dump:
reply: *stats-all
+ -
+ name: reset-stats
+ doc: Reset device statistics.
+ attribute-set: dev
+ do:
+ request:
+ attributes:
+ - id
+ reply:
+ attributes: []
+ pre: psp-device-get-locked
+ post: psp-device-unlock
+
mcast-groups:
list:
-
diff --git a/include/net/psp/types.h b/include/net/psp/types.h
index 25a9096d4e7d..7f9924e8ab0d 100644
--- a/include/net/psp/types.h
+++ b/include/net/psp/types.h
@@ -211,6 +211,12 @@ struct psp_dev_ops {
* Stats must be filled in member-by-member, never memset the struct.
*/
void (*get_stats)(struct psp_dev *psd, struct psp_dev_stats *stats);
+
+ /**
+ * @reset_stats: reset the statistics
+ */
+ int (*reset_stats)(struct psp_dev *psd, struct netlink_ext_ack *extack);
+
};
#endif /* __NET_PSP_H */
diff --git a/include/uapi/linux/psp.h b/include/uapi/linux/psp.h
index a3a336488dc3..6e0c217a8366 100644
--- a/include/uapi/linux/psp.h
+++ b/include/uapi/linux/psp.h
@@ -74,6 +74,7 @@ enum {
PSP_CMD_RX_ASSOC,
PSP_CMD_TX_ASSOC,
PSP_CMD_GET_STATS,
+ PSP_CMD_RESET_STATS,
__PSP_CMD_MAX,
PSP_CMD_MAX = (__PSP_CMD_MAX - 1)
diff --git a/net/psp/psp-nl-gen.c b/net/psp/psp-nl-gen.c
index 22a48d0fa378..c8691f7a61ce 100644
--- a/net/psp/psp-nl-gen.c
+++ b/net/psp/psp-nl-gen.c
@@ -53,6 +53,11 @@ static const struct nla_policy psp_get_stats_nl_policy[PSP_A_STATS_DEV_ID + 1] =
[PSP_A_STATS_DEV_ID] = NLA_POLICY_MIN(NLA_U32, 1),
};
+/* PSP_CMD_RESET_STATS - do */
+static const struct nla_policy psp_reset_stats_nl_policy[PSP_A_DEV_ID + 1] = {
+ [PSP_A_DEV_ID] = NLA_POLICY_MIN(NLA_U32, 1),
+};
+
/* Ops table for psp */
static const struct genl_split_ops psp_nl_ops[] = {
{
@@ -119,6 +124,15 @@ static const struct genl_split_ops psp_nl_ops[] = {
.dumpit = psp_nl_get_stats_dumpit,
.flags = GENL_CMD_CAP_DUMP,
},
+ {
+ .cmd = PSP_CMD_RESET_STATS,
+ .pre_doit = psp_device_get_locked,
+ .doit = psp_nl_reset_stats_doit,
+ .post_doit = psp_device_unlock,
+ .policy = psp_reset_stats_nl_policy,
+ .maxattr = PSP_A_DEV_ID,
+ .flags = GENL_CMD_CAP_DO,
+ },
};
static const struct genl_multicast_group psp_nl_mcgrps[] = {
diff --git a/net/psp/psp-nl-gen.h b/net/psp/psp-nl-gen.h
index 599c5f1c82f2..67577c898f99 100644
--- a/net/psp/psp-nl-gen.h
+++ b/net/psp/psp-nl-gen.h
@@ -31,6 +31,7 @@ int psp_nl_rx_assoc_doit(struct sk_buff *skb, struct genl_info *info);
int psp_nl_tx_assoc_doit(struct sk_buff *skb, struct genl_info *info);
int psp_nl_get_stats_doit(struct sk_buff *skb, struct genl_info *info);
int psp_nl_get_stats_dumpit(struct sk_buff *skb, struct netlink_callback *cb);
+int psp_nl_reset_stats_doit(struct sk_buff *skb, struct genl_info *info);
enum {
PSP_NLGRP_MGMT,
diff --git a/net/psp/psp_nl.c b/net/psp/psp_nl.c
index 6afd7707ec12..aa8960c8d4d1 100644
--- a/net/psp/psp_nl.c
+++ b/net/psp/psp_nl.c
@@ -277,6 +277,27 @@ int psp_nl_key_rotate_doit(struct sk_buff *skb, struct genl_info *info)
return err;
}
+int psp_nl_reset_stats_doit(struct sk_buff *skb, struct genl_info *info)
+{
+ struct psp_dev *psd = info->user_ptr[0];
+ struct sk_buff *rsp;
+ int err;
+
+ if (!psd->ops->reset_stats)
+ return -EOPNOTSUPP;
+
+ rsp = psp_nl_reply_new(info);
+ if (!rsp)
+ return -ENOMEM;
+
+ err = psd->ops->reset_stats(psd, info->extack);
+ if (err)
+ goto err_free_rsp;
+
+ return psp_nl_reply_send(rsp, info);
+
+err_free_rsp:
+ nlmsg_free(rsp);
+ return err;
+}
+
/* Key etc. */
int psp_assoc_device_get_locked(const struct genl_split_ops *ops,
--
2.45.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 2/3] netdevsim: psp: Handle statistics reset
2026-03-02 19:53 [net-next 0/3] psp: Support PSP reset statistics Akhilesh Samineni
2026-03-02 19:53 ` [net-next 1/3] psp: Support resetting statistics on a device Akhilesh Samineni
@ 2026-03-02 19:53 ` Akhilesh Samineni
2026-03-02 19:53 ` [net-next 3/3] selftests: drv-net: psp: add reset statistics test Akhilesh Samineni
2 siblings, 0 replies; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-02 19:53 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
kiran.kella, akhilesh.samineni, sachin.suman
Implement reset_stats for netdevsim PSP so that the
reset-stats netlink command works.
Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/netdevsim/psp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/netdevsim/psp.c b/drivers/net/netdevsim/psp.c
index 0b4d717253b0..d4bede67f283 100644
--- a/drivers/net/netdevsim/psp.c
+++ b/drivers/net/netdevsim/psp.c
@@ -192,6 +192,19 @@ static void nsim_get_stats(struct psp_dev *psd, struct psp_dev_stats *stats)
} while (u64_stats_fetch_retry(&ns->psp.syncp, start));
}
+static int nsim_reset_stats(struct psp_dev *psd, struct netlink_ext_ack *extack)
+{
+ struct netdevsim *ns = psd->drv_priv;
+
+ u64_stats_update_begin(&ns->psp.syncp);
+ u64_stats_set(&ns->psp.rx_bytes, 0);
+ u64_stats_set(&ns->psp.rx_packets, 0);
+ u64_stats_set(&ns->psp.tx_bytes, 0);
+ u64_stats_set(&ns->psp.tx_packets, 0);
+ u64_stats_update_end(&ns->psp.syncp);
+ return 0;
+}
+
static struct psp_dev_ops nsim_psp_ops = {
.set_config = nsim_psp_set_config,
.rx_spi_alloc = nsim_rx_spi_alloc,
@@ -199,6 +212,7 @@ static struct psp_dev_ops nsim_psp_ops = {
.tx_key_del = nsim_assoc_del,
.key_rotate = nsim_key_rotate,
.get_stats = nsim_get_stats,
+ .reset_stats = nsim_reset_stats,
};
static struct psp_dev_caps nsim_psp_caps = {
--
2.45.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 3/3] selftests: drv-net: psp: add reset statistics test
2026-03-02 19:53 [net-next 0/3] psp: Support PSP reset statistics Akhilesh Samineni
2026-03-02 19:53 ` [net-next 1/3] psp: Support resetting statistics on a device Akhilesh Samineni
2026-03-02 19:53 ` [net-next 2/3] netdevsim: psp: Handle statistics reset Akhilesh Samineni
@ 2026-03-02 19:53 ` Akhilesh Samineni
2026-03-02 23:05 ` Jakub Kicinski
2 siblings, 1 reply; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-02 19:53 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
kiran.kella, akhilesh.samineni, sachin.suman
Add get stats and reset stats verification within _data_basic_send()
to exercise the reset-stats netlink command in the data path test.
Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
---
tools/testing/selftests/drivers/net/psp.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
index 864d9fce1094..b7a59d0dbe25 100755
--- a/tools/testing/selftests/drivers/net/psp.py
+++ b/tools/testing/selftests/drivers/net/psp.py
@@ -113,6 +113,9 @@ def _check_data_outq(s, exp_len, force_wait=False):
def _get_stat(cfg, key):
return cfg.pspnl.get_stats({'dev-id': cfg.psp_dev_id})[key]
+
+def _reset_stat(cfg):
+ cfg.pspnl.reset_stats({"id": cfg.psp_dev_id})
+
#
# Test case boiler plate
#
@@ -389,8 +392,22 @@ def _data_basic_send(cfg, version, ipver):
"tx-key": tx,
"sock-fd": s.fileno()})
+ _reset_stat(cfg)
+ rx_packets = _get_stat(cfg, 'rx-packets')
+ rx_bytes = _get_stat(cfg, 'rx-bytes')
+ ksft_eq(rx_packets, 0)
+ ksft_eq(rx_bytes, 0)
data_len = _send_careful(cfg, s, 100)
_check_data_rx(cfg, data_len)
+ rx_packets = _get_stat(cfg, 'rx-packets')
+ rx_bytes = _get_stat(cfg, 'rx-bytes')
+ ksft_ne(rx_packets, 0)
+ ksft_ne(rx_bytes, 0)
+ _reset_stat(cfg)
+ rx_packets = _get_stat(cfg, 'rx-packets')
+ rx_bytes = _get_stat(cfg, 'rx-bytes')
+ ksft_eq(rx_packets, 0)
+ ksft_eq(rx_bytes, 0)
_close_psp_conn(cfg, s)
--
2.45.4
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-02 19:53 ` [net-next 1/3] psp: Support resetting statistics on a device Akhilesh Samineni
@ 2026-03-02 21:15 ` Willem de Bruijn
2026-03-05 10:54 ` Akhilesh Samineni
0 siblings, 1 reply; 14+ messages in thread
From: Willem de Bruijn @ 2026-03-02 21:15 UTC (permalink / raw)
To: Akhilesh Samineni, davem, edumazet, kuba, pabeni, andrew+netdev,
horms, willemb, daniel.zahka
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
kiran.kella, akhilesh.samineni, sachin.suman
Akhilesh Samineni wrote:
> Drivers may need to reset per-device PSP statistics to zero.
The series does not include rationale why this may be needed.
What makes PSP counters special in this regard?
> Add a reset-stats netlink command and a corresponding optional
> driver callback to support this.
>
> Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
> Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 3/3] selftests: drv-net: psp: add reset statistics test
2026-03-02 19:53 ` [net-next 3/3] selftests: drv-net: psp: add reset statistics test Akhilesh Samineni
@ 2026-03-02 23:05 ` Jakub Kicinski
2026-03-05 10:55 ` Akhilesh Samineni
0 siblings, 1 reply; 14+ messages in thread
From: Jakub Kicinski @ 2026-03-02 23:05 UTC (permalink / raw)
To: Akhilesh Samineni
Cc: davem, edumazet, pabeni, andrew+netdev, horms, willemb,
daniel.zahka, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, kiran.kella, sachin.suman
On Mon, 2 Mar 2026 11:53:52 -0800 Akhilesh Samineni wrote:
> Add get stats and reset stats verification within _data_basic_send()
> to exercise the reset-stats netlink command in the data path test.
Please make this a new/separate test.
(of course definite +1 to Willem's question)
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-02 21:15 ` Willem de Bruijn
@ 2026-03-05 10:54 ` Akhilesh Samineni
2026-03-05 14:25 ` Willem de Bruijn
2026-03-05 14:59 ` Jakub Kicinski
0 siblings, 2 replies; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-05 10:54 UTC (permalink / raw)
To: Willem de Bruijn
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, kiran.kella, sachin.suman
[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]
On Tue, Mar 3, 2026 at 2:45 AM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> Akhilesh Samineni wrote:
> > Drivers may need to reset per-device PSP statistics to zero.
>
> The series does not include rationale why this may be needed.
>
> What makes PSP counters special in this regard?
>
The PSP supports dynamic administrative states, allowing it to be
enabled or disabled during runtime. Currently, statistics are
persistent across these state transitions, which can lead to baseline
drift and complicate telemetry analysis.
This patch introduces a statistics reset mechanism to allow userspace
to clear accumulated counters. This is essential for establishing a
deterministic baseline when re-enabling the device, ensuring that
performance metrics and error counters reflect only the current device
state.
> > Add a reset-stats netlink command and a corresponding optional
> > driver callback to support this.
> >
> > Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
> > Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
> > Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4211 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 3/3] selftests: drv-net: psp: add reset statistics test
2026-03-02 23:05 ` Jakub Kicinski
@ 2026-03-05 10:55 ` Akhilesh Samineni
0 siblings, 0 replies; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-05 10:55 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, edumazet, pabeni, andrew+netdev, horms, willemb,
daniel.zahka, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, kiran.kella, sachin.suman
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
On Tue, Mar 3, 2026 at 4:35 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 2 Mar 2026 11:53:52 -0800 Akhilesh Samineni wrote:
> > Add get stats and reset stats verification within _data_basic_send()
> > to exercise the reset-stats netlink command in the data path test.
>
> Please make this a new/separate test.
> (of course definite +1 to Willem's question)
Ack. Will push in the next version.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4211 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-05 10:54 ` Akhilesh Samineni
@ 2026-03-05 14:25 ` Willem de Bruijn
2026-03-06 15:50 ` Akhilesh Samineni
2026-03-05 14:59 ` Jakub Kicinski
1 sibling, 1 reply; 14+ messages in thread
From: Willem de Bruijn @ 2026-03-05 14:25 UTC (permalink / raw)
To: Akhilesh Samineni, Willem de Bruijn
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, kiran.kella, sachin.suman
Akhilesh Samineni wrote:
> On Tue, Mar 3, 2026 at 2:45 AM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > Akhilesh Samineni wrote:
> > > Drivers may need to reset per-device PSP statistics to zero.
> >
> > The series does not include rationale why this may be needed.
> >
> > What makes PSP counters special in this regard?
> >
>
> The PSP supports dynamic administrative states, allowing it to be
> enabled or disabled during runtime. Currently, statistics are
> persistent across these state transitions, which can lead to baseline
> drift and complicate telemetry analysis.
How is this dynamic enable/disable configured, and can stats reset be
part of that, rather than a separate API?
> This patch introduces a statistics reset mechanism to allow userspace
> to clear accumulated counters. This is essential for establishing a
> deterministic baseline when re-enabling the device, ensuring that
> performance metrics and error counters reflect only the current device
> state.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-05 10:54 ` Akhilesh Samineni
2026-03-05 14:25 ` Willem de Bruijn
@ 2026-03-05 14:59 ` Jakub Kicinski
2026-03-06 15:54 ` Akhilesh Samineni
1 sibling, 1 reply; 14+ messages in thread
From: Jakub Kicinski @ 2026-03-05 14:59 UTC (permalink / raw)
To: Akhilesh Samineni
Cc: Willem de Bruijn, davem, edumazet, pabeni, andrew+netdev, horms,
willemb, daniel.zahka, netdev, linux-kernel,
jayakrishnan.udayavarma, ajit.khaparde, kiran.kella, sachin.suman
On Thu, 5 Mar 2026 16:24:05 +0530 Akhilesh Samineni wrote:
> The PSP supports dynamic administrative states, allowing it to be
> enabled or disabled during runtime. Currently, statistics are
> persistent across these state transitions, which can lead to baseline
> drift and complicate telemetry analysis.
Baseline drift? What _concrete_ use case do you actually have in mind?
Do you know of other stats that get reset when something is disabled
in networking?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-05 14:25 ` Willem de Bruijn
@ 2026-03-06 15:50 ` Akhilesh Samineni
2026-03-06 20:37 ` Willem de Bruijn
0 siblings, 1 reply; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-06 15:50 UTC (permalink / raw)
To: Willem de Bruijn
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, kiran.kella, sachin.suman
[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]
On Thu, Mar 5, 2026 at 7:55 PM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> Akhilesh Samineni wrote:
> > On Tue, Mar 3, 2026 at 2:45 AM Willem de Bruijn
> > <willemdebruijn.kernel@gmail.com> wrote:
> > >
> > > Akhilesh Samineni wrote:
> > > > Drivers may need to reset per-device PSP statistics to zero.
> > >
> > > The series does not include rationale why this may be needed.
> > >
> > > What makes PSP counters special in this regard?
> > >
> >
> > The PSP supports dynamic administrative states, allowing it to be
> > enabled or disabled during runtime. Currently, statistics are
> > persistent across these state transitions, which can lead to baseline
> > drift and complicate telemetry analysis.
>
> How is this dynamic enable/disable configured, and can stats reset be
> part of that, rather than a separate API?
>
Instead of bundling the statistics reset with the transition to the
disabled mode, we considered providing a separate reset operation to
give users the flexibility to clear counters without toggling the PSP
state.
> > This patch introduces a statistics reset mechanism to allow userspace
> > to clear accumulated counters. This is essential for establishing a
> > deterministic baseline when re-enabling the device, ensuring that
> > performance metrics and error counters reflect only the current device
> > state.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4211 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-05 14:59 ` Jakub Kicinski
@ 2026-03-06 15:54 ` Akhilesh Samineni
2026-03-06 20:34 ` Jakub Kicinski
0 siblings, 1 reply; 14+ messages in thread
From: Akhilesh Samineni @ 2026-03-06 15:54 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Willem de Bruijn, davem, edumazet, pabeni, andrew+netdev, horms,
willemb, daniel.zahka, netdev, linux-kernel,
jayakrishnan.udayavarma, ajit.khaparde, kiran.kella, sachin.suman
[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]
On Thu, Mar 5, 2026 at 8:29 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 5 Mar 2026 16:24:05 +0530 Akhilesh Samineni wrote:
> > The PSP supports dynamic administrative states, allowing it to be
> > enabled or disabled during runtime. Currently, statistics are
> > persistent across these state transitions, which can lead to baseline
> > drift and complicate telemetry analysis.
>
> Baseline drift? What _concrete_ use case do you actually have in mind?
> Do you know of other stats that get reset when something is disabled
> in networking?
This can be useful in scenarios such as when the device configuration
changes between different versions or algorithms, or when the PSP
device is reassigned between tenants/VMs in a multi-tenant
environment. In such cases, having a dedicated control to reset the
counters allows users to start monitoring statistics from a clean
state.
That said, if the common practice in netdev is to avoid providing
explicit reset functionality for such statistics, we are fine with
aligning with that convention and not introducing a deviation.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4211 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-06 15:54 ` Akhilesh Samineni
@ 2026-03-06 20:34 ` Jakub Kicinski
0 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2026-03-06 20:34 UTC (permalink / raw)
To: Akhilesh Samineni
Cc: Willem de Bruijn, davem, edumazet, pabeni, andrew+netdev, horms,
willemb, daniel.zahka, netdev, linux-kernel,
jayakrishnan.udayavarma, ajit.khaparde, kiran.kella, sachin.suman
On Fri, 6 Mar 2026 21:24:01 +0530 Akhilesh Samineni wrote:
> That said, if the common practice in netdev is to avoid providing
> explicit reset functionality for such statistics, we are fine with
> aligning with that convention and not introducing a deviation.
We generally support resetting the whole device or its specific
"blocks". Can't think of any reset specifically for stats.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [net-next 1/3] psp: Support resetting statistics on a device
2026-03-06 15:50 ` Akhilesh Samineni
@ 2026-03-06 20:37 ` Willem de Bruijn
0 siblings, 0 replies; 14+ messages in thread
From: Willem de Bruijn @ 2026-03-06 20:37 UTC (permalink / raw)
To: Akhilesh Samineni, Willem de Bruijn
Cc: davem, edumazet, kuba, pabeni, andrew+netdev, horms, willemb,
daniel.zahka, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, kiran.kella, sachin.suman
Akhilesh Samineni wrote:
> On Thu, Mar 5, 2026 at 7:55 PM Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
> >
> > Akhilesh Samineni wrote:
> > > On Tue, Mar 3, 2026 at 2:45 AM Willem de Bruijn
> > > <willemdebruijn.kernel@gmail.com> wrote:
> > > >
> > > > Akhilesh Samineni wrote:
> > > > > Drivers may need to reset per-device PSP statistics to zero.
> > > >
> > > > The series does not include rationale why this may be needed.
> > > >
> > > > What makes PSP counters special in this regard?
> > > >
> > >
> > > The PSP supports dynamic administrative states, allowing it to be
> > > enabled or disabled during runtime. Currently, statistics are
> > > persistent across these state transitions, which can lead to baseline
> > > drift and complicate telemetry analysis.
> >
> > How is this dynamic enable/disable configured, and can stats reset be
> > part of that, rather than a separate API?
> >
>
> Instead of bundling the statistics reset with the transition to the
> disabled mode, we considered providing a separate reset operation to
> give users the flexibility to clear counters without toggling the PSP
> state.
Flexibility. And responsibility. A user process that waits on a
notification to exercise this API? That would be quite complex and
clunky.
If counter reset is expected on device disable, more robust to have
that part of the reset logic itself.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-03-06 20:37 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 19:53 [net-next 0/3] psp: Support PSP reset statistics Akhilesh Samineni
2026-03-02 19:53 ` [net-next 1/3] psp: Support resetting statistics on a device Akhilesh Samineni
2026-03-02 21:15 ` Willem de Bruijn
2026-03-05 10:54 ` Akhilesh Samineni
2026-03-05 14:25 ` Willem de Bruijn
2026-03-06 15:50 ` Akhilesh Samineni
2026-03-06 20:37 ` Willem de Bruijn
2026-03-05 14:59 ` Jakub Kicinski
2026-03-06 15:54 ` Akhilesh Samineni
2026-03-06 20:34 ` Jakub Kicinski
2026-03-02 19:53 ` [net-next 2/3] netdevsim: psp: Handle statistics reset Akhilesh Samineni
2026-03-02 19:53 ` [net-next 3/3] selftests: drv-net: psp: add reset statistics test Akhilesh Samineni
2026-03-02 23:05 ` Jakub Kicinski
2026-03-05 10:55 ` Akhilesh Samineni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox