Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3936851pxj; Mon, 21 Jun 2021 09:44:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylZbHgY69RN6ZUn9XUfEHIP0rMbGWZip8LxLlXYnB4W3r1TdRtElSLufQGiPTi76RCC93P X-Received: by 2002:a17:907:2bd1:: with SMTP id gv17mr25352143ejc.15.1624293898957; Mon, 21 Jun 2021 09:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293898; cv=none; d=google.com; s=arc-20160816; b=GXJkOlbYHUnBpcrQZUoulmLTISAOQqLjaRvN+eC2lh3x5zN3NNg0nbdN6CljoPCQ/M QM3I60me7Min5ks4KHlEKHn36KxxHrZfumsOJes0JSJ1uvqGLGnp5TFney/OaoHw7IFl 1a1sPi78E8RoLkLwLXwR8qeLzFJDtAhPbnIqqG/xBY89Es4p39xEW9bQ5Nztf2N1IAHK 4Uds+slKnDDB/AbUZfGS8G+foNhTpOXWqd4oMEcAMPcmpIhaQJdyMl3tSBeSruRXzNyl GKf6iVU1tok1Fdq2eeTVfPTKgZfYmR8+1HeCsIYB/Nz8XlivcQDIcW8TnaRpTCaftyz2 J+Fg== 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=hvEI7fScKFz7bKtJ7UxUIUmZ83J/BUuMJ2kmHDrNxKE=; b=hA1CR9fcwvUkOHVDb4iDVFXpSaqRxRpj8coofmzgc+d9lrftGHw+oS219/qwYENrb9 xKXtBjo9CDcIghSZVyS6NvNao/bQmbJqaJ6XcPRFKDimIli0wa8SmJtHzi1mVO3dbpk3 wC9xV7d5l2qV+/DO7TEdIXvYCq0zZmohB+jpUx4ft3TdNoxaX5aPbb+WNbnJ0ZJI3sRC xQaB807g7XTOsrA7TO2Ag6KpR06TVL2juZ85WvQoX1Org75wzB8ShjRDyM0iz2dFAzWH 64dDmVRMd0Ut/IMQtjknwkad8peXYC/J48apZmjYRHwVCp3yE9xgrxdSNePEdoprL35Q AalA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YeLqm42V; 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 j4si11396970ejj.545.2021.06.21.09.44.36; Mon, 21 Jun 2021 09:44:58 -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=YeLqm42V; 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 S233502AbhFUQob (ORCPT + 99 others); Mon, 21 Jun 2021 12:44:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:33732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232346AbhFUQkK (ORCPT ); Mon, 21 Jun 2021 12:40:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9FAB061441; Mon, 21 Jun 2021 16:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293030; bh=ORp52EnjsUZUKbQxMRzRXWpz0QO8xl+fz6edJFBpeE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YeLqm42VIDSZBT+a2rbIdYOXyKMaFFmM3KWpNULlUJm0hp7QBnwQnSerAsyc+3Rb5 AellaG+q1rc0YTxynQWuFTLfGzZ48Db8/41ufMGG6iNAfl11Kr81cJ3Nd0HYtQ6yRK xuj1iLGvTYC6caT/eKEuhPohkcRyjidPCHbHUHjc= 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.12 073/178] net/mlx5: E-Switch, Read PF mac address Date: Mon, 21 Jun 2021 18:14:47 +0200 Message-Id: <20210621154925.050944843@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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 2c6d95900e3c..a3edeea4ddd7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1308,6 +1308,12 @@ int mlx5_esw_vport_enable(struct mlx5_eswitch *esw, u16 vport_num, goto err_vhca_mapping; } + /* 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