Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp715624imm; Thu, 13 Sep 2018 06:44:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaH1vdG821nRQiFmjXVk2uNVziAoRv7LXKLoKMVoo93eXhcOLutTnemY02+b5ppUF++N7j5 X-Received: by 2002:a17:902:8ec8:: with SMTP id x8-v6mr7453542plo.308.1536846257538; Thu, 13 Sep 2018 06:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846257; cv=none; d=google.com; s=arc-20160816; b=FBqUcAj3qvdUet4GbcS47MiMenSxZ0k51CufmSxjquwD8WhOYBmw9R1AhvRAWqF7oJ 7TCi60Vf7vP6OuCd4AoYpoaqiqgTyBkWuIn2LInFY32ckdzWQRc09fwCDisk7Jd++UKE eic6rBqa8mCQaGt6W0d4IxvtsP6L/y+NALp05lwet93CMr7ULeQLdMsgu+FdhzuWUFlq MM+gv8DyKKmaJ+qNrQX2ORLG4MftuJQTC2ulkrKIOv4zu/nmB2QyLGGgG6+zt42ECrTS tYBycpWHiz7TmcRPXZS/+agknJhyqDyVpU3wgirFPMiK0o8yxK/3jqul0H5WdJQoLOkV uMlQ== 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=DbY62jriCq7E5R6JsaS07GBLlsUPFRDGusLnpg9+DvE=; b=ZWWRLHpZL25iFmWORIDwqm9Jy3iYPEDOVG62FQdTWRaxruJyy5p2euzPDzg95+MioR knJzOO6QCVPVRlYAeeb1SKe9QjE5Lh63WhO/gmBhaGDZ7c1L7cwM085CBOR91WTS0TIe cwQdQuCljuH9j5O3+aks+aiN1TG9OOafYADEXQt8zV3mB4D66kl3iO2sqVLEPaNn6NyN DOMfNxmp8Yufky349ru0yGxITnwBafc5hPVAEdq0as+9lHfxd3Y0VWPDCdCh9pPjLkL5 NWFTbRh8oLoY9uyfqvmsgh6M7GBwTsE1+uuIH2C4Y6axjB+iaHsrL6pAbOPJlRTJV77f L42g== 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 t10-v6si4358461pge.624.2018.09.13.06.44.02; Thu, 13 Sep 2018 06:44:17 -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 S1729725AbeIMSvn (ORCPT + 99 others); Thu, 13 Sep 2018 14:51:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60124 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728992AbeIMSvm (ORCPT ); Thu, 13 Sep 2018 14:51:42 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B71D7D19; Thu, 13 Sep 2018 13:42:10 +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.14 006/115] qlge: Fix netdev features configuration. Date: Thu, 13 Sep 2018 15:30:26 +0200 Message-Id: <20180913131823.835822382@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131823.327472833@linuxfoundation.org> References: <20180913131823.327472833@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.14-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 @@ -2386,26 +2386,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,