linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/4] Support bandwidth clamping in mana using net shapers
@ 2025-06-13 11:20 Erni Sri Satya Vennela
  2025-06-13 11:20 ` [PATCH net-next v2 1/4] net: mana: Fix potential deadlocks in mana napi ops Erni Sri Satya Vennela
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Erni Sri Satya Vennela @ 2025-06-13 11:20 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	kuba, pabeni, longli, kotaranov, horms, shirazsaleem, leon, ernis,
	shradhagupta, schakrabarti, gerhard, rosenp, sdf, linux-hyperv,
	netdev, linux-kernel, linux-rdma

This patchset introduces hardware-backed bandwidth rate limiting
for MANA NICs via the net_shaper_ops interface, enabling efficient and
fine-grained traffic shaping directly on the device.

Previously, MANA lacked a mechanism for user-configurable bandwidth
control. With this addition, users can now configure shaping parameters,
allowing better traffic management and performance isolation.

The implementation includes the net_shaper_ops callbacks in the MANA
driver and supports one shaper per vport. Add shaping support via
mana_set_bw_clamp(), allowing the configuration of bandwidth rates
in 100 Mbps increments (minimum 100 Mbps). The driver validates input
and rejects unsupported values. On failure, it restores the previous
configuration which is queried using mana_query_link_cfg() or
retains the current state.

To prevent potential deadlocks introduced by net_shaper_ops, switch to
_locked variants of NAPI APIs when netdevops_lock is held during
VF setup and teardown.

Also, Add support for ethtool get_link_ksettings to report the maximum
link speed supported by the SKU in mbps.

These APIs when invoked on hardware that are older or that do
not support these APIs, the speed would be reported as UNKNOWN and
the net-shaper calls to set speed would fail.
---
Changes in v2:
* Rebase to latest net-next branch.
* Edit commit message in 
  "net: mana: Fix potential deadlocks in mana napi ops".
* Use netdev_lock_ops_to_full() instead of explicit if..else statements
  for napi APIs.
* Define GDMA_STATUS_CMD_UNSUPPORTED for unsupported HWC status code.
---
Erni Sri Satya Vennela (4):
  net: mana: Fix potential deadlocks in mana napi ops
  net: mana: Add support for net_shaper_ops
  net: mana: Add speed support in mana_get_link_ksettings
  net: mana: Handle unsupported HWC commands

 .../net/ethernet/microsoft/mana/hw_channel.c  |   4 +
 drivers/net/ethernet/microsoft/mana/mana_en.c | 197 +++++++++++++++++-
 .../ethernet/microsoft/mana/mana_ethtool.c    |   6 +
 include/net/mana/gdma.h                       |   1 +
 include/net/mana/mana.h                       |  42 ++++
 5 files changed, 241 insertions(+), 9 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-06-17  6:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 11:20 [PATCH net-next v2 0/4] Support bandwidth clamping in mana using net shapers Erni Sri Satya Vennela
2025-06-13 11:20 ` [PATCH net-next v2 1/4] net: mana: Fix potential deadlocks in mana napi ops Erni Sri Satya Vennela
2025-06-13 17:01   ` Long Li
2025-06-13 11:20 ` [PATCH net-next v2 2/4] net: mana: Add support for net_shaper_ops Erni Sri Satya Vennela
2025-06-13 17:04   ` Long Li
2025-06-13 11:20 ` [PATCH net-next v2 3/4] net: mana: Add speed support in mana_get_link_ksettings Erni Sri Satya Vennela
2025-06-13 11:20 ` [PATCH net-next v2 4/4] net: mana: Handle unsupported HWC commands Erni Sri Satya Vennela
2025-06-14 20:03 ` [PATCH net-next v2 0/4] Support bandwidth clamping in mana using net shapers Jakub Kicinski
2025-06-17  6:16   ` Erni Sri Satya Vennela

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