Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3923988pxj; Mon, 21 Jun 2021 09:28:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQRjWfYjYL/ulIiH8a5zNiNIz0lwRTgracAzeF0h9vT8MC8QcpDThpkDTjY4P2yIZSpBp2 X-Received: by 2002:a02:334e:: with SMTP id k14mr18696385jak.52.1624292918300; Mon, 21 Jun 2021 09:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292918; cv=none; d=google.com; s=arc-20160816; b=oIDJwuiVR7/2UessTdmN65yhsQZWv4WNrf2nI6lgidyNGDxfEXVB7WnHj/iqWSmg0A p3ujhv3MdbP48mKxzK5/KTL3uW0Ol54Yb+Q4poqgPO+XgD9YPj2LNNXnHxm+iAgvCuga nNHfN5brQgc3aW71Q9Ynom68SVUXsC/g7Zk2+JEAr2Q6CpeV648W/Lmcti3Gd+l1AfNf SaZxgZVuw81kx2KzlQCxDkqkPpDxqfsCtGehapaMqyZNsdZsptWWdD/VHO22un8F5rZ5 rUUSwHAjJ6CByRUF4YDXMVkem6p250JMrEpBHkIhq11Y3T/Pz7jUpqdncO50PuuPLjqq Qp3Q== 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=ifwGVU7Uz01xZZikIfF5EJvVUcvwDxW+Oqi3wVS3ADU=; b=mV/UfpmcdCbbVPvJb7ss2cZcGs6QHcm/6DgqNNsW938ch9G/y7H+wHHRYTACIYzVnw puau//A0hQcD1155sAC0JYUfaBOu2gsAi3Ln0h+1HgcMfaPqfjxQ0hDVcQpmtvoLKaFs bCxpgUAVtYRHeTNjVB6anNYF/Om5Sl76upStwoZ9XSQmW/yYW9jP50yhlCCLCqgt2dLI FU9Y/SWOntSuAkNSVegITmNbU+4sYZxH7n1UT6j6vD06fxSbXYkuv/gOVrb6/mQkNwdX NU7is5HD1XVwPViKkbckTDzML9AhNGr6cB7euf0+ju6kYZv6Mnj0qtvJkqFFMr3Dfaa7 tFZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qNwol7dm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si21212309jan.49.2021.06.21.09.28.22; Mon, 21 Jun 2021 09:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qNwol7dm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230409AbhFUQaI (ORCPT + 99 others); Mon, 21 Jun 2021 12:30:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:48950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231135AbhFUQ2S (ORCPT ); Mon, 21 Jun 2021 12:28:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24B3E613F6; Mon, 21 Jun 2021 16:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292603; bh=i94NsUeRymaRwMuzYSEeJB5OQm5sq6w2sx8vAc4VzAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qNwol7dmS0Y/iOOFoMu2OgjIgihS7S0UoayyOgTB+JeuAxoQYG08aa9IIDJ/zeLf7 x9uzeO06JxTmdlC2hXR4OuGzhXN0LaL/ZFPhshnpk715L/IR96krOAd89YUMB39JTg LsQYNomhDKD2MhPhOgLTfCoopW4//YgkxdeE5b9k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bodong Wang , Parav Pandit , Alaa Hleihel , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 062/146] net/mlx5: E-Switch, Read PF mac address Date: Mon, 21 Jun 2021 18:14:52 +0200 Message-Id: <20210621154914.622731223@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Parav Pandit [ Upstream commit bbc8222dc49db8d49add0f27bcac33f4b92193dc ] External controller PF's MAC address is not read from the device during vport setup. Fail to read this results in showing all zeros to user while the factory programmed MAC is a valid value. $ devlink port show eth1 -jp { "port": { "pci/0000:03:00.0/196608": { "type": "eth", "netdev": "eth1", "flavour": "pcipf", "controller": 1, "pfnum": 0, "splittable": false, "function": { "hw_addr": "00:00:00:00:00:00" } } } } Hence, read it when enabling a vport. After the fix, $ devlink port show eth1 -jp { "port": { "pci/0000:03:00.0/196608": { "type": "eth", "netdev": "eth1", "flavour": "pcipf", "controller": 1, "pfnum": 0, "splittable": false, "function": { "hw_addr": "98:03:9b:a0:60:11" } } } } Fixes: f099fde16db3 ("net/mlx5: E-switch, Support querying port function mac address") Signed-off-by: Bodong Wang Signed-off-by: Parav Pandit Reviewed-by: Alaa Hleihel Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index d61539b5567c..401b2f5128dd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1302,6 +1302,12 @@ static int esw_enable_vport(struct mlx5_eswitch *esw, u16 vport_num, (!vport_num && mlx5_core_is_ecpf(esw->dev))) vport->info.trusted = true; + /* External controller host PF has factory programmed MAC. + * Read it from the device. + */ + if (mlx5_core_is_ecpf(esw->dev) && vport_num == MLX5_VPORT_PF) + mlx5_query_nic_vport_mac_address(esw->dev, vport_num, true, vport->info.mac); + esw_vport_change_handle_locked(vport); esw->enabled_vports++; -- 2.30.2