Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Paul Blakey <paulb@mellanox.com>,
	Parav Pandit <parav@mellanox.com>, Roi Dayan <roid@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 09/10] net/mlx5e: Expose same physical switch_id for all representors
Date: Fri, 28 Jun 2019 23:18:33 +0000	[thread overview]
Message-ID: <20190628231759.16374-10-saeedm@mellanox.com> (raw)
In-Reply-To: <20190628231759.16374-1-saeedm@mellanox.com>

From: Paul Blakey <paulb@mellanox.com>

Report system_image_guid as the E-Switch switch_id, this ensures
that when a NIC contains multiple PCI functions and which
has merged eswitch capability, all representors from
multiple PFs publish same switch_id.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../net/ethernet/mellanox/mlx5/core/en_rep.c  | 29 ++++++-------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index fce3814bdb2f..330034fcdfc5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -391,30 +391,19 @@ static const struct ethtool_ops mlx5e_uplink_rep_ethtool_ops = {
 static int mlx5e_rep_get_port_parent_id(struct net_device *dev,
 					struct netdev_phys_item_id *ppid)
 {
-	struct mlx5e_priv *priv = netdev_priv(dev);
-	struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
-	struct net_device *uplink_upper = NULL;
-	struct mlx5e_priv *uplink_priv = NULL;
-	struct net_device *uplink_dev;
+	struct mlx5_eswitch *esw;
+	struct mlx5e_priv *priv;
+	u64 parent_id;
+
+	priv = netdev_priv(dev);
+	esw = priv->mdev->priv.eswitch;
 
 	if (esw->mode == SRIOV_NONE)
 		return -EOPNOTSUPP;
 
-	uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
-	if (uplink_dev) {
-		uplink_upper = netdev_master_upper_dev_get(uplink_dev);
-		uplink_priv = netdev_priv(uplink_dev);
-	}
-
-	ppid->id_len = ETH_ALEN;
-	if (uplink_upper && mlx5_lag_is_sriov(uplink_priv->mdev)) {
-		ether_addr_copy(ppid->id, uplink_upper->dev_addr);
-	} else {
-		struct mlx5e_rep_priv *rpriv = priv->ppriv;
-		struct mlx5_eswitch_rep *rep = rpriv->rep;
-
-		ether_addr_copy(ppid->id, rep->hw_id);
-	}
+	parent_id = mlx5_query_nic_system_image_guid(priv->mdev);
+	ppid->id_len = sizeof(parent_id);
+	memcpy(ppid->id, &parent_id, sizeof(parent_id));
 
 	return 0;
 }
-- 
2.21.0


  parent reply	other threads:[~2019-06-28 23:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 23:18 [pull request][net-next 00/10] Mellanox, mlx5e updates 2019-06-28 Saeed Mahameed
2019-06-28 23:18 ` [net-next 01/10] net/mlx5: MPFS, Cleanup add MAC flow Saeed Mahameed
2019-06-28 23:18 ` [net-next 02/10] net/mlx5: MPFS, Allow adding the same MAC more than once Saeed Mahameed
2019-06-28 23:18 ` [net-next 03/10] net/mlx5e: Move to HW checksumming advertising Saeed Mahameed
2019-06-28 23:18 ` [net-next 04/10] net/mlx5e: Report netdevice MPLS features Saeed Mahameed
2019-06-28 23:18 ` [net-next 05/10] net/mlx5e: Correct phys_port_name for PF port Saeed Mahameed
2019-06-28 23:18 ` [net-next 06/10] net/mlx5e: Set drvinfo in generic manner Saeed Mahameed
2019-06-28 23:18 ` [net-next 07/10] net/mlx5e: reduce stack usage in mlx5_eswitch_termtbl_create Saeed Mahameed
2019-06-28 23:18 ` [net-next 08/10] net/mlx5e: Don't refresh TIRs when updating representor SQs Saeed Mahameed
2019-06-28 23:18 ` Saeed Mahameed [this message]
2019-06-28 23:18 ` [net-next 10/10] net/mlx5e: Disallow tc redirect offload cases we don't support Saeed Mahameed
2019-07-01  1:42 ` [pull request][net-next 00/10] Mellanox, mlx5e updates 2019-06-28 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190628231759.16374-10-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=parav@mellanox.com \
    --cc=paulb@mellanox.com \
    --cc=roid@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox