sfc: move xdp_features configuration in efx_pci_probe_post_io()
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 8 Feb 2023 16:58:40 +0000 (17:58 +0100)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 8 Feb 2023 18:18:46 +0000 (10:18 -0800)
Move xdp_features configuration from efx_pci_probe() to
efx_pci_probe_post_io() since it is where all the other basic netdev
features are initialised.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/9bd31c9a29bcf406ab90a249a28fc328e5578fd1.1675875404.git.lorenzo@kernel.org
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/siena/efx.c

index 18ff8d8cff429ba1d285d8156b5fd72f1576fc68..9569c3356b4af2a16f43260c3ffcddd8b03ec6cc 100644 (file)
@@ -1025,6 +1025,10 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
        net_dev->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
        net_dev->features |= efx->fixed_features;
 
+       net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
+                               NETDEV_XDP_ACT_REDIRECT |
+                               NETDEV_XDP_ACT_NDO_XMIT;
+
        rc = efx_register_netdev(efx);
        if (!rc)
                return 0;
@@ -1078,10 +1082,6 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
 
        pci_info(pci_dev, "Solarflare NIC detected\n");
 
-       efx->net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
-                                    NETDEV_XDP_ACT_REDIRECT |
-                                    NETDEV_XDP_ACT_NDO_XMIT;
-
        if (!efx->type->is_vf)
                efx_probe_vpd_strings(efx);
 
index a6ef21845224a920d13c41eea43494e4d4ea3531..ef52ec71d197fe616a8283f7b80e103d1212fc0e 100644 (file)
@@ -1007,6 +1007,10 @@ static int efx_pci_probe_post_io(struct efx_nic *efx)
        net_dev->features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
        net_dev->features |= efx->fixed_features;
 
+       net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
+                               NETDEV_XDP_ACT_REDIRECT |
+                               NETDEV_XDP_ACT_NDO_XMIT;
+
        rc = efx_register_netdev(efx);
        if (!rc)
                return 0;
@@ -1048,10 +1052,6 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
 
        pci_info(pci_dev, "Solarflare NIC detected\n");
 
-       efx->net_dev->xdp_features = NETDEV_XDP_ACT_BASIC |
-                                    NETDEV_XDP_ACT_REDIRECT |
-                                    NETDEV_XDP_ACT_NDO_XMIT;
-
        if (!efx->type->is_vf)
                efx_probe_vpd_strings(efx);