Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2215294pxb; Fri, 25 Mar 2022 13:11:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqEn3E9/XmCdvI3fdLzIYLLLBuazUvt8rBiMdcvwlfpX9WwRtU/BmZdiIWRg56xeg37rmT X-Received: by 2002:a17:903:230a:b0:154:7271:9c30 with SMTP id d10-20020a170903230a00b0015472719c30mr13983756plh.84.1648239119521; Fri, 25 Mar 2022 13:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648239119; cv=none; d=google.com; s=arc-20160816; b=gLkdjfgJHxxfpOSnSYgVVezLI+33cXdvhilYWLJgI3o0qXsn+46NXxQz/MyQOn6nP5 Qzvos7FVLH7LzlsepTRASLQV7ALZPqI/YW5e9OKef0cTrsHCEU8+qstlTD5WCaAZmO88 AMScxx2DKstSRDvPapbZk1RG2ma1pGQHIPue7/wd/n630OSQEXcHKN7/+ebnjWYdKjVp SFUmbhM/IrmJ6sOJf2LdniTNliAwt8cO/tpSTLmehhYBhuD6seE7VoPwRG7RoboHg9fn ZKhtJkzuohD4hX7S43NmBF1G6seZzZEyhq+D5sTowcsX5W37WB3qmFNG5GsZHHo56Uws JzCA== 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=4vE69ZpuUGjCHMISLHB6KELn4cvD790slh3DG8ORMVU=; b=A5h8XBEfe/+3YBcnuZYDeoTTIfPyDDD5+QcJMFOryePvHcqz4tGystIPXq7ApquQRZ OeAoetwYDx0DNdR+zNbPKbQ40bhyBfRWi/jvIOST+xzv+RgnNwM3OHLqtEdYBdlotyXy FuI/LQRqlnoIvOaobQgUnwyQykJ5ZnMrGs/Id7IAwHW+1oVQjf8GjyAN0+SJi2EiKeym Ym2hhSP+n6JG0LoXBdV5yW0I46BTtD7dhHnZpnwX1yA+kN1Z+T0tV5qu3eEJXIQHRlQN pT//SNnai5SOUUjmL3SsQKu1DVMmXxEHJu4kb45EzeO1XkaxtX3xmjFa/ifFEw5o9lTc zKSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hkUlditi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b4-20020a170903228400b00153b2d1644csi3652692plh.84.2022.03.25.13.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hkUlditi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A651B3BB7BA; Fri, 25 Mar 2022 11:54:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353225AbiCYN1G (ORCPT + 99 others); Fri, 25 Mar 2022 09:27:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238689AbiCYN1F (ORCPT ); Fri, 25 Mar 2022 09:27:05 -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 2844553A4F for ; Fri, 25 Mar 2022 06:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648214731; 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=4vE69ZpuUGjCHMISLHB6KELn4cvD790slh3DG8ORMVU=; b=hkUlditiu3uE/4tBGKC+VUFPhCIx1W1k7kSV5N7971ijSCIw39x2fI3l5WImdfHMlYbAKk vve4z/+rSBqFeIqlgAqW3Ic2B7TxChETfeKaV4pa+XrVpPuhAvjmyWD2OPqkwYO7M/0loA 6ikt+ztg/fyRxkyNIkc0RAu3RPHnt+0= 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-639-v-9MVSKENS2ttd0ofVIC0A-1; Fri, 25 Mar 2022 09:25:28 -0400 X-MC-Unique: v-9MVSKENS2ttd0ofVIC0A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF8C31066543; Fri, 25 Mar 2022 13:25:27 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.192.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFB9B1454535; Fri, 25 Mar 2022 13:25:24 +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 v2] ice: Fix MAC address setting Date: Fri, 25 Mar 2022 14:25:23 +0100 Message-Id: <20220325132524.1765342-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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' remains to be -EEXIST till the end of the function and is returned to caller. Prior mentioned 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. Fix 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index b588d7995631..d755ce07869f 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5475,16 +5475,19 @@ 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) + + return 0; + } else if (err) { /* error if the new filter addition failed */ err = -EADDRNOTAVAIL; + } err_update_filters: if (err) { -- 2.34.1