Skip to content

Commit 998b85f

Browse files
habetsm-xilinxdavem330
authored andcommitted
sfc: Add devlink dev info support for EF10
Reuse the work done for EF100 to add devlink support for EF10. There is no devlink port support for EF10. Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 26e3537 commit 998b85f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • drivers/net/ethernet/sfc

drivers/net/ethernet/sfc/efx.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "io.h"
3333
#include "selftest.h"
3434
#include "sriov.h"
35+
#include "efx_devlink.h"
3536

3637
#include "mcdi_port_common.h"
3738
#include "mcdi_pcol.h"
@@ -877,6 +878,7 @@ static void efx_pci_remove(struct pci_dev *pci_dev)
877878
if (efx->type->sriov_fini)
878879
efx->type->sriov_fini(efx);
879880

881+
efx_fini_devlink_lock(efx);
880882
efx_unregister_netdev(efx);
881883

882884
efx_mtd_remove(efx);
@@ -886,6 +888,7 @@ static void efx_pci_remove(struct pci_dev *pci_dev)
886888
efx_fini_io(efx);
887889
pci_dbg(efx->pci_dev, "shutdown successful\n");
888890

891+
efx_fini_devlink_and_unlock(efx);
889892
efx_fini_struct(efx);
890893
free_netdev(efx->net_dev);
891894
probe_data = container_of(efx, struct efx_probe_data, efx);
@@ -1025,7 +1028,13 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
10251028
NETDEV_XDP_ACT_REDIRECT |
10261029
NETDEV_XDP_ACT_NDO_XMIT;
10271030

1031+
/* devlink creation, registration and lock */
1032+
rc = efx_probe_devlink_and_lock(efx);
1033+
if (rc)
1034+
pci_err(efx->pci_dev, "devlink registration failed");
1035+
10281036
rc = efx_register_netdev(efx);
1037+
efx_probe_devlink_unlock(efx);
10291038
if (!rc)
10301039
return 0;
10311040

0 commit comments

Comments
 (0)