[PATCH net-next v4 13/14] sfc: update vdpa device MAC address
From: Gautam Dawar
Date: Fri Apr 07 2023 - 04:15:07 EST
As the VF MAC address can now be updated using `devlink port function set`
interface, fetch the vdpa device MAC address from the underlying VF during
vdpa device creation.
Signed-off-by: Gautam Dawar <gautam.dawar@xxxxxxx>
---
drivers/net/ethernet/sfc/ef100_vdpa.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/sfc/ef100_vdpa.c b/drivers/net/ethernet/sfc/ef100_vdpa.c
index f8a273a4d221..1aa7dec6c8b3 100644
--- a/drivers/net/ethernet/sfc/ef100_vdpa.c
+++ b/drivers/net/ethernet/sfc/ef100_vdpa.c
@@ -277,6 +277,18 @@ static int get_net_config(struct ef100_vdpa_nic *vdpa_nic)
vdpa_nic->net_config.max_virtqueue_pairs =
cpu_to_efx_vdpa16(vdpa_nic, vdpa_nic->max_queue_pairs);
+ rc = ef100_get_mac_address(efx, vdpa_nic->mac_address,
+ efx->client_id, true);
+ if (rc) {
+ dev_err(&vdpa_nic->vdpa_dev.dev,
+ "%s: Get MAC for vf:%u failed:%d\n", __func__,
+ vdpa_nic->vf_index, rc);
+ return rc;
+ }
+
+ if (is_valid_ether_addr(vdpa_nic->mac_address))
+ vdpa_nic->mac_configured = true;
+
rc = efx_vdpa_get_mtu(efx, &mtu);
if (rc) {
dev_err(&vdpa_nic->vdpa_dev.dev,
--
2.30.1