linux/drivers/net
Armen Ratner 8b0587a885 net/mlx5e: Preserve shared buffer capacity during headroom updates
When port buffer headroom changes, port_update_shared_buffer()
recalculates the shared buffer size and splits it in a 3:1 ratio
(lossy:lossless) - Currently, the calculation is:
lossless = shared / 4;
lossy = (shared / 4) * 3;

Meaning, the calculation dropped the remainder of shared % 4 due to
integer division, unintentionally reducing the total shared buffer
by up to three cells on each update. Over time, this could shrink
the buffer below usable size.

Fix it by changing the calculation to:
lossless = shared / 4;
lossy = shared - lossless;

This retains all buffer cells while still approximating the
intended 3:1 split, preventing capacity loss over time.

While at it, perform headroom calculations in units of cells rather than
in bytes for more accurate calculations avoiding extra divisions.

Fixes: a440030d89 ("net/mlx5e: Update shared buffer along with device buffer changes")
Signed-off-by: Armen Ratner <armeng@nvidia.com>
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Alexei Lazar <alazar@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://patch.msgid.link/20250820133209.389065-9-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-21 07:58:33 -07:00
..
arcnet
bonding bonding: send LACPDUs periodically in passive mode after receiving partner's LACPDU 2025-08-21 09:35:20 +02:00
caif
can treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
dsa net: dsa: microchip: Fix KSZ9477 HSR port setup issue 2025-08-20 19:25:38 -07:00
ethernet net/mlx5e: Preserve shared buffer capacity during headroom updates 2025-08-21 07:58:33 -07:00
fddi
fjes
hamradio hamradio: ignore ops-locked netdevs 2025-08-08 13:22:28 -07:00
hippi
hyperv hv_netvsc: Fix panic during namespace deletion with VF 2025-08-08 13:24:16 -07:00
ieee802154
ipa ipa: fix compile-testing with qcom-mdt=m 2025-08-04 17:15:15 -07:00
ipvlan net: s/dev_pre_changeaddr_notify/netif_pre_changeaddr_notify/ 2025-07-18 17:27:47 -07:00
mctp
mdio net: mdio: mdio-bcm-unimac: Correct rate fallback logic 2025-08-01 14:46:50 -07:00
netdevsim netdevsim: Fix wild pointer access in nsim_queue_free(). 2025-08-13 17:26:39 -07:00
ovpn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07:00
pcs net: pcs: xpcs: mask readl() return value to 16 bits 2025-07-17 18:45:27 -07:00
phy phy: mscc: Fix timestamping for vsc8584 2025-08-19 17:52:02 -07:00
plip
ppp ppp: fix race conditions in ppp_fill_forward_path 2025-08-19 11:25:32 +02:00
pse-pd net: pse-pd: pd692x0: Skip power budget configuration when undefined 2025-08-21 07:56:08 -07:00
slip
team
thunderbolt net: thunderbolt: Enable end-to-end flow control also in transmit 2025-07-02 14:17:43 -07:00
usb net: usb: asix_devices: Fix PHY address mask in MDIO bus initialization 2025-08-19 17:52:29 -07:00
vmxnet3
vxlan vxlan: remove redundant conversion of vni in vxlan_nl2conf 2025-07-23 17:09:29 -07:00
wan net: lapbether: ignore ops-locked netdevs 2025-08-08 13:22:28 -07:00
wireguard wireguard: peer: Replace sockaddr with sockaddr_inet 2025-07-25 15:29:58 -07:00
wireless Networking changes for 6.17. 2025-07-30 08:58:55 -07:00
wwan relayfs: abolish prev_padding 2025-07-09 22:57:51 -07:00
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c net: ifb: support BIG TCP packets 2025-07-02 14:46:19 -07:00
loopback.c
macsec.c macsec: set IFF_UNICAST_FLT priv flag 2025-07-25 11:03:46 -07:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
netkit.c netkit: Remove location field in netkit_link 2025-07-11 11:01:09 -07:00
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c
sungem_phy.c
tap.c net: s/dev_get_mac_address/netif_get_mac_address/ 2025-07-18 17:27:46 -07:00
tun.c net: s/dev_get_mac_address/netif_get_mac_address/ 2025-07-18 17:27:46 -07:00
tun_vnet.h tun: enable gso over UDP tunnel support. 2025-07-08 18:07:26 +02:00
veth.c
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-07-17 11:00:33 -07:00
vrf.c vrf: Drop existing dst reference in vrf_ip6_input_dst 2025-07-26 11:28:45 -07:00
vsockmon.c
xen-netfront.c xen/netfront: Fix TX response spurious interrupts 2025-07-23 13:11:03 +02:00