Thread (31 messages) 31 messages, 4 authors, 2023-02-08

Re: [PATCH v5 net-next 5/8] sfc: add devlink port support for ef100

From: Lucero Palau, Alejandro <hidden>
Date: 2023-02-07 15:20:59
Also in: netdev

On 2/6/23 14:02, Edward Cree wrote:
On 02/02/2023 11:14, alejandro.lucero-palau@amd.com wrote:
quoted
From: Alejandro Lucero <redacted>

Using the data when enumerating mports, create devlink ports just before
netdevs are registered and remove those devlink ports after netdev has
been unregistered.

Signed-off-by: Alejandro Lucero <redacted>
...
quoted
@@ -297,6 +298,7 @@ int efx_ef100_vfrep_create(struct efx_nic *efx, unsigned int i)
  			i, rc);
  		goto fail1;
  	}
+	ef100_rep_set_devlink_port(efv);
  	rc = register_netdev(efv->net_dev);
  	if (rc) {
  		pci_err(efx->pci_dev,
@@ -308,6 +310,7 @@ int efx_ef100_vfrep_create(struct efx_nic *efx, unsigned int i)
  		efv->net_dev->name);
  	return 0;
  fail2:
+	ef100_rep_unset_devlink_port(efv);
  	efx_ef100_deconfigure_rep(efv);
  fail1:
  	efx_ef100_rep_destroy_netdev(efv);
@@ -323,6 +326,7 @@ void efx_ef100_vfrep_destroy(struct efx_nic *efx, struct efx_rep *efv)
  		return;
  	netif_dbg(efx, drv, rep_dev, "Removing VF representor\n");
  	unregister_netdev(rep_dev);
+	ef100_rep_unset_devlink_port(efv);
  	efx_ef100_deconfigure_rep(efv);
  	efx_ef100_rep_destroy_netdev(efv);
  }
Would it make sense to move these calls into
  efx_ef100_[de]configure_rep()?  It's responsible for other
  MAE/m-port related stuff (and is also common with remote reps
  when they arrive).

Uhmm, not sure about this.

I would say configure/deconfigure reps is more driver's internal and 
those devlink related calls are about the driver using an external API. 
Indeed due to this relationship with register/unregister_netdev, I think 
it is more visible where they are at the moment.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help