aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/devlink/devlink.c
diff options
context:
space:
mode:
authorPiotr Raczynski <[email protected]>2024-08-20 06:57:48 +0000
committerTony Nguyen <[email protected]>2024-09-06 18:01:23 +0000
commiteda69d654c7edae21312f731e0308941cb2ee2a9 (patch)
tree2036aed4f7af097017816a789e945f49ca11dbbd /drivers/net/ethernet/intel/ice/devlink/devlink.c
parentice: export ice ndo_ops functions (diff)
downloadkernel-eda69d654c7edae21312f731e0308941cb2ee2a9.tar.gz
kernel-eda69d654c7edae21312f731e0308941cb2ee2a9.zip
ice: add basic devlink subfunctions support
Implement devlink port handlers responsible for ethernet type devlink subfunctions. Create subfunction devlink port and setup all resources needed for a subfunction netdev to operate. Configure new VSI for each new subfunction, initialize and configure interrupts and Tx/Rx resources. Set correct MAC filters and create new netdev. For now, subfunction is limited to only one Tx/Rx queue pair. Only allocate new subfunction VSI with devlink port new command. Allocate and free subfunction MSIX interrupt vectors using new API calls with pci_msix_alloc_irq_at and pci_msix_free_irq. Support both automatic and manual subfunction numbers. If no subfunction number is provided, use xa_alloc to pick a number automatically. This will find the first free index and use that as the number. This reduces burden on users in the simple case where a specific number is not required. It may also be slightly faster to check that a number exists since xarray lookup should be faster than a linear scan of the dyn_ports xarray. Co-developed-by: Jacob Keller <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Signed-off-by: Piotr Raczynski <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/devlink/devlink.c')
-rw-r--r--drivers/net/ethernet/intel/ice/devlink/devlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
index 810a901d7afd..b7eb1b56f2c6 100644
--- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
+++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
@@ -6,6 +6,7 @@
#include "ice.h"
#include "ice_lib.h"
#include "devlink.h"
+#include "devlink_port.h"
#include "ice_eswitch.h"
#include "ice_fw_update.h"
#include "ice_dcb_lib.h"
@@ -1277,6 +1278,8 @@ static const struct devlink_ops ice_devlink_ops = {
.rate_leaf_parent_set = ice_devlink_set_parent,
.rate_node_parent_set = ice_devlink_set_parent,
+
+ .port_new = ice_devlink_port_new,
};
static int