netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next resubmit 0/2] ibmvnic: Fix/Improve queue stats
@ 2025-07-14 17:35 Mingming Cao
  2025-07-14 17:35 ` [PATCH v3 net-next 1/2] ibmvnic: Use atomic64_t for " Mingming Cao
  2025-07-14 17:35 ` [PATCH v3 net-next 2/2] ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting Mingming Cao
  0 siblings, 2 replies; 7+ messages in thread
From: Mingming Cao @ 2025-07-14 17:35 UTC (permalink / raw)
  To: netdev; +Cc: kuba, horms, bjking1, haren, ricklind, davemarq, mmc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=true, Size: 2545 bytes --]

This series is resubmitted after the bug fix for hardcoded 
`NUM_RX_STATS` and `NUM_TX_STATS` has already been included in the `net-next` tree.

This patch series introduces two updates to the ibmvnic driver, 
focusing on improving the accuracy and safety of queue-level statistics.

Patch 1: Convert per-queue RX/TX stats to atomic64_t to ensure thread-safe 
updates in concurrent environments. This establishes a safe and consistent 
foundation for subsequent statistics-related fixes. 

Patch 2: Fix inaccurate sar statistics by implementing ndo_get_stats64() and 
removing the outdated manual updates to netdev->stats. This patch also improves
packets rates and bandwith with large workload.


--------------------------------------

Changes since v2:
link to v2: https://www.spinics.net/lists/netdev/msg1104665.html

- Dropped Patch 2 from v2, which fixed the hardcoded `NUM_RX_STATS` and `NUM_TX_STATS`,
 as suggested by Simon. https://www.spinics.net/lists/netdev/msg1106669.html included
 in net-next
- Updated Patch 1 in v2 to rebase on top of the above fix in `net`.
– Patch 3 in v2 (now patch 2) unchanged.
- Dropped Patch 4 from v2, which raised the default number of indirect sub-CRQ entries 
and introduced a module parameter for backward compatibility. Based on review feedback, 
plan to explore alternative ways to handle older systems without adding a module parameter.

---

Changes since v1:
 Link to v1: https://www.spinics.net/lists/netdev/msg1103893.html

Patch 1 (was Patch 2 in v1): Introduces atomic64_t stats early to establish 
a consistent foundation. Replaces atomic64_sub() with atomic64_sub_return() 
and adds a warning for underflow. This change now comes first to ensure correct
 ordering of dependency with stat size derivation.

Patch 2 (was Patch 1 in v1): Commit message rewritten to clearly highlight the 
mismatch bug caused by static stat counts and rebased on top of the atomic64 
conversion to avoid broken logic during intermediate states.

Patch 3: No functional changes

Patch 4: Commit message clarified to explain the use of 128 indirect entries 
on POWER9+ systems and the intent of the module parameter as a transitional 
fallback for legacy or constrained systems.

Mingming Cao (2):
  ibmvnic: Use atomic64_t for queue stats
  ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting

 drivers/net/ethernet/ibm/ibmvnic.c | 71 +++++++++++++++++++-----------
 drivers/net/ethernet/ibm/ibmvnic.h | 18 ++++----
 2 files changed, 55 insertions(+), 34 deletions(-)

-- 
2.39.3 (Apple Git-146)


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH v3 net-next 0/2] ibmvnic: Fix/Improve queue stats
@ 2025-07-09 18:40 Mingming Cao
  2025-07-09 18:40 ` [PATCH v3 net-next 2/2] ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting Mingming Cao
  0 siblings, 1 reply; 7+ messages in thread
From: Mingming Cao @ 2025-07-09 18:40 UTC (permalink / raw)
  To: netdev; +Cc: kuba, horms, bjking1, haren, ricklind, davemarq, mmc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=true, Size: 2462 bytes --]

This patch series introduces two updates to the ibmvnic driver, 
focusing on improving the accuracy and safety of queue-level statistics.

Patch 1: Convert per-queue RX/TX stats to atomic64_t to ensure thread-safe 
updates in concurrent environments. This establishes a safe and consistent 
foundation for subsequent statistics-related fixes. 

Patch 2: Fix inaccurate sar statistics by implementing ndo_get_stats64() and 
removing the outdated manual updates to netdev->stats.

This series is intended for `net-next` and assumes the bug fix for hardcoded 
`NUM_RX_STATS` and `NUM_TX_STATS` has already been included in the `net` tree.

--------------------------------------

Changes since v2:
link to v2: https://www.spinics.net/lists/netdev/msg1104665.html

- Dropped Patch 2 from v2, which fixed the hardcoded `NUM_RX_STATS` and `NUM_TX_STATS`,
 as suggested by Simon. https://www.spinics.net/lists/netdev/msg1106669.html
- Updated Patch 1 in v2 to rebase on top of the above fix in `net`.
– Patch 3 in v2 (now patch 2) unchanged.
- Dropped Patch 4 from v2, which raised the default number of indirect sub-CRQ entries 
and introduced a module parameter for backward compatibility. Based on review feedback, 
plan to explore alternative ways to handle older systems without adding a module parameter.

---

Changes since v1:
 Link to v1: https://www.spinics.net/lists/netdev/msg1103893.html

Patch 1 (was Patch 2 in v1): Introduces atomic64_t stats early to establish 
a consistent foundation. Replaces atomic64_sub() with atomic64_sub_return() 
and adds a warning for underflow. This change now comes first to ensure correct
 ordering of dependency with stat size derivation.

Patch 2 (was Patch 1 in v1): Commit message rewritten to clearly highlight the 
mismatch bug caused by static stat counts and rebased on top of the atomic64 
conversion to avoid broken logic during intermediate states.

Patch 3: No functional changes

Patch 4: Commit message clarified to explain the use of 128 indirect entries 
on POWER9+ systems and the intent of the module parameter as a transitional 
fallback for legacy or constrained systems.

Mingming Cao (2):
  ibmvnic: Use atomic64_t for queue stats
  ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting

 drivers/net/ethernet/ibm/ibmvnic.c | 71 +++++++++++++++++++-----------
 drivers/net/ethernet/ibm/ibmvnic.h | 18 ++++----
 2 files changed, 55 insertions(+), 34 deletions(-)

-- 
2.39.3 (Apple Git-146)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-16  0:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 17:35 [PATCH v3 net-next resubmit 0/2] ibmvnic: Fix/Improve queue stats Mingming Cao
2025-07-14 17:35 ` [PATCH v3 net-next 1/2] ibmvnic: Use atomic64_t for " Mingming Cao
2025-07-15 13:21   ` Simon Horman
2025-07-16  0:14   ` Jakub Kicinski
2025-07-14 17:35 ` [PATCH v3 net-next 2/2] ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting Mingming Cao
2025-07-15 13:22   ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2025-07-09 18:40 [PATCH v3 net-next 0/2] ibmvnic: Fix/Improve queue stats Mingming Cao
2025-07-09 18:40 ` [PATCH v3 net-next 2/2] ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting Mingming Cao

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).