Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2933757iog; Mon, 20 Jun 2022 07:47:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5ifjFURoPX6qY2pVya+9M3nv76VJtXKGIjoLBr8dXPpGxqDwG0c0UjjQK+j9cifhBu0y+ X-Received: by 2002:a17:90a:65ca:b0:1e8:ae4e:69f8 with SMTP id i10-20020a17090a65ca00b001e8ae4e69f8mr38026717pjs.76.1655736437506; Mon, 20 Jun 2022 07:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736437; cv=none; d=google.com; s=arc-20160816; b=U45lErqquKxcXpk9O7FbKuvN3pLvA+YlAGaK1+dgCL+M6+CDX5QG/Qf6ItnDp0mdcy 8Aman5ao5pH1Cta+oniODxSlDD0aDk95ec7bkEU0QYk1LDXPwi7h6SmJ8JgcxQ/WCMRT aJqU0bx+ozmPsfvTIKSo97X6zcden2AaD2ScSPga435cLEc4UWC/v2Td+3f2OtE0jZpX vUCrUe20iiwzBUJDRhQ1BwzPOr1OHcnCdcuqUj6yNQjW+BOTIv2jCAKQ+qYxhf22eI3x 1+D7IvtNH5oRIc6IWfiNBrv1dNttUlYlG7sE9iRkbAakTPSpVtsmQ1FzTs4FvER1WK6r 61Bw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NWHs/mRUNYDfzNigQLHHJ2azXp4cwHA88EIDlJBVbko=; b=Q6LFLH0/TPzhCkrWG6ONqDbzSOEqIGcBd7E96LHmPTpKsJmGBkUt6B7xl2wPM7Wl5l YW268MKj5+mtMXMy8gS2vNfp5508p7TuuuiUqKuqM01ZX6HZpZJsKcBQGZnuQGRpGUfM pgT3vI1KWJiO18csWLR8fm5nlszJ/1uv1s1Ee12QSD4hYng+NZU0WMmIEQjLK31fqY/e y4xrRIOyritQJwfKl9RyTn7tfJyesSwnqfmqCaUMJDkUSk6fy53evtIqyGU528viT7+r EyUppGa42eFbqrc+H++/QBr+vBuFWHvqG/RlZ43NpfFovqhUB4wuQ8kHhWgSpK5Lu00G M7cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TO3a5E+X; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a655bca000000b004050e3faf97si17443405pgr.442.2022.06.20.07.47.04; Mon, 20 Jun 2022 07:47: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=@linuxfoundation.org header.s=korg header.b=TO3a5E+X; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243824AbiFTNBL (ORCPT + 99 others); Mon, 20 Jun 2022 09:01:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243792AbiFTM6k (ORCPT ); Mon, 20 Jun 2022 08:58:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767731BE91; Mon, 20 Jun 2022 05:55:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 89921B811A0; Mon, 20 Jun 2022 12:55:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2C11C3411B; Mon, 20 Jun 2022 12:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655729747; bh=yIYtRfu76ISBMbAAz5Ej0mo7PqRgJKMWfOg+qBi6yK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TO3a5E+X8RajqRY3xtDyzubb2eydYJ/cvIyBV2p2N32Le0QDxlGu/VtmLcgU0viFm 3glHzIxvwB0376czP4lJQ/U+e9GGGSEAxR1m05ftQCsie2nImMe1fE2XlE4MOCSOgo a4V09AcB3icoz5jQRxPNC5du15HoDIiIGBl408s4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Wilczynski , Maciej Fijalkowski , Konrad Jankowski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.18 061/141] iavf: Fix issue with MAC address of VF shown as zero Date: Mon, 20 Jun 2022 14:49:59 +0200 Message-Id: <20220620124731.343986611@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124729.509745706@linuxfoundation.org> References: <20220620124729.509745706@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Michal Wilczynski [ Upstream commit 645603844270b69175899268be68b871295764fe ] After reinitialization of iavf, ice driver gets VIRTCHNL_OP_ADD_ETH_ADDR message with incorrectly set type of MAC address. Hardware address should have is_primary flag set as true. This way ice driver knows what it has to set as a MAC address. Check if the address is primary in iavf_add_filter function and set flag accordingly. To test set all-zero MAC on a VF. This triggers iavf re-initialization and VIRTCHNL_OP_ADD_ETH_ADDR message gets sent to PF. For example: ip link set dev ens785 vf 0 mac 00:00:00:00:00:00 This triggers re-initialization of iavf. New MAC should be assigned. Now check if MAC is non-zero: ip link show dev ens785 Fixes: a3e839d539e0 ("iavf: Add usage of new virtchnl format to set default MAC") Signed-off-by: Michal Wilczynski Reviewed-by: Maciej Fijalkowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 7dfcf78b57fb..f3ecb3bca33d 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -984,7 +984,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, list_add_tail(&f->list, &adapter->mac_filter_list); f->add = true; f->is_new_mac = true; - f->is_primary = false; + f->is_primary = ether_addr_equal(macaddr, adapter->hw.mac.addr); adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER; } else { f->remove = false; -- 2.35.1