Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp748239imm; Thu, 13 Sep 2018 07:11:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbxkGr2QztP7I5gDyHV2NQ4RZDafibNvsCNosIo+9Xb3TI5346lGpi3dRs8DcJOa0oDnECD X-Received: by 2002:a63:6949:: with SMTP id e70-v6mr7425195pgc.119.1536847891244; Thu, 13 Sep 2018 07:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847891; cv=none; d=google.com; s=arc-20160816; b=04j8MhDAfisSmOhduZxMY6BDJIgoTc0BcRrOGiiPjcWpfgYbP6eLn+lUcQKOeLuMlG q4D2qsVSwrEOfhXzcO1l6aEVFFgzJex+wQQjuXqpRV2sdbED1La1v+2HKxQZ9ZLa9DdW o4aCjD0XNVDQrlQMXRCECymI+p/ni4DT+TQuVQ50ds/8TL5kI+asoXx1dkqpP9nmL/3I eva7neMIvIufWaMQteuTCrQ6zqrnmXqylYZjJARMfQ7nEPIK9uxr8IaXRZjzwvbvNm16 BxW5MFPjrVYvOzyga67xxRSd/+l8rduiWTX0Jpn27iyw/gL9SjRjvi+7B2E4fm6CQIh3 doIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=3cnpckwMUCVl1694OMX1pp1cx1VyZAvsOsDL1QfmiXw=; b=d5OIIaFLLkPTN8H8Y4gHAfGZ2fYCVIFBlWTWX0Jgek6T4XbqeOiwhH7VEMpZbOjlWI vHnZGjeUMVz9NMvSJDyoSehmP5QUV+B1uMhem4rVmL1ToKW7KGHj2coC6lQsroW1OIVU VbNBzOCQMejbwey6XfpAajQHTZp/3lWsbS3TgxYkAfHJCtrViQOKogW/BWkOc8FTnH4K uzRxVUnzCHYKhZrWAcKLy3XxeEy7/YMIj8vYA71x5ZAWR2NyYv+nkeOk7xndtnzemkGD tBRPtYa+dOQv6xM1AD4F+4tf7RajfU3uTSGFGcZg3cQdIAa8z7PoO8nBAc3TI+4EP8h+ Zj0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5-v6si4178140plk.95.2018.09.13.07.11.14; Thu, 13 Sep 2018 07:11:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730971AbeIMTB7 (ORCPT + 99 others); Thu, 13 Sep 2018 15:01:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33488 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730119AbeIMTB6 (ORCPT ); Thu, 13 Sep 2018 15:01:58 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AEBF2CE7; Thu, 13 Sep 2018 13:52:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish , Benjamin Poirier , "David S. Miller" Subject: [PATCH 4.18 006/197] qlge: Fix netdev features configuration. Date: Thu, 13 Sep 2018 15:29:15 +0200 Message-Id: <20180913131841.821808217@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Manish Chopra [ Upstream commit 6750c87074c5b534d82fdaabb1deb45b8f1f57de ] qlge_fix_features() is not supposed to modify hardware or driver state, rather it is supposed to only fix requested fetures bits. Currently qlge_fix_features() also goes for interface down and up unnecessarily if there is not even any change in features set. This patch changes/fixes following - 1) Move reload of interface or device re-config from qlge_fix_features() to qlge_set_features(). 2) Reload of interface in qlge_set_features() only if relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed. 3) Get rid of qlge_fix_features() since driver is not really required to fix any features bit. Signed-off-by: Manish Reviewed-by: Benjamin Poirier Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c @@ -2384,26 +2384,20 @@ static int qlge_update_hw_vlan_features( return status; } -static netdev_features_t qlge_fix_features(struct net_device *ndev, - netdev_features_t features) -{ - int err; - - /* Update the behavior of vlan accel in the adapter */ - err = qlge_update_hw_vlan_features(ndev, features); - if (err) - return err; - - return features; -} - static int qlge_set_features(struct net_device *ndev, netdev_features_t features) { netdev_features_t changed = ndev->features ^ features; + int err; + + if (changed & NETIF_F_HW_VLAN_CTAG_RX) { + /* Update the behavior of vlan accel in the adapter */ + err = qlge_update_hw_vlan_features(ndev, features); + if (err) + return err; - if (changed & NETIF_F_HW_VLAN_CTAG_RX) qlge_vlan_mode(ndev, features); + } return 0; } @@ -4719,7 +4713,6 @@ static const struct net_device_ops qlge_ .ndo_set_mac_address = qlge_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_tx_timeout = qlge_tx_timeout, - .ndo_fix_features = qlge_fix_features, .ndo_set_features = qlge_set_features, .ndo_vlan_rx_add_vid = qlge_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = qlge_vlan_rx_kill_vid,