Commit b6a4103c authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jakub Kicinski

ice: update xdp_features with xdp multi-buff

Now ice driver supports xdp multi-buffer so add it to xdp_features.
Check vsi type before setting xdp_features flag.
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Acked-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/r/8a4781511ab6e3cd280e944eef69158954f1a15f.1676385351.git.lorenzo@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9dd6e53e
...@@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog, ...@@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
if (xdp_ring_err) if (xdp_ring_err)
NL_SET_ERR_MSG_MOD(extack, "Setting up XDP Tx resources failed"); NL_SET_ERR_MSG_MOD(extack, "Setting up XDP Tx resources failed");
} }
xdp_features_set_redirect_target(vsi->netdev, false); xdp_features_set_redirect_target(vsi->netdev, true);
/* reallocate Rx queues that are used for zero-copy */ /* reallocate Rx queues that are used for zero-copy */
xdp_ring_err = ice_realloc_zc_buf(vsi, true); xdp_ring_err = ice_realloc_zc_buf(vsi, true);
if (xdp_ring_err) if (xdp_ring_err)
...@@ -3333,10 +3333,11 @@ static void ice_napi_add(struct ice_vsi *vsi) ...@@ -3333,10 +3333,11 @@ static void ice_napi_add(struct ice_vsi *vsi)
/** /**
* ice_set_ops - set netdev and ethtools ops for the given netdev * ice_set_ops - set netdev and ethtools ops for the given netdev
* @netdev: netdev instance * @vsi: the VSI associated with the new netdev
*/ */
static void ice_set_ops(struct net_device *netdev) static void ice_set_ops(struct ice_vsi *vsi)
{ {
struct net_device *netdev = vsi->netdev;
struct ice_pf *pf = ice_netdev_to_pf(netdev); struct ice_pf *pf = ice_netdev_to_pf(netdev);
if (ice_is_safe_mode(pf)) { if (ice_is_safe_mode(pf)) {
...@@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netdev) ...@@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netdev)
netdev->netdev_ops = &ice_netdev_ops; netdev->netdev_ops = &ice_netdev_ops;
netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic; netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
ice_set_ethtool_ops(netdev); ice_set_ethtool_ops(netdev);
if (vsi->type != ICE_VSI_PF)
return;
netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_XSK_ZEROCOPY |
NETDEV_XDP_ACT_RX_SG;
} }
/** /**
...@@ -4568,9 +4576,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi) ...@@ -4568,9 +4576,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
np->vsi = vsi; np->vsi = vsi;
ice_set_netdev_features(netdev); ice_set_netdev_features(netdev);
netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | ice_set_ops(vsi);
NETDEV_XDP_ACT_XSK_ZEROCOPY;
ice_set_ops(netdev);
if (vsi->type == ICE_VSI_PF) { if (vsi->type == ICE_VSI_PF) {
SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back)); SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment