From owner-svn-src-head@freebsd.org Thu Nov 19 10:18:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E8BEA3361A; Thu, 19 Nov 2015 10:18:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD75F11CF; Thu, 19 Nov 2015 10:18:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAJAIDbo096595; Thu, 19 Nov 2015 10:18:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAJAIDQS096594; Thu, 19 Nov 2015 10:18:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511191018.tAJAIDQS096594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 19 Nov 2015 10:18:13 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2015 10:18:15 -0000 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 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;