From owner-svn-src-stable-10@freebsd.org Wed Jan 27 15:01:10 2016 Return-Path: Delivered-To: svn-src-stable-10@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 4CA24A6FEAD; Wed, 27 Jan 2016 15:01:10 +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 02F6E13DC; Wed, 27 Jan 2016 15:01:09 +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 u0RF19t3087225; Wed, 27 Jan 2016 15:01:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RF19Ts087224; Wed, 27 Jan 2016 15:01:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601271501.u0RF19Ts087224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 Jan 2016 15:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294920 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 15:01:10 -0000 Author: hselasky Date: Wed Jan 27 15:01:08 2016 New Revision: 294920 URL: https://svnweb.freebsd.org/changeset/base/294920 Log: MFC r294319: Fix an issue where the network adapter could be left in down state after changing the HW LRO sysctl when previously in up state. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4941 Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Jan 27 14:59:22 2016 (r294919) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Jan 27 15:01:08 2016 (r294920) @@ -178,23 +178,21 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; /* we always agree to turn off HW LRO - but not always to turn on */ - if (priv->params_ethtool.hw_lro) { - if (priv->params_ethtool.hw_lro != 1) { - priv->params_ethtool.hw_lro = priv->params.hw_lro_en; - error = EINVAL; - goto done; - } - 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 */ + if (priv->params_ethtool.hw_lro != 0) { + if ((priv->ifp->if_capenable & IFCAP_LRO) && + MLX5_CAP_ETH(priv->mdev, lro_cap)) { + priv->params.hw_lro_en = 1; + priv->params_ethtool.hw_lro = 1; + } else { + priv->params.hw_lro_en = 0; 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; + + if_printf(priv->ifp, "Can't enable HW LRO: " + "The HW or SW LRO feature is disabled"); } } else { - priv->params.hw_lro_en = false; + priv->params.hw_lro_en = 0; } if (&priv->params_ethtool.arg[arg2] == @@ -208,7 +206,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.cqe_zipping = 0; } } - if (was_opened) mlx5e_open_locked(priv->ifp); done: