aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igc/igc_main.c
diff options
context:
space:
mode:
authorArmen Ratner <[email protected]>2025-08-20 13:32:09 +0000
committerJakub Kicinski <[email protected]>2025-08-21 14:58:33 +0000
commit8b0587a885fdb34fd6090a3f8625cb7ac1444826 (patch)
tree667781d1fa2b1af2c0deb738c41baa56acf903c8 /drivers/net/ethernet/intel/igc/igc_main.c
parentnet/mlx5e: Query FW for buffer ownership (diff)
downloadkernel-8b0587a885fdb34fd6090a3f8625cb7ac1444826.tar.gz
kernel-8b0587a885fdb34fd6090a3f8625cb7ac1444826.zip
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: a440030d8946 ("net/mlx5e: Update shared buffer along with device buffer changes") Signed-off-by: Armen Ratner <[email protected]> Signed-off-by: Maher Sanalla <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Alexei Lazar <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
0 files changed, 0 insertions, 0 deletions