* [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff
@ 2023-02-14 14:39 Lorenzo Bianconi
2023-02-14 16:45 ` [Intel-wired-lan] " Maciej Fijalkowski
2023-02-16 3:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2023-02-14 14:39 UTC (permalink / raw)
To: netdev
Cc: jesse.brandeburg, anthony.l.nguyen, davem, edumazet, kuba, pabeni,
intel-wired-lan, lorenzo.bianconi
Now ice driver supports xdp multi-buffer so add it to xdp_features.
Check vsi type before setting xdp_features flag.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
Changes since v1:
- rebase on top of net-next
- check vsi type before setting xdp_features flag
---
drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 0712c1055aea..4994a0e5a668 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
if (xdp_ring_err)
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 */
xdp_ring_err = ice_realloc_zc_buf(vsi, true);
if (xdp_ring_err)
@@ -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
- * @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);
if (ice_is_safe_mode(pf)) {
@@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netdev)
netdev->netdev_ops = &ice_netdev_ops;
netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
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)
np->vsi = vsi;
ice_set_netdev_features(netdev);
- netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
- NETDEV_XDP_ACT_XSK_ZEROCOPY;
- ice_set_ops(netdev);
+ ice_set_ops(vsi);
if (vsi->type == ICE_VSI_PF) {
SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back));
--
2.39.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff
2023-02-14 14:39 [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff Lorenzo Bianconi
@ 2023-02-14 16:45 ` Maciej Fijalkowski
2023-02-14 16:49 ` Lorenzo Bianconi
2023-02-16 3:20 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Maciej Fijalkowski @ 2023-02-14 16:45 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, intel-wired-lan, jesse.brandeburg, edumazet,
anthony.l.nguyen, kuba, pabeni, davem
On Tue, Feb 14, 2023 at 03:39:27PM +0100, Lorenzo Bianconi wrote:
> Now ice driver supports xdp multi-buffer so add it to xdp_features.
> Check vsi type before setting xdp_features flag.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Changes since v1:
> - rebase on top of net-next
> - check vsi type before setting xdp_features flag
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 0712c1055aea..4994a0e5a668 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
> if (xdp_ring_err)
> 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 */
> xdp_ring_err = ice_realloc_zc_buf(vsi, true);
> if (xdp_ring_err)
> @@ -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
> - * @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);
>
> if (ice_is_safe_mode(pf)) {
> @@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netdev)
> netdev->netdev_ops = &ice_netdev_ops;
> netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
> 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;
FWIW we do support frags in ndo_xdp_xmit() now so
NETDEV_XDP_ACT_NDO_XMIT_SG should be set.
> }
>
> /**
> @@ -4568,9 +4576,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
> np->vsi = vsi;
>
> ice_set_netdev_features(netdev);
> - netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> - NETDEV_XDP_ACT_XSK_ZEROCOPY;
> - ice_set_ops(netdev);
> + ice_set_ops(vsi);
>
> if (vsi->type == ICE_VSI_PF) {
> SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back));
> --
> 2.39.1
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff
2023-02-14 16:45 ` [Intel-wired-lan] " Maciej Fijalkowski
@ 2023-02-14 16:49 ` Lorenzo Bianconi
2023-02-14 16:56 ` Maciej Fijalkowski
0 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Bianconi @ 2023-02-14 16:49 UTC (permalink / raw)
To: Maciej Fijalkowski
Cc: netdev, intel-wired-lan, jesse.brandeburg, edumazet,
anthony.l.nguyen, kuba, pabeni, davem
[-- Attachment #1: Type: text/plain, Size: 3122 bytes --]
> On Tue, Feb 14, 2023 at 03:39:27PM +0100, Lorenzo Bianconi wrote:
> > Now ice driver supports xdp multi-buffer so add it to xdp_features.
> > Check vsi type before setting xdp_features flag.
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > Changes since v1:
> > - rebase on top of net-next
> > - check vsi type before setting xdp_features flag
> > ---
> > drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++------
> > 1 file changed, 12 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> > index 0712c1055aea..4994a0e5a668 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > @@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
> > if (xdp_ring_err)
> > 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 */
> > xdp_ring_err = ice_realloc_zc_buf(vsi, true);
> > if (xdp_ring_err)
> > @@ -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
> > - * @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);
> >
> > if (ice_is_safe_mode(pf)) {
> > @@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netdev)
> > netdev->netdev_ops = &ice_netdev_ops;
> > netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
> > 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;
>
> FWIW we do support frags in ndo_xdp_xmit() now so
> NETDEV_XDP_ACT_NDO_XMIT_SG should be set.
yep, I have enabled them in ice_xdp_setup_prog() setting support_sg to true in
xdp_features_set_redirect_target().
Regards,
Lorenzo
>
> > }
> >
> > /**
> > @@ -4568,9 +4576,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
> > np->vsi = vsi;
> >
> > ice_set_netdev_features(netdev);
> > - netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> > - NETDEV_XDP_ACT_XSK_ZEROCOPY;
> > - ice_set_ops(netdev);
> > + ice_set_ops(vsi);
> >
> > if (vsi->type == ICE_VSI_PF) {
> > SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back));
> > --
> > 2.39.1
> >
> > _______________________________________________
> > Intel-wired-lan mailing list
> > Intel-wired-lan@osuosl.org
> > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff
2023-02-14 16:49 ` Lorenzo Bianconi
@ 2023-02-14 16:56 ` Maciej Fijalkowski
0 siblings, 0 replies; 5+ messages in thread
From: Maciej Fijalkowski @ 2023-02-14 16:56 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, intel-wired-lan, jesse.brandeburg, edumazet,
anthony.l.nguyen, kuba, pabeni, davem
On Tue, Feb 14, 2023 at 05:49:35PM +0100, Lorenzo Bianconi wrote:
> > On Tue, Feb 14, 2023 at 03:39:27PM +0100, Lorenzo Bianconi wrote:
> > > Now ice driver supports xdp multi-buffer so add it to xdp_features.
> > > Check vsi type before setting xdp_features flag.
> > >
> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > ---
> > > Changes since v1:
> > > - rebase on top of net-next
> > > - check vsi type before setting xdp_features flag
> > > ---
> > > drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++------
> > > 1 file changed, 12 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> > > index 0712c1055aea..4994a0e5a668 100644
> > > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > > @@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
> > > if (xdp_ring_err)
> > > 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 */
> > > xdp_ring_err = ice_realloc_zc_buf(vsi, true);
> > > if (xdp_ring_err)
> > > @@ -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
> > > - * @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);
> > >
> > > if (ice_is_safe_mode(pf)) {
> > > @@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netdev)
> > > netdev->netdev_ops = &ice_netdev_ops;
> > > netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
> > > 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;
> >
> > FWIW we do support frags in ndo_xdp_xmit() now so
> > NETDEV_XDP_ACT_NDO_XMIT_SG should be set.
>
> yep, I have enabled them in ice_xdp_setup_prog() setting support_sg to true in
> xdp_features_set_redirect_target().
oops missed this part, sorry:)
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>
> Regards,
> Lorenzo
>
> >
> > > }
> > >
> > > /**
> > > @@ -4568,9 +4576,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
> > > np->vsi = vsi;
> > >
> > > ice_set_netdev_features(netdev);
> > > - netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> > > - NETDEV_XDP_ACT_XSK_ZEROCOPY;
> > > - ice_set_ops(netdev);
> > > + ice_set_ops(vsi);
> > >
> > > if (vsi->type == ICE_VSI_PF) {
> > > SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back));
> > > --
> > > 2.39.1
> > >
> > > _______________________________________________
> > > Intel-wired-lan mailing list
> > > Intel-wired-lan@osuosl.org
> > > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff
2023-02-14 14:39 [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff Lorenzo Bianconi
2023-02-14 16:45 ` [Intel-wired-lan] " Maciej Fijalkowski
@ 2023-02-16 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-16 3:20 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, jesse.brandeburg, anthony.l.nguyen, davem, edumazet, kuba,
pabeni, intel-wired-lan, lorenzo.bianconi
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 14 Feb 2023 15:39:27 +0100 you wrote:
> Now ice driver supports xdp multi-buffer so add it to xdp_features.
> Check vsi type before setting xdp_features flag.
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Changes since v1:
> - rebase on top of net-next
> - check vsi type before setting xdp_features flag
>
> [...]
Here is the summary with links:
- [v2,net-next] ice: update xdp_features with xdp multi-buff
https://git.kernel.org/netdev/net-next/c/b6a4103c3538
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-02-16 3:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 14:39 [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff Lorenzo Bianconi
2023-02-14 16:45 ` [Intel-wired-lan] " Maciej Fijalkowski
2023-02-14 16:49 ` Lorenzo Bianconi
2023-02-14 16:56 ` Maciej Fijalkowski
2023-02-16 3:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).