summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/ef100_nic.c
diff options
context:
space:
mode:
authorAlejandro Lucero <alejandro.lucero-palau@amd.com>2023-02-15 09:08:23 +0000
committerPaolo Abeni <pabeni@redhat.com>2023-02-16 12:03:12 +0100
commita6a15aca4207b5f5ed44f594ddd0ddeb6a495654 (patch)
treed095262763a91480e4cabdbe98b73d2357e4bec2 /drivers/net/ethernet/sfc/ef100_nic.c
parent14743ddd2495c96caa18e382625c034e49a812e2 (diff)
downloadlwn-a6a15aca4207b5f5ed44f594ddd0ddeb6a495654.tar.gz
lwn-a6a15aca4207b5f5ed44f594ddd0ddeb6a495654.zip
sfc: enumerate mports in ef100
MAE ports (mports) are the ports on the EF100 embedded switch such as networking PCIe functions, the physical port, and potentially others. Signed-off-by: Alejandro Lucero <alejandro.lucero-palau@amd.com> Acked-by: Martin Habets <habetsm.xilinx@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef100_nic.c')
-rw-r--r--drivers/net/ethernet/sfc/ef100_nic.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c
index ad686c671ab8..07e7dca0e4f2 100644
--- a/drivers/net/ethernet/sfc/ef100_nic.c
+++ b/drivers/net/ethernet/sfc/ef100_nic.c
@@ -747,6 +747,19 @@ static int efx_ef100_get_base_mport(struct efx_nic *efx)
id);
nic_data->base_mport = id;
nic_data->have_mport = true;
+
+ /* Construct mport selector for "calling PF" */
+ efx_mae_mport_uplink(efx, &selector);
+ /* Look up actual mport ID */
+ rc = efx_mae_lookup_mport(efx, selector, &id);
+ if (rc)
+ return rc;
+ if (id >> 16)
+ netif_warn(efx, probe, efx->net_dev, "Bad own m-port id %#x\n",
+ id);
+ nic_data->own_mport = id;
+ nic_data->have_own_mport = true;
+
return 0;
}
#endif
@@ -1126,6 +1139,14 @@ int ef100_probe_netdev_pf(struct efx_nic *efx)
rc);
}
+ rc = efx_init_mae(efx);
+ if (rc)
+ netif_warn(efx, probe, net_dev,
+ "Failed to init MAE rc %d; representors will not function\n",
+ rc);
+ else
+ efx_ef100_init_reps(efx);
+
rc = efx_init_tc(efx);
if (rc) {
/* Either we don't have an MAE at all (i.e. legacy v-switching),
@@ -1157,6 +1178,12 @@ void ef100_remove(struct efx_nic *efx)
{
struct ef100_nic_data *nic_data = efx->nic_data;
+#ifdef CONFIG_SFC_SRIOV
+ if (efx->mae) {
+ efx_ef100_fini_reps(efx);
+ efx_fini_mae(efx);
+ }
+#endif
efx_mcdi_detach(efx);
efx_mcdi_fini(efx);
if (nic_data)