Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1171911pxb; Thu, 24 Mar 2022 14:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNpLhq3yNCSqOuXpT5R0e6QY6AwXAkujjld0VWjvgnnmpLC5ABji/jcxykSfdJYXWNPQFD X-Received: by 2002:a17:902:eb8f:b0:154:c7a4:937c with SMTP id q15-20020a170902eb8f00b00154c7a4937cmr5756788plg.111.1648156697485; Thu, 24 Mar 2022 14:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648156697; cv=none; d=google.com; s=arc-20160816; b=ZMBIMEmNX8oXSxcmxLwWe9XwxYihzoqe7GULu3yQUVDlzbAH1VxbeVNBx1gs2N+mlC fPEv5iiGEpUeoZRCKITcXbJGaSmqkbGevb2tg/bwTEI2jaEpWjJH/sSrnlTMV5pJguT9 8RQJU0JGoYfFzUL0i7bnxZFU/yuU1OqzLuhIcpi4nAT9G89+qKdPrFQTdXI+Z+0PSrIy YB9EebB1Vpcf0npO91aLjwQjO9gjQVkjDPHdyPkpZpTQov+OrDh/m8B267XTxYaoscw9 36lXa0nh1nDlB7TSqegRlCmMgvIsi+tCP5lz3okN7BfjDV5ZU1wSiJVDsZfJIp2bhoA2 b+lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uDclauLS2m7dM0d3qhsa9ZKgKqM/YMDvv9C9fjpITow=; b=IoFnrvFuyRsUMRixEQ1bQqUVgbEGv8DJMr4ZKdw1fwFAarjp3FsOmP3joxnoDKFDUw npKkviPVyx+Gb2HQml6Gf3Bb9G4/UZepN3UPEhclp5gHjCIw19CHJFH6C00irJBqHfYC dZ0ImNLmwhrjSm3JwfHITTnuYAv0TzsKlbh8xb/mY/DcU62adk/ILD/P5ShE37SdmZ0d ge6ICcQ3nEqRqOfSD4wGHMBprYQ9GpmZXnxuvAFGYBClBh5DTjgF+Whmpcjl1viIsV5x PXJGgUoF1gLhzxcsoR1rzpxVJfISen5uQjb4Q4c9C3PSIcNYgAVaqhBesGfNNPR/otz6 5fig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lAAFEMQb; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br4-20020a056a00440400b004fa771ab36asi729494pfb.265.2022.03.24.14.18.04; Thu, 24 Mar 2022 14:18:17 -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=@intel.com header.s=Intel header.b=lAAFEMQb; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343644AbiCWRg1 (ORCPT + 99 others); Wed, 23 Mar 2022 13:36:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239664AbiCWRgZ (ORCPT ); Wed, 23 Mar 2022 13:36:25 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F53A44A2D; Wed, 23 Mar 2022 10:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648056895; x=1679592895; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sQLlik2JBKgjvTm6fLFQVl8wTqJf3BIKx0o9VBPfxEY=; b=lAAFEMQbl84QIBvB3dS5mlI9IBa5FkTqog9nk8ZRssKHox/nY2qGJTC0 QxFNd3gZEjkUGZ+xAjyJ5gjJygV5QwgEsYsoZPktIpmk71NYX3KGoUoV0 MzYVsJcHo+Km05Hnvau/J73LDvqAlf0Asrv1BNp+8ixzhOMwM3sTRlRg+ /DkFe8uAXrIHfM0AbdXTRVOrNUL92lx1Xhw6cQGwL++CnQd1dkYVFuj9R vvCVpBATZM4CGaFQqWI8hWwnBGsPqfgFNwW5hMgO0b4pQWCDL6MRzNdrj tP69WHPt3iu0GhCDsitDEvcDrW2v4lpukeHplYArWwMRaRxOE/WKtODUH w==; X-IronPort-AV: E=McAfee;i="6200,9189,10295"; a="257005681" X-IronPort-AV: E=Sophos;i="5.90,204,1643702400"; d="scan'208";a="257005681" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 10:22:04 -0700 X-IronPort-AV: E=Sophos;i="5.90,204,1643702400"; d="scan'208";a="544287811" Received: from kplh.igk.intel.com ([10.102.21.224]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 10:22:01 -0700 Date: Wed, 23 Mar 2022 20:10:10 +0100 From: Piotr Raczynski To: Ivan Vecera Cc: netdev@vger.kernel.org, poros@redhat.com, mschmidt@redhat.com, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , Paolo Abeni , "moderated list:INTEL ETHERNET DRIVERS" , open list Subject: Re: [PATCH net] ice: Fix MAC address setting Message-ID: <20220323190519.GA23730@kplh.igk.intel.com> References: <20220323135829.4015645-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220323135829.4015645-1-ivecera@redhat.com> X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Wed, Mar 23, 2022 at 02:58:29PM +0100, Ivan Vecera wrote: > 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; Thanks Ivan, This looks fine. It is a regression as I checked since driver used to return success in such case. It seems that the only way to have EEXIST here is when the same MAC is requested, I'd also consider just return 0 here to skip later firwmare write which seems redundant here. Piotr > + } else if (err) > /* error if the new filter addition failed */ > err = -EADDRNOTAVAIL; > > -- > 2.34.1 >