Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3994124pxp; Wed, 23 Mar 2022 09:23:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNQEu84ZiY/vHHVy7KHsQatSdOSkAGkFan04ouhRtmbjZZTkcGeLH3tt2uvQ214yv/3krg X-Received: by 2002:a17:906:3a55:b0:6ce:c2ee:3e10 with SMTP id a21-20020a1709063a5500b006cec2ee3e10mr836395ejf.210.1648052596008; Wed, 23 Mar 2022 09:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648052596; cv=none; d=google.com; s=arc-20160816; b=Mvz5hufwM89T91QSU60S0dx0I6WI81nGHsLAaLqVm58nZ2bHQrev2MP4NJ3vljuy6z ttgesxKPoPoyLt+BUj9n+M77WZbD2LnHOX8+S1o9UHpyBxfGAPUTZt7LFzTUV48WmQwa RMtXKSeV+bVqfHc1dNDmXud0EcAYj1vfGgt85ChtYbVQSHwSAsQHm/UdHl1p99bA/Wxx w2rptVYA59I75D/82jHTp84ki4kGQwZUqKX44Pp4E6ti8twGBeHVWYTCxMxbEcyP9Eun PfSoZLNLVvEtFJtwpDOH9NfXQ4mimt7GS3Rb6IekZ/1QEIe5GK7Mv2NwMeOYK79Om9hR wekQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NPsFKWBDc285bGf4fkPtm66sH099xvtiav0N2gh4FPU=; b=W0WPwth15amgGmqxqYTrTuhFz2ZIScQmuggy6Ike/ZqcJGBcholrDwgJwr5VRWXMsM TJFxCe1x6VOeNniJBg2e6cDf7kAcQS6mFniGrt37IUek3k1hywbiTM4WrYdjok0dMAu0 bsv4X8dj4gxtOkEhiyvxcr23Svob21jQOJsD2OPLm+PGg7mf8TTW7cC8Qei+mybB650n KW+W/6vGg+VCZkwYd6Y8SY6fYl+BCXmWU+y4wAziJymiSCzye5GuqMA37dyaniL/T2PI j4FgkfCaOum3wivH0O+eIsdibEm17feCoS1xQ4xnwkVpSMAL3a56y9QEtaRXw4ArtG1K kmcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GaL2dwQW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2-20020a170906024200b006df76385d13si10255008ejl.435.2022.03.23.09.22.50; Wed, 23 Mar 2022 09:23:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GaL2dwQW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241517AbiCWOAI (ORCPT + 99 others); Wed, 23 Mar 2022 10:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235604AbiCWOAG (ORCPT ); Wed, 23 Mar 2022 10:00:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 15BE4E02B for ; Wed, 23 Mar 2022 06:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648043916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=NPsFKWBDc285bGf4fkPtm66sH099xvtiav0N2gh4FPU=; b=GaL2dwQWRT2fRFMWvcDzObQji9OoNdcP3Q4lAchoT9CoYVn++Ch0l5SuvkTyIN4CbzGoOA //kerV4lhnLxQhzz4X/lBHWUXk6RGL4M9zhmKZkvnDudaGZ7lVi697Xn52z1aInh6Ld8bx jqT3xuKZFxMnnDwk84pbYy+Aje0PA40= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-99w9fyUfPM-3XaVeV6T16Q-1; Wed, 23 Mar 2022 09:58:33 -0400 X-MC-Unique: 99w9fyUfPM-3XaVeV6T16Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A075106655B; Wed, 23 Mar 2022 13:58:32 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.192.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6C2B403D1A3; Wed, 23 Mar 2022 13:58:30 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: poros@redhat.com, mschmidt@redhat.com, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net] ice: Fix MAC address setting Date: Wed, 23 Mar 2022 14:58:29 +0100 Message-Id: <20220323135829.4015645-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 2ccc1c1ccc671b ("ice: Remove excess error variables") merged the usage of 'status' and 'err' variables into single one in function ice_set_mac_address(). Unfortunately this causes a regression when call of ice_fltr_add_mac() returns -EEXIST because this return value does not indicate an error in this case but value of 'err' value remains to be -EEXIST till the end of the function and is returned to caller. Prior this commit this does not happen because return value of ice_fltr_add_mac() was stored to 'status' variable first and if it was -EEXIST then 'err' remains to be zero. The patch fixes the problem by reset 'err' to zero when ice_fltr_add_mac() returns -EEXIST. Fixes: 2ccc1c1ccc671b ("ice: Remove excess error variables") Signed-off-by: Ivan Vecera --- drivers/net/ethernet/intel/ice/ice_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 168a41ea37b8..420558d1cd21 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5474,14 +5474,15 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi) /* Add filter for new MAC. If filter exists, return success */ err = ice_fltr_add_mac(vsi, mac, ICE_FWD_TO_VSI); - if (err == -EEXIST) + if (err == -EEXIST) { /* Although this MAC filter is already present in hardware it's * possible in some cases (e.g. bonding) that dev_addr was * modified outside of the driver and needs to be restored back * to this value. */ netdev_dbg(netdev, "filter for MAC %pM already exists\n", mac); - else if (err) + err = 0; + } else if (err) /* error if the new filter addition failed */ err = -EADDRNOTAVAIL; -- 2.34.1