git: 816f27e848e5 - main - mlx5en: control hw LRO with the driver conf sysctl, leaving IFCAP_LRO to sw
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 13 Mar 2025 16:03:11 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=816f27e848e549e6ff895affc29298f68e0bb644
commit 816f27e848e549e6ff895affc29298f68e0bb644
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-01-28 20:38:21 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-03-13 15:58:12 +0000
mlx5en: control hw LRO with the driver conf sysctl, leaving IFCAP_LRO to sw
Reviewed by: Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by: NVidia networking
MFC after: 1 week
---
sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c | 10 +---------
sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 24 ++----------------------
2 files changed, 3 insertions(+), 31 deletions(-)
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
index 6a2c07addc62..459801cdf27d 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
@@ -1124,16 +1124,8 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS)
/* import HW LRO mode */
if (priv->params_ethtool.hw_lro != 0 &&
MLX5_CAP_ETH(priv->mdev, lro_cap)) {
+ priv->params.hw_lro_en = true;
priv->params_ethtool.hw_lro = 1;
- /* check if feature should actually be enabled */
- if (if_getcapenable(priv->ifp) & IFCAP_LRO) {
- priv->params.hw_lro_en = true;
- } else {
- priv->params.hw_lro_en = false;
-
- mlx5_en_warn(priv->ifp, "To enable HW LRO "
- "please also enable LRO via ifconfig(8).\n");
- }
} else {
/* return an error if HW does not support this feature */
if (priv->params_ethtool.hw_lro != 0)
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index c17da50c1a5e..67583afc21c7 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -3670,31 +3670,11 @@ siocsifcap_driver:
}
VLAN_CAPABILITIES(ifp);
- /* turn off LRO means also turn of HW LRO - if it's on */
- if (mask & IFCAP_LRO) {
- int was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
- bool need_restart = false;
+ /* hw_lro and IFCAP_LRO are divorsed, only toggle sw LRO. */
+ if (mask & IFCAP_LRO)
if_togglecapenable(ifp, IFCAP_LRO);
- /* figure out if updating HW LRO is needed */
- if (!(if_getcapenable(ifp) & IFCAP_LRO)) {
- if (priv->params.hw_lro_en) {
- priv->params.hw_lro_en = false;
- need_restart = true;
- }
- } else {
- if (priv->params.hw_lro_en == false &&
- priv->params_ethtool.hw_lro != 0) {
- priv->params.hw_lro_en = true;
- need_restart = true;
- }
- }
- if (was_opened && need_restart) {
- mlx5e_close_locked(ifp);
- mlx5e_open_locked(ifp);
- }
- }
if (mask & IFCAP_HWRXTSTMP) {
if_togglecapenable(ifp, IFCAP_HWRXTSTMP);
if (if_getcapenable(ifp) & IFCAP_HWRXTSTMP) {