* [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes
@ 2026-11-17 21:54 Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-17 21:54 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Björn Töpel, Breno Leitao, Simon Horman, Mina Almasry,
Vadim Fedorenko, Dimitri Daskalakis, netdev, linux-kselftest,
Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
AI identified several bugs while I was working on unrelated parts of the
driver. fbnic_queue_stop() always waits on queue 0 to idle for rx queues.
fbnic_get_ts_stats() dereferences a NULL pointer when the interface is down.
And fbnic_{set|reset}_netif_napi does not account for disabled rings.
All bugs were verified on HW, and a new stats selftest was added to identify
other drivers with the same timestamp stats mishandling.
v2:
- Add .get_ts_stats() support to netdevsim
- v1: https://lore.kernel.org/all/20261116202957.3601684-1-dimitri.daskalakis1@gmail.com/
Dimitri Daskalakis (5):
eth: fbnic: wait on the correct queues in fbnic_queue_stop()
eth: fbnic: skip disabled Tx rings when setting the queue NAPI
eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats()
netdevsim: report fake timestamping stats
selftests: drv-net: stats: query timestamping stats while down
.../net/ethernet/meta/fbnic/fbnic_ethtool.c | 3 +++
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 20 ++++++++++++---
drivers/net/netdevsim/ethtool.c | 9 +++++++
tools/testing/selftests/drivers/net/stats.py | 25 ++++++++++++++++++-
4 files changed, 52 insertions(+), 5 deletions(-)
--
2.52.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop()
2026-11-17 21:54 [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
@ 2026-11-17 21:54 ` Dimitri Daskalakis
2026-11-18 13:13 ` Björn Töpel
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-17 21:54 ` [PATCH net v2 2/5] eth: fbnic: skip disabled Tx rings when setting the queue NAPI Dimitri Daskalakis
` (3 subsequent siblings)
4 siblings, 2 replies; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-17 21:54 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Björn Töpel, Breno Leitao, Simon Horman, Mina Almasry,
Vadim Fedorenko, Dimitri Daskalakis, netdev, linux-kselftest,
Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
fbnic_queue_stop() waits for every queue of the NAPI vector to go idle
before tearing it down, using sub0.q_idx as the queue index. We set
q_idx on submission queues for Tx, and completion queues on Rx, so
this waits on queue 0 for every Rx queue.
For non-combined channels, stopping an Rx queue always stops/wakes
Tx queue 0.
Set the queue id on Tx completion rings so we don't have to distinguish
between ring types to get the correct queue id, and don't stop/wake
disabled rings.
This bug was found by AI and verified on HW.
Reproduced by binding a devmem dmabuf to one Rx queue (netdev bind-rx).
Added a printk to fbnic_wait_queue_idle(), and traced Tx queue stop/wake
with bpftrace.
combined 79, bind rxq 1:
before:
netif_stop_subqueue(1)
fbnic_wait_queue_idle(tx, 1)
fbnic_wait_queue_idle(rx, 0)
netif_wake_subqueue(1)
after:
netif_stop_subqueue(1)
fbnic_wait_queue_idle(tx, 1)
fbnic_wait_queue_idle(rx, 1)
netif_wake_subqueue(1)
rx 34 tx 34, bind rxq 5:
before:
netif_stop_subqueue(0)
fbnic_wait_queue_idle(tx, 0)
fbnic_wait_queue_idle(rx, 0)
netif_wake_subqueue(0)
after:
fbnic_wait_queue_idle(tx, 39)
fbnic_wait_queue_idle(rx, 5)
^ no more stop/wake of Tx queue 0
(tx 39 is the XDP Tx queue of rxq 5's vector,
Rx queues always get an XDP Tx queue)
Fixes: da43127a8edc ("eth: fbnic: support queue ops / zero-copy Rx")
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 07d4b2e92362..5efed21e5932 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -1772,7 +1772,7 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn,
/* Configure Tx completion queue */
db = &uc_addr[FBNIC_QUEUE(txq_idx) + FBNIC_QUEUE_TCQ_HEAD];
- fbnic_ring_init(&qt->cmpl, db, 0, 0);
+ fbnic_ring_init(&qt->cmpl, db, txq_idx, 0);
/* Update Tx queue index */
txt_count--;
@@ -3047,8 +3047,11 @@ static void __fbnic_nv_restart(struct fbnic_net *fbn,
fbnic_wr32(fbd, FBNIC_INTR_SET(nv->v_idx / 32), BIT(nv->v_idx % 32));
fbnic_wrfl(fbd);
- for (i = 0; i < nv->txt_count; i++)
+ for (i = 0; i < nv->txt_count; i++) {
+ if (nv->qt[i].sub0.flags & FBNIC_RING_F_DISABLED)
+ continue;
netif_wake_subqueue(fbn->netdev, nv->qt[i].sub0.q_idx);
+ }
fbnic_dbg_nv_init(nv);
}
@@ -3089,13 +3092,16 @@ static int fbnic_queue_stop(struct net_device *dev, void *qmem, int idx)
napi_disable_locked(&nv->napi);
fbnic_nv_irq_disable(nv);
- for (i = 0; i < nv->txt_count; i++)
+ for (i = 0; i < nv->txt_count; i++) {
+ if (nv->qt[i].sub0.flags & FBNIC_RING_F_DISABLED)
+ continue;
netif_stop_subqueue(dev, nv->qt[i].sub0.q_idx);
+ }
fbnic_nv_disable(fbn, nv);
for (t = 0; t < nv->txt_count + nv->rxt_count; t++) {
err = fbnic_wait_queue_idle(fbn, t >= nv->txt_count,
- nv->qt[t].sub0.q_idx);
+ nv->qt[t].cmpl.q_idx);
if (err)
goto err_restart;
}
--
2.52.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net v2 2/5] eth: fbnic: skip disabled Tx rings when setting the queue NAPI
2026-11-17 21:54 [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
@ 2026-11-17 21:54 ` Dimitri Daskalakis
2026-11-18 13:15 ` Björn Töpel
2026-11-17 21:54 ` [PATCH net v2 3/5] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() Dimitri Daskalakis
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-17 21:54 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Björn Töpel, Breno Leitao, Simon Horman, Mina Almasry,
Vadim Fedorenko, Dimitri Daskalakis, netdev, linux-kselftest,
Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
When Rx and Tx channels are not combined, each Rx vector gets a Tx
triad whose sub0 is disabled with a q_idx of 0. fbnic_set_netif_napi()
and fbnic_reset_netif_napi() don't skip it, so every Rx vector
associates Tx queue 0 with its own NAPI, and the netlink queue info
reports the wrong NAPI for Tx queue 0.
This bug was found by AI and verified on HW.
Reproduced with "ethtool -L eth0 combined 0 rx 34 tx 34", and reading
the NAPI IDs with "ynl --family netdev --dump queue-get":
before: tx 0 napi-id 580, tx 1 napi-id 514, rx 33 napi-id 580
^^^ rx 33's NAPI, not vector 0's
after: tx 0 napi-id 513, tx 1 napi-id 514, rx 33 napi-id 580
Fixes: cf4facfb132a ("eth: fbnic: Add support for XDP queues")
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 5efed21e5932..89e7b806363b 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -2184,6 +2184,9 @@ static void fbnic_set_netif_napi(struct fbnic_napi_vector *nv)
for (i = 0; i < nv->txt_count; i++) {
struct fbnic_q_triad *qt = &nv->qt[i];
+ if (qt->sub0.flags & FBNIC_RING_F_DISABLED)
+ continue;
+
netif_queue_set_napi(nv->napi.dev, qt->sub0.q_idx,
NETDEV_QUEUE_TYPE_TX, &nv->napi);
}
@@ -2205,6 +2208,9 @@ static void fbnic_reset_netif_napi(struct fbnic_napi_vector *nv)
for (i = 0; i < nv->txt_count; i++) {
struct fbnic_q_triad *qt = &nv->qt[i];
+ if (qt->sub0.flags & FBNIC_RING_F_DISABLED)
+ continue;
+
netif_queue_set_napi(nv->napi.dev, qt->sub0.q_idx,
NETDEV_QUEUE_TYPE_TX, NULL);
}
--
2.52.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net v2 3/5] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats()
2026-11-17 21:54 [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 2/5] eth: fbnic: skip disabled Tx rings when setting the queue NAPI Dimitri Daskalakis
@ 2026-11-17 21:54 ` Dimitri Daskalakis
2026-11-18 13:26 ` Björn Töpel
2026-11-17 21:54 ` [PATCH net v2 4/5] netdevsim: report fake timestamping stats Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down Dimitri Daskalakis
4 siblings, 1 reply; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-17 21:54 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Björn Töpel, Breno Leitao, Simon Horman, Mina Almasry,
Vadim Fedorenko, Dimitri Daskalakis, netdev, linux-kselftest,
Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
fbnic_stop() frees the NAPI vectors, which clears fbn->tx[] while
num_tx_queues is left unchanged. fbnic_get_ts_stats() walks fbn->tx[]
without checking for NULL, so asking for timestamping statistics while
the interface is down dereferences a NULL ring.
This was found by AI and reproduced on HW.
# ip link set dev eth0 down; ethtool -I -T eth0
BUG: kernel NULL pointer dereference, address: 0000000000000050
RIP: 0010:fbnic_get_ts_stats+0x38/0x60
Call Trace:
tsinfo_prepare_data+0x82/0xb0
ethnl_default_doit+0x213/0x470
genl_family_rcv_msg_doit+0xdd/0x110
...
Fixes: 96f358f75d1a ("eth: fbnic: add ethtool timestamping statistics")
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
index e774740fcb5d..0cd03cbf2713 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
@@ -1740,6 +1740,9 @@ static void fbnic_get_ts_stats(struct net_device *netdev,
ts_stats->lost = fbn->tx_stats.twq.ts_lost;
for (i = 0; i < fbn->num_tx_queues; i++) {
ring = fbn->tx[i];
+ if (!ring)
+ continue;
+
do {
start = u64_stats_fetch_begin(&ring->stats.syncp);
ts_packets = ring->stats.twq.ts_packets;
--
2.52.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net v2 4/5] netdevsim: report fake timestamping stats
2026-11-17 21:54 [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
` (2 preceding siblings ...)
2026-11-17 21:54 ` [PATCH net v2 3/5] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() Dimitri Daskalakis
@ 2026-11-17 21:54 ` Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down Dimitri Daskalakis
4 siblings, 0 replies; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-17 21:54 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Björn Töpel, Breno Leitao, Simon Horman, Mina Almasry,
Vadim Fedorenko, Dimitri Daskalakis, netdev, linux-kselftest,
Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
drivers/net selftests can't skip on netdevsim. Implement get_ts_stats
with fixed counters so the stats test can read timestamping statistics.
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
drivers/net/netdevsim/ethtool.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/netdevsim/ethtool.c b/drivers/net/netdevsim/ethtool.c
index c3d2bc783d55..e0c4c96209c4 100644
--- a/drivers/net/netdevsim/ethtool.c
+++ b/drivers/net/netdevsim/ethtool.c
@@ -205,6 +205,14 @@ static int nsim_get_ts_info(struct net_device *dev,
return 0;
}
+static void nsim_get_ts_stats(struct net_device *dev,
+ struct ethtool_ts_stats *ts_stats)
+{
+ ts_stats->pkts = 3;
+ ts_stats->lost = 1;
+ ts_stats->err = 0;
+}
+
static u32 nsim_get_rxfh_key_size(struct net_device *dev)
{
return NETDEV_RSS_KEY_LEN;
@@ -275,6 +283,7 @@ 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_ts_stats = nsim_get_ts_stats,
};
static void nsim_ethtool_ring_init(struct netdevsim *ns)
--
2.52.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down
2026-11-17 21:54 [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
` (3 preceding siblings ...)
2026-11-17 21:54 ` [PATCH net v2 4/5] netdevsim: report fake timestamping stats Dimitri Daskalakis
@ 2026-11-17 21:54 ` Dimitri Daskalakis
2026-11-19 9:54 ` netdev-bot+sashiko
4 siblings, 1 reply; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-17 21:54 UTC (permalink / raw)
To: David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Björn Töpel, Breno Leitao, Simon Horman, Mina Almasry,
Vadim Fedorenko, Dimitri Daskalakis, netdev, linux-kselftest,
Dimitri Daskalakis
From: Dimitri Daskalakis <daskald@meta.com>
Read timestamping statistics before and after ifdown, to catch drivers
that crash while the interface is down. Counters must not go backwards
across ifdown; the test does not send timestamped traffic, so a reset
is only caught if the counters were already nonzero.
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
---
tools/testing/selftests/drivers/net/stats.py | 25 +++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py
index b08e4d48b15c..e61db30b5181 100755
--- a/tools/testing/selftests/drivers/net/stats.py
+++ b/tools/testing/selftests/drivers/net/stats.py
@@ -220,6 +220,28 @@ def check_down(cfg) -> None:
netfam.qstats_get({"ifindex": cfg.ifindex, "scope": "queue"}, dump=True)
+@ksft_disruptive
+def check_down_ts_stats(cfg) -> None:
+ """Test timestamping stats are not impacted by ifdown"""
+
+ req = {"header": {"dev-index": cfg.ifindex, "flags": {"stats"}}}
+ try:
+ stats = ethnl.tsinfo_get(req).get("stats")
+ except NlError as e:
+ if e.error == errno.EOPNOTSUPP:
+ raise KsftSkipEx("timestamping not supported by the device") from e
+ raise
+ if not stats:
+ raise KsftSkipEx("timestamping stats not supported by the device")
+
+ ip(f"link set dev {cfg.dev['ifname']} down")
+ defer(ip, f"link set dev {cfg.dev['ifname']} up")
+
+ stats2 = ethnl.tsinfo_get(req).get("stats", {})
+ for k in stats:
+ ksft_ge(stats2[k], stats[k], comment=f"{k} went backwards on device down")
+
+
def __run_inf_loop(body):
body = body.strip()
if body[-1] != ';':
@@ -311,7 +333,8 @@ def main() -> None:
with NetDrvEnv(__file__, queue_count=100) as cfg:
ksft_run([check_pause, check_fec, check_fec_hist, pkt_byte_sum,
- qstat_by_ifindex, check_down, procfs_hammer,
+ qstat_by_ifindex, check_down, check_down_ts_stats,
+ procfs_hammer,
procfs_downup_hammer],
args=(cfg, ))
ksft_exit()
--
2.52.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop()
2026-11-17 21:54 ` [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
@ 2026-11-18 13:13 ` Björn Töpel
2026-11-19 9:54 ` netdev-bot+sashiko
1 sibling, 0 replies; 13+ messages in thread
From: Björn Töpel @ 2026-11-18 13:13 UTC (permalink / raw)
To: Dimitri Daskalakis, David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Breno Leitao, Simon Horman, Mina Almasry, Vadim Fedorenko,
Dimitri Daskalakis, netdev, linux-kselftest, Dimitri Daskalakis
Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> writes:
> From: Dimitri Daskalakis <daskald@meta.com>
>
> fbnic_queue_stop() waits for every queue of the NAPI vector to go idle
> before tearing it down, using sub0.q_idx as the queue index. We set
> q_idx on submission queues for Tx, and completion queues on Rx, so
> this waits on queue 0 for every Rx queue.
>
> For non-combined channels, stopping an Rx queue always stops/wakes
> Tx queue 0.
>
> Set the queue id on Tx completion rings so we don't have to distinguish
> between ring types to get the correct queue id, and don't stop/wake
> disabled rings.
>
> This bug was found by AI and verified on HW.
The LLMs I run complained about this as well -- nice to see it verified
on HW. Also, this fix is much cleaner than what my clanker suggested!
Reviewed-by: Björn Töpel <bjorn@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 2/5] eth: fbnic: skip disabled Tx rings when setting the queue NAPI
2026-11-17 21:54 ` [PATCH net v2 2/5] eth: fbnic: skip disabled Tx rings when setting the queue NAPI Dimitri Daskalakis
@ 2026-11-18 13:15 ` Björn Töpel
0 siblings, 0 replies; 13+ messages in thread
From: Björn Töpel @ 2026-11-18 13:15 UTC (permalink / raw)
To: Dimitri Daskalakis, David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Breno Leitao, Simon Horman, Mina Almasry, Vadim Fedorenko,
Dimitri Daskalakis, netdev, linux-kselftest, Dimitri Daskalakis
Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> writes:
> From: Dimitri Daskalakis <daskald@meta.com>
>
> When Rx and Tx channels are not combined, each Rx vector gets a Tx
> triad whose sub0 is disabled with a q_idx of 0. fbnic_set_netif_napi()
> and fbnic_reset_netif_napi() don't skip it, so every Rx vector
> associates Tx queue 0 with its own NAPI, and the netlink queue info
> reports the wrong NAPI for Tx queue 0.
>
> This bug was found by AI and verified on HW.
>
> Reproduced with "ethtool -L eth0 combined 0 rx 34 tx 34", and reading
> the NAPI IDs with "ynl --family netdev --dump queue-get":
>
> before: tx 0 napi-id 580, tx 1 napi-id 514, rx 33 napi-id 580
> ^^^ rx 33's NAPI, not vector 0's
> after: tx 0 napi-id 513, tx 1 napi-id 514, rx 33 napi-id 580
>
> Fixes: cf4facfb132a ("eth: fbnic: Add support for XDP queues")
> Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 3/5] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats()
2026-11-17 21:54 ` [PATCH net v2 3/5] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() Dimitri Daskalakis
@ 2026-11-18 13:26 ` Björn Töpel
0 siblings, 0 replies; 13+ messages in thread
From: Björn Töpel @ 2026-11-18 13:26 UTC (permalink / raw)
To: Dimitri Daskalakis, David S. Miller
Cc: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
Eric Dumazet, Paolo Abeni, Shuah Khan, Mohsin Bashir,
Mike Marciniszyn (Meta), Stanislav Fomichev, Bobby Eshleman,
Breno Leitao, Simon Horman, Mina Almasry, Vadim Fedorenko,
Dimitri Daskalakis, netdev, linux-kselftest, Dimitri Daskalakis
Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> writes:
> From: Dimitri Daskalakis <daskald@meta.com>
>
> fbnic_stop() frees the NAPI vectors, which clears fbn->tx[] while
> num_tx_queues is left unchanged. fbnic_get_ts_stats() walks fbn->tx[]
> without checking for NULL, so asking for timestamping statistics while
> the interface is down dereferences a NULL ring.
>
> This was found by AI and reproduced on HW.
>
> # ip link set dev eth0 down; ethtool -I -T eth0
> BUG: kernel NULL pointer dereference, address: 0000000000000050
> RIP: 0010:fbnic_get_ts_stats+0x38/0x60
> Call Trace:
> tsinfo_prepare_data+0x82/0xb0
> ethnl_default_doit+0x213/0x470
> genl_family_rcv_msg_doit+0xdd/0x110
> ...
>
> Fixes: 96f358f75d1a ("eth: fbnic: add ethtool timestamping statistics")
> Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop()
2026-11-17 21:54 ` [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
2026-11-18 13:13 ` Björn Töpel
@ 2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-19 17:56 ` Dimitri Daskalakis
1 sibling, 1 reply; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-19 9:54 UTC (permalink / raw)
To: dimitri.daskalakis1
Cc: davem, alexanderduyck, kuba, kernel-team, andrew+netdev, edumazet,
pabeni, shuah, hmohsin, mike.marciniszyn, sdf, bobbyeshleman,
bjorn, leitao, horms, almasrymina, vadim.fedorenko, daskald,
netdev, linux-kselftest
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 (1) · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] After this patch, fbnic_queue_stop() passes
nv->qt[t].cmpl.q_idx to fbnic_wait_queue_idle().
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but
fbnic_queue_stop() stops the vector's netdev Tx queues with a bare…
--
eth: fbnic: wait on the correct queues in fbnic_queue_stop()
This patch sets q_idx on Tx completion rings. fbnic_queue_stop() now
passes cmpl.q_idx to fbnic_wait_queue_idle(), so Rx queues no longer
wait on queue 0. It also skips stop and wake of Tx rings that are
marked FBNIC_RING_F_DISABLED.
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
> index 07d4b2e923627..5efed21e59329 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
[ ... ]
> @@ -3089,13 +3092,16 @@ static int fbnic_queue_stop(struct net_device *dev, void *qmem, int idx)
> napi_disable_locked(&nv->napi);
> fbnic_nv_irq_disable(nv);
>
> - for (i = 0; i < nv->txt_count; i++)
> + for (i = 0; i < nv->txt_count; i++) {
> + if (nv->qt[i].sub0.flags & FBNIC_RING_F_DISABLED)
> + continue;
> netif_stop_subqueue(dev, nv->qt[i].sub0.q_idx);
> + }
> fbnic_nv_disable(fbn, nv);
[Severity: High]
This isn't a bug introduced by this patch, but does anything here wait
for an fbnic_xmit_frame() call that is already running on another CPU?
netif_stop_subqueue() only sets __QUEUE_STATE_DRV_XOFF. Nothing calls
__netif_tx_lock() or synchronize_net() before fbnic_nv_disable(),
fbnic_wait_queue_idle() and fbnic_nv_flush() run. Only the full-down
path in fbnic_pci.c uses netif_tx_disable().
A sender may pass the netif_xmit_frozen_or_stopped() check before the
bit is set. It can then still be inside fbnic_tx_map(), writing
tx_buf[], ring->tail and the BQL state, and ringing the doorbell.
Suppose it sets ring->tail after fbnic_nv_flush() has run:
fbnic_nv_flush()
fbnic_clean_twq0(nv, 0, &qt->sub0, true, qt->sub0.tail);
...
netdev_tx_reset_queue(tx_queue);
Is the skb and its DMA mapping then leaked once __fbnic_nv_restart()
re-enables the ring and fbnic_enable_twq0() resets head/tail to 0? BQL
would also keep in-flight bytes that never complete, and that can
stall the Tx queue.
Now suppose the sender is delayed until after fbnic_enable_twq0() has
done this:
twq->tail = 0;
twq->head = 0;
It would then write a stale ring->tail and ring the doorbell, and the
hardware would fetch old descriptors whose buffers are already
unmapped. Could those completions make fbnic_clean_twq0() read a NULL
ring->tx_buf[] entry and dereference FBNIC_XMIT_CB(skb)->desc_count on
it?
To hit this, a queue restart (netdev bind-rx devmem, io_uring zcrx) has
to run on an Rx queue whose NAPI vector also serves a combined Tx queue,
while another CPU is sending on that Tx queue.
>
> for (t = 0; t < nv->txt_count + nv->rxt_count; t++) {
> err = fbnic_wait_queue_idle(fbn, t >= nv->txt_count,
> - nv->qt[t].sub0.q_idx);
> + nv->qt[t].cmpl.q_idx);
[Severity: Medium]
On an Rx-only vector the Tx triad has sub0 disabled and carries only the
XDP TWQ1 ring, so this call becomes fbnic_wait_queue_idle(fbn, false,
txq_idx). Does fbnic_wait_queue_idle() actually cover TWQ1 of that
queue?
It builds a single bit from the queue index and tests that bit in all
four Tx idle arrays:
fbnic_wait_queue_idle() {
...
off = idx / 32;
mask = BIT(idx % 32);
...
}
The TWQ, TQS and TDE idle arrays are twice as wide as the TCQ one:
#define FBNIC_QM_TWQ_IDLE_CNT 8
#define FBNIC_QM_TCQ_IDLE_CNT 4
#define FBNIC_QM_TQS_IDLE_CNT 8
#define FBNIC_QM_TDE_IDLE_CNT 8
There are 128 queues with two work queues each (TWQ0 and TWQ1), so this
looks like one bit per TWQ. fbnic_wait_all_queues_idle() reads all 8
registers, but fbnic_wait_queue_idle() only reads registers 0 to 3.
If bit idx maps to TWQ0, it is always idle here, because TWQ0 is
FBNIC_RING_F_DISABLED on this triad. The TWQ1 ring that carries XDP_TX
traffic would then never be polled.
Next, fbnic_queue_stop() calls fbnic_nv_flush(), which runs
fbnic_clean_twq1() and unmaps the XDP buffers. Could the hardware still
be fetching TWQ1 descriptors at that point?
The bit layout isn't documented in-tree, so the answer depends on the
hardware. The commit message gives "fbnic_wait_queue_idle(tx, 39)" as
the wait on the vector's XDP Tx queue. Is that wait enough to cover
TWQ1?
> if (err)
> goto err_restart;
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117215416.1901246-1-dimitri.daskalakis1%40gmail.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down
2026-11-17 21:54 ` [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down Dimitri Daskalakis
@ 2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-19 17:56 ` Dimitri Daskalakis
0 siblings, 1 reply; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-11-19 9:54 UTC (permalink / raw)
To: dimitri.daskalakis1
Cc: davem, alexanderduyck, kuba, kernel-team, andrew+netdev, edumazet,
pabeni, shuah, hmohsin, mike.marciniszyn, sdf, bobbyeshleman,
bjorn, leitao, horms, almasrymina, vadim.fedorenko, daskald,
netdev, linux-kselftest
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In check_down_ts_stats()
(tools/testing/selftests/drivers/net/stats.py), if a counter present…
--
selftests: drv-net: stats: query timestamping stats while down
This patch adds check_down_ts_stats() to the drv-net stats selftest. The
test reads timestamping stats over ethtool netlink before and after taking
the link down. It then checks that no counter went backwards.
> diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py
> index b08e4d48b15ce..e61db30b51817 100755
> --- a/tools/testing/selftests/drivers/net/stats.py
> +++ b/tools/testing/selftests/drivers/net/stats.py
> @@ -220,6 +220,28 @@ def check_down(cfg) -> None:
[ ... ]
> + ip(f"link set dev {cfg.dev['ifname']} down")
> + defer(ip, f"link set dev {cfg.dev['ifname']} up")
> +
> + stats2 = ethnl.tsinfo_get(req).get("stats", {})
> + for k in stats:
> + ksft_ge(stats2[k], stats[k], comment=f"{k} went backwards on device down")
[Severity: Low]
What happens here if a counter that was reported while the link was up is
missing from the reply after ifdown?
The kernel only puts counters in the reply when the driver filled them in.
tsinfo_prepare_data() resets every counter on each query:
net/ethtool/tsinfo.c:tsinfo_prepare_data() {
...
ethtool_stats_init((u64 *)&data->stats,
sizeof(data->stats) / sizeof(u64));
...
}
Then tsinfo_put_stat() skips any counter that is still unset:
net/ethtool/tsinfo.c:tsinfo_put_stat() {
if (val == ETHTOOL_STAT_NOT_SET)
return 0;
...
}
So the second reply can contain fewer keys than the first. When that
happens, stats2[k] raises KeyError before ksft_ge() runs.
This already happens with wangxun ngbe/txgbe. On ifdown, ngbe_close() and
txgbe_close() call wx_ptp_stop(), which does:
if (wx->ptp_clock) {
ptp_clock_unregister(wx->ptp_clock);
wx->ptp_clock = NULL;
...
}
After that, wx_get_ptp_stats() fills nothing while the link is down:
if (wx->ptp_clock) {
ts_stats->pkts = wx->tx_hwtstamp_pkts;
...
}
ksft_run() catches the KeyError and still marks the test as failed. The
output is a Python traceback, though, and not the "went backwards on device
down" message.
Would it be better to check that the key is present first, for example
with ksft_in(k, stats2, ...), before calling ksft_ge()?
Also, when ETHTOOL_FLAG_STATS is set, tsinfo_fill_reply()->tsinfo_put_stats()
always adds the stats nest to the reply. The {} default in
.get("stats", {}) therefore never takes effect, and it can be dropped.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117215416.1901246-1-dimitri.daskalakis1%40gmail.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop()
2026-11-19 9:54 ` netdev-bot+sashiko
@ 2026-11-19 17:56 ` Dimitri Daskalakis
0 siblings, 0 replies; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-19 17:56 UTC (permalink / raw)
To: netdev-bot+sashiko
Cc: davem, alexanderduyck, kuba, kernel-team, andrew+netdev, edumazet,
pabeni, shuah, hmohsin, mike.marciniszyn, sdf, bobbyeshleman,
bjorn, leitao, horms, almasrymina, vadim.fedorenko, daskald,
netdev, linux-kselftest
On 11/19/26 1:54 AM, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 (1) · Medium: 1 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] After this patch, fbnic_queue_stop() passes
> nv->qt[t].cmpl.q_idx to fbnic_wait_queue_idle().
>
> Pre-existing issues:
> - [High] This problem wasn't introduced by this patch, but
> fbnic_queue_stop() stops the vector's netdev Tx queues with a bare…
>
> --
>
> eth: fbnic: wait on the correct queues in fbnic_queue_stop()
>
> This patch sets q_idx on Tx completion rings. fbnic_queue_stop() now
> passes cmpl.q_idx to fbnic_wait_queue_idle(), so Rx queues no longer
> wait on queue 0. It also skips stop and wake of Tx rings that are
> marked FBNIC_RING_F_DISABLED.
>
>> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
>> index 07d4b2e923627..5efed21e59329 100644
>> --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
>> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
>
> [ ... ]
>
>> @@ -3089,13 +3092,16 @@ static int fbnic_queue_stop(struct net_device *dev, void *qmem, int idx)
>> napi_disable_locked(&nv->napi);
>> fbnic_nv_irq_disable(nv);
>>
>> - for (i = 0; i < nv->txt_count; i++)
>> + for (i = 0; i < nv->txt_count; i++) {
>> + if (nv->qt[i].sub0.flags & FBNIC_RING_F_DISABLED)
>> + continue;
>> netif_stop_subqueue(dev, nv->qt[i].sub0.q_idx);
>> + }
>> fbnic_nv_disable(fbn, nv);
>
> [Severity: High]
> This isn't a bug introduced by this patch, but does anything here wait
> for an fbnic_xmit_frame() call that is already running on another CPU?
>
> netif_stop_subqueue() only sets __QUEUE_STATE_DRV_XOFF. Nothing calls
> __netif_tx_lock() or synchronize_net() before fbnic_nv_disable(),
> fbnic_wait_queue_idle() and fbnic_nv_flush() run. Only the full-down
> path in fbnic_pci.c uses netif_tx_disable().
>
> A sender may pass the netif_xmit_frozen_or_stopped() check before the
> bit is set. It can then still be inside fbnic_tx_map(), writing
> tx_buf[], ring->tail and the BQL state, and ringing the doorbell.
>
> Suppose it sets ring->tail after fbnic_nv_flush() has run:
>
> fbnic_nv_flush()
> fbnic_clean_twq0(nv, 0, &qt->sub0, true, qt->sub0.tail);
> ...
> netdev_tx_reset_queue(tx_queue);
>
> Is the skb and its DMA mapping then leaked once __fbnic_nv_restart()
> re-enables the ring and fbnic_enable_twq0() resets head/tail to 0? BQL
> would also keep in-flight bytes that never complete, and that can
> stall the Tx queue.
>
> Now suppose the sender is delayed until after fbnic_enable_twq0() has
> done this:
>
> twq->tail = 0;
> twq->head = 0;
>
> It would then write a stale ring->tail and ring the doorbell, and the
> hardware would fetch old descriptors whose buffers are already
> unmapped. Could those completions make fbnic_clean_twq0() read a NULL
> ring->tx_buf[] entry and dereference FBNIC_XMIT_CB(skb)->desc_count on
> it?
>
> To hit this, a queue restart (netdev bind-rx devmem, io_uring zcrx) has
> to run on an Rx queue whose NAPI vector also serves a combined Tx queue,
> while another CPU is sending on that Tx queue.
>
>>
>> for (t = 0; t < nv->txt_count + nv->rxt_count; t++) {
>> err = fbnic_wait_queue_idle(fbn, t >= nv->txt_count,
>> - nv->qt[t].sub0.q_idx);
>> + nv->qt[t].cmpl.q_idx);
>
This finding looks legit. I'd prefer to submit a fix for this separately,
and I can try to repro on HW in the meantime.
> [Severity: Medium]
> On an Rx-only vector the Tx triad has sub0 disabled and carries only the
> XDP TWQ1 ring, so this call becomes fbnic_wait_queue_idle(fbn, false,
> txq_idx). Does fbnic_wait_queue_idle() actually cover TWQ1 of that
> queue?
>
> It builds a single bit from the queue index and tests that bit in all
> four Tx idle arrays:
>
> fbnic_wait_queue_idle() {
> ...
> off = idx / 32;
> mask = BIT(idx % 32);
> ...
> }
>
> The TWQ, TQS and TDE idle arrays are twice as wide as the TCQ one:
>
> #define FBNIC_QM_TWQ_IDLE_CNT 8
> #define FBNIC_QM_TCQ_IDLE_CNT 4
> #define FBNIC_QM_TQS_IDLE_CNT 8
> #define FBNIC_QM_TDE_IDLE_CNT 8
>
> There are 128 queues with two work queues each (TWQ0 and TWQ1), so this
> looks like one bit per TWQ. fbnic_wait_all_queues_idle() reads all 8
> registers, but fbnic_wait_queue_idle() only reads registers 0 to 3.
>
> If bit idx maps to TWQ0, it is always idle here, because TWQ0 is
> FBNIC_RING_F_DISABLED on this triad. The TWQ1 ring that carries XDP_TX
> traffic would then never be polled.
>
> Next, fbnic_queue_stop() calls fbnic_nv_flush(), which runs
> fbnic_clean_twq1() and unmaps the XDP buffers. Could the hardware still
> be fetching TWQ1 descriptors at that point?
>
> The bit layout isn't documented in-tree, so the answer depends on the
> hardware. The commit message gives "fbnic_wait_queue_idle(tx, 39)" as
> the wait on the vector's XDP Tx queue. Is that wait enough to cover
> TWQ1?
>
>> if (err)
>> goto err_restart;
>> }
>
This also looks legit, and I can submit a fix in a subsequent series.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down
2026-11-19 9:54 ` netdev-bot+sashiko
@ 2026-11-19 17:56 ` Dimitri Daskalakis
0 siblings, 0 replies; 13+ messages in thread
From: Dimitri Daskalakis @ 2026-11-19 17:56 UTC (permalink / raw)
To: netdev-bot+sashiko
Cc: davem, alexanderduyck, kuba, kernel-team, andrew+netdev, edumazet,
pabeni, shuah, hmohsin, mike.marciniszyn, sdf, bobbyeshleman,
bjorn, leitao, horms, almasrymina, vadim.fedorenko, daskald,
netdev, linux-kselftest
On 11/19/26 1:54 AM, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
>
> Low priority / nit picks for your consideration:
>
> - [Low] In check_down_ts_stats()
> (tools/testing/selftests/drivers/net/stats.py), if a counter present…
>
> --
>
> selftests: drv-net: stats: query timestamping stats while down
>
> This patch adds check_down_ts_stats() to the drv-net stats selftest. The
> test reads timestamping stats over ethtool netlink before and after taking
> the link down. It then checks that no counter went backwards.
>
>> diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py
>> index b08e4d48b15ce..e61db30b51817 100755
>> --- a/tools/testing/selftests/drivers/net/stats.py
>> +++ b/tools/testing/selftests/drivers/net/stats.py
>> @@ -220,6 +220,28 @@ def check_down(cfg) -> None:
>
> [ ... ]
>
>> + ip(f"link set dev {cfg.dev['ifname']} down")
>> + defer(ip, f"link set dev {cfg.dev['ifname']} up")
>> +
>> + stats2 = ethnl.tsinfo_get(req).get("stats", {})
>> + for k in stats:
>> + ksft_ge(stats2[k], stats[k], comment=f"{k} went backwards on device down")
>
> [Severity: Low]
> What happens here if a counter that was reported while the link was up is
> missing from the reply after ifdown?
>
> The kernel only puts counters in the reply when the driver filled them in.
> tsinfo_prepare_data() resets every counter on each query:
>
> net/ethtool/tsinfo.c:tsinfo_prepare_data() {
> ...
> ethtool_stats_init((u64 *)&data->stats,
> sizeof(data->stats) / sizeof(u64));
> ...
> }
>
> Then tsinfo_put_stat() skips any counter that is still unset:
>
> net/ethtool/tsinfo.c:tsinfo_put_stat() {
> if (val == ETHTOOL_STAT_NOT_SET)
> return 0;
> ...
> }
>
> So the second reply can contain fewer keys than the first. When that
> happens, stats2[k] raises KeyError before ksft_ge() runs.
>
> This already happens with wangxun ngbe/txgbe. On ifdown, ngbe_close() and
> txgbe_close() call wx_ptp_stop(), which does:
>
> if (wx->ptp_clock) {
> ptp_clock_unregister(wx->ptp_clock);
> wx->ptp_clock = NULL;
> ...
> }
>
> After that, wx_get_ptp_stats() fills nothing while the link is down:
>
> if (wx->ptp_clock) {
> ts_stats->pkts = wx->tx_hwtstamp_pkts;
> ...
> }
>
> ksft_run() catches the KeyError and still marks the test as failed. The
> output is a Python traceback, though, and not the "went backwards on device
> down" message.
>
> Would it be better to check that the key is present first, for example
> with ksft_in(k, stats2, ...), before calling ksft_ge()?
>
> Also, when ETHTOOL_FLAG_STATS is set, tsinfo_fill_reply()->tsinfo_put_stats()
> always adds the stats nest to the reply. The {} default in
> .get("stats", {}) therefore never takes effect, and it can be dropped.
>
The preference is for the test to fail, as this is unexpected behavior.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-11-19 17:56 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 21:54 [PATCH net v2 0/5] eth: fbnic: miscellaneous driver fixes Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 1/5] eth: fbnic: wait on the correct queues in fbnic_queue_stop() Dimitri Daskalakis
2026-11-18 13:13 ` Björn Töpel
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-19 17:56 ` Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 2/5] eth: fbnic: skip disabled Tx rings when setting the queue NAPI Dimitri Daskalakis
2026-11-18 13:15 ` Björn Töpel
2026-11-17 21:54 ` [PATCH net v2 3/5] eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() Dimitri Daskalakis
2026-11-18 13:26 ` Björn Töpel
2026-11-17 21:54 ` [PATCH net v2 4/5] netdevsim: report fake timestamping stats Dimitri Daskalakis
2026-11-17 21:54 ` [PATCH net v2 5/5] selftests: drv-net: stats: query timestamping stats while down Dimitri Daskalakis
2026-11-19 9:54 ` netdev-bot+sashiko
2026-11-19 17:56 ` Dimitri Daskalakis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox