Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'mlx5e-misc-fixes-2025-11-09'

Tariq Toukan says:

====================
mlx5e misc fixes 2025-11-09

This patchset provides misc bug fixes from the team to the mlx5 Eth
driver.
====================

Link: https://patch.msgid.link/1762681073-1084058-1-git-send-email-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+31 -7
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
··· 541 541 max_num_channels = mlx5e_get_max_num_channels(mdev); 542 542 if (val32 > max_num_channels) { 543 543 NL_SET_ERR_MSG_FMT_MOD(extack, 544 - "Requested num_doorbells (%u) exceeds maximum number of channels (%u)", 544 + "Requested num_doorbells (%u) exceeds max number of channels (%u)", 545 545 val32, max_num_channels); 546 546 return -EINVAL; 547 547 }
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
··· 804 804 goto err_xfrm; 805 805 } 806 806 807 - if (mlx5_eswitch_block_mode(priv->mdev)) 807 + err = mlx5_eswitch_block_mode(priv->mdev); 808 + if (err) 808 809 goto unblock_ipsec; 809 810 810 811 if (x->props.mode == XFRM_MODE_TUNNEL &&
+28 -5
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
··· 595 595 struct mlx5_core_dev *mdev = priv->mdev; 596 596 u8 max_bw_value[IEEE_8021QAZ_MAX_TCS]; 597 597 u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS]; 598 - __u64 upper_limit_mbps = roundup(255 * MLX5E_100MB, MLX5E_1GB); 598 + __u64 upper_limit_mbps; 599 + __u64 upper_limit_gbps; 599 600 int i; 601 + struct { 602 + int scale; 603 + const char *units_str; 604 + } units[] = { 605 + [MLX5_100_MBPS_UNIT] = { 606 + .scale = 100, 607 + .units_str = "Mbps", 608 + }, 609 + [MLX5_GBPS_UNIT] = { 610 + .scale = 1, 611 + .units_str = "Gbps", 612 + }, 613 + }; 600 614 601 615 memset(max_bw_value, 0, sizeof(max_bw_value)); 602 616 memset(max_bw_unit, 0, sizeof(max_bw_unit)); 617 + upper_limit_mbps = 255 * MLX5E_100MB; 618 + upper_limit_gbps = 255 * MLX5E_1GB; 603 619 604 620 for (i = 0; i <= mlx5_max_tc(mdev); i++) { 605 621 if (!maxrate->tc_maxrate[i]) { 606 622 max_bw_unit[i] = MLX5_BW_NO_LIMIT; 607 623 continue; 608 624 } 609 - if (maxrate->tc_maxrate[i] < upper_limit_mbps) { 625 + if (maxrate->tc_maxrate[i] <= upper_limit_mbps) { 610 626 max_bw_value[i] = div_u64(maxrate->tc_maxrate[i], 611 627 MLX5E_100MB); 612 628 max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] : 1; 613 629 max_bw_unit[i] = MLX5_100_MBPS_UNIT; 614 - } else { 630 + } else if (max_bw_value[i] <= upper_limit_gbps) { 615 631 max_bw_value[i] = div_u64(maxrate->tc_maxrate[i], 616 632 MLX5E_1GB); 617 633 max_bw_unit[i] = MLX5_GBPS_UNIT; 634 + } else { 635 + netdev_err(netdev, 636 + "tc_%d maxrate %llu Kbps exceeds limit %llu\n", 637 + i, maxrate->tc_maxrate[i], 638 + upper_limit_gbps); 639 + return -EINVAL; 618 640 } 619 641 } 620 642 621 643 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 622 - netdev_dbg(netdev, "%s: tc_%d <=> max_bw %d Gbps\n", 623 - __func__, i, max_bw_value[i]); 644 + netdev_dbg(netdev, "%s: tc_%d <=> max_bw %u %s\n", __func__, i, 645 + max_bw_value[i] * units[max_bw_unit[i]].scale, 646 + units[max_bw_unit[i]].units_str); 624 647 } 625 648 626 649 return mlx5_modify_port_ets_rate_limit(mdev, max_bw_value, max_bw_unit);