diff options
| author | Piotr Raczynski <[email protected]> | 2024-08-20 06:57:46 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2024-09-06 17:52:19 +0000 |
| commit | 597b8af58bb2df443ebbdbdc4eef297f5d79d356 (patch) | |
| tree | 66351508bf591b729139412e2fbd50da9f57a447 /drivers/net/ethernet/intel/ice/ice_main.c | |
| parent | Merge branch 'rx-sw-tstamp-for-all' (diff) | |
| download | kernel-597b8af58bb2df443ebbdbdc4eef297f5d79d356.tar.gz kernel-597b8af58bb2df443ebbdbdc4eef297f5d79d356.zip | |
ice: add new VSI type for subfunctions
Add required plumbing for new VSI type dedicated to devlink subfunctions.
Make sure that the vsi is properly configured and destroyed. Also allow
loading XDP and AF_XDP sockets.
The first implementation of devlink subfunctions supports only one Tx/Rx
queue pair per given subfunction.
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Przemek Kitszel <[email protected]>
Reviewed-by: Wojciech Drewek <[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/ice_main.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index c7db88b517da..ad485d22f302 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -2974,6 +2974,9 @@ int ice_vsi_determine_xdp_res(struct ice_vsi *vsi) if (avail < cpus / 2) return -ENOMEM; + if (vsi->type == ICE_VSI_SF) + avail = vsi->alloc_txq; + vsi->num_xdp_txq = min_t(u16, avail, cpus); if (vsi->num_xdp_txq < cpus) @@ -3095,8 +3098,8 @@ static int ice_xdp(struct net_device *dev, struct netdev_bpf *xdp) struct ice_vsi *vsi = np->vsi; int ret; - if (vsi->type != ICE_VSI_PF) { - NL_SET_ERR_MSG_MOD(xdp->extack, "XDP can be loaded only on PF VSI"); + if (vsi->type != ICE_VSI_PF && vsi->type != ICE_VSI_SF) { + NL_SET_ERR_MSG_MOD(xdp->extack, "XDP can be loaded only on PF or SF VSI"); return -EINVAL; } |
