Date: Thu, 19 Nov 2015 10:18:13 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291068 - head/sys/dev/mlx5/mlx5_en Message-ID: <201511191018.tAJAIDQS096594@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Nov 19 10:18:13 2015 New Revision: 291068 URL: https://svnweb.freebsd.org/changeset/base/291068 Log: Maintain the "hw_lro" configuration variable correctly. Setting sysctl dev....conf.hw_lro may fail if the net device lro is turned off. Due to the nature of our sysctl handler we need to set the values back to 0 and issue an error. Differential Revision: https://reviews.freebsd.org/D4177 Submitted by: Shahar Klein <shahark@mellanox.com> Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Nov 19 10:10:52 2015 (r291067) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Nov 19 10:18:13 2015 (r291068) @@ -184,6 +184,13 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG } if (priv->ifp->if_capenable & IFCAP_LRO) priv->params.hw_lro_en = !!MLX5_CAP_ETH(priv->mdev, lro_cap); + else { + /* set the correct (0) value to params_ethtool.hw_lro, issue a warning and return error */ + priv->params_ethtool.hw_lro = 0; + error = EINVAL; + if_printf(priv->ifp, "Can't set HW_LRO to a device with LRO turned off"); + goto done; + } } else { priv->params.hw_lro_en = false;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511191018.tAJAIDQS096594>