[PATCH iwl-next v5 00/13] idpf: add XDP support

Alexander Lobakin posted 13 patches 1 month, 1 week ago
drivers/net/ethernet/intel/idpf/Kconfig       |   2 +-
drivers/net/ethernet/intel/idpf/Makefile      |   2 +
drivers/net/ethernet/intel/idpf/idpf.h        |  31 +-
.../net/ethernet/intel/idpf/idpf_lan_txrx.h   |   6 +-
drivers/net/ethernet/intel/idpf/idpf_txrx.h   | 140 ++++--
.../net/ethernet/intel/idpf/idpf_virtchnl.h   |   1 -
drivers/net/ethernet/intel/idpf/xdp.h         | 172 +++++++
include/net/libeth/xdp.h                      |  11 +-
include/net/xdp.h                             |  28 +-
drivers/net/ethernet/intel/idpf/idpf_dev.c    |  11 +-
drivers/net/ethernet/intel/idpf/idpf_lib.c    |  67 ++-
drivers/net/ethernet/intel/idpf/idpf_main.c   |   1 +
.../ethernet/intel/idpf/idpf_singleq_txrx.c   | 110 ++---
drivers/net/ethernet/intel/idpf/idpf_txrx.c   | 424 ++++++++--------
drivers/net/ethernet/intel/idpf/idpf_vf_dev.c |  11 +-
.../net/ethernet/intel/idpf/idpf_virtchnl.c   | 173 ++++---
drivers/net/ethernet/intel/idpf/xdp.c         | 454 ++++++++++++++++++
17 files changed, 1217 insertions(+), 427 deletions(-)
create mode 100644 drivers/net/ethernet/intel/idpf/xdp.h
create mode 100644 drivers/net/ethernet/intel/idpf/xdp.c
[PATCH iwl-next v5 00/13] idpf: add XDP support
Posted by Alexander Lobakin 1 month, 1 week ago
Add XDP support (w/o XSk for now) to the idpf driver using the libeth_xdp
sublib. All possible verdicts, .ndo_xdp_xmit(), multi-buffer etc. are here.
In general, nothing outstanding comparing to ice, except performance --
let's say, up to 2x for .ndo_xdp_xmit() on certain platforms and
scenarios.
idpf doesn't support VLAN Rx offload, so only the hash hint is
available for now.

Patches 1-7 are prereqs, without which XDP would either not work at all or
work slower/worse/...

Alexander Lobakin (9):
  xdp, libeth: make the xdp_init_buff() micro-optimization generic
  idpf: fix Rx descriptor ready check barrier in splitq
  idpf: use a saner limit for default number of queues to allocate
  idpf: link NAPIs to queues
  idpf: add support for nointerrupt queues
  idpf: use generic functions to build xdp_buff and skb
  idpf: add support for XDP on Rx
  idpf: add support for .ndo_xdp_xmit()
  idpf: add XDP RSS hash hint

Michal Kubiak (4):
  idpf: add 4-byte completion descriptor definition
  idpf: remove SW marker handling from NAPI
  idpf: prepare structures to support XDP
  idpf: implement XDP_SETUP_PROG in ndo_bpf for splitq

 drivers/net/ethernet/intel/idpf/Kconfig       |   2 +-
 drivers/net/ethernet/intel/idpf/Makefile      |   2 +
 drivers/net/ethernet/intel/idpf/idpf.h        |  31 +-
 .../net/ethernet/intel/idpf/idpf_lan_txrx.h   |   6 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.h   | 140 ++++--
 .../net/ethernet/intel/idpf/idpf_virtchnl.h   |   1 -
 drivers/net/ethernet/intel/idpf/xdp.h         | 172 +++++++
 include/net/libeth/xdp.h                      |  11 +-
 include/net/xdp.h                             |  28 +-
 drivers/net/ethernet/intel/idpf/idpf_dev.c    |  11 +-
 drivers/net/ethernet/intel/idpf/idpf_lib.c    |  67 ++-
 drivers/net/ethernet/intel/idpf/idpf_main.c   |   1 +
 .../ethernet/intel/idpf/idpf_singleq_txrx.c   | 110 ++---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c   | 424 ++++++++--------
 drivers/net/ethernet/intel/idpf/idpf_vf_dev.c |  11 +-
 .../net/ethernet/intel/idpf/idpf_virtchnl.c   | 173 ++++---
 drivers/net/ethernet/intel/idpf/xdp.c         | 454 ++++++++++++++++++
 17 files changed, 1217 insertions(+), 427 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/idpf/xdp.h
 create mode 100644 drivers/net/ethernet/intel/idpf/xdp.c

---
From v4[0]:
* 08/13: fix rare crashes when the number of XDPQSs < nr_cpu_ids -- merge
         artefacts after rebasing on top of Joshua's recent changes;
* 09/13: fix "suspicious RCU usage" during rmmod when lockdep is enabled.

From v3[1]:
* 01/13: make the xdp_init_buff() micro-opt generic, include some
         bloat-o-meter and perf diffs (Simon, Kees);
* 08/13: don't include XDPSQs in Ethtool's 'other_count' (Ethtool
         channels are interrupts!) (Jakub);
* 11/13:
  * finalize XDPSQs a bit earlier on Rx;
  * show some bloat-o-meter and performance diffs for
    __LIBETH_WORD_ACCESS (Jakub).

From v2[2]:
* rebase on top of [3] to resolve conflicts in Tony's tree;
* 02:
  * harmonize maximum number of queues to not create more Tx queues than
    completion queues or more Rx queues than buffer queues / 2;
  * fix VC timeouts on certain steppings as there processing a lot of queues
    can take more time than the minimum timeout of 2 seconds;
* 03: fix RTNL assertion fail on PCI reset.

From v1[4]:
* drop the libeth_xdp part (submitted separately and accepted);
* fix some typos and kdocs (Jakub, Maciej);
* pick a couple RBs (Maciej);
* 03: create a convenience helper (Maciej), fix rtnl assertion fail;
* 04: since XDP uses its own queue cleaning routines, don't add 4-byte
      completion support to the skb code;
* 05: don't use old weird logic with negative descriptor index (Maciej);
* 06: fix invalid interrupt vector counting in certain cases;
* 07: fix cleanup timer is fired after the queue buffers are already freed;
* 08: fix XDP program removal in corner cases such as PCI reset or
      remove request when there's no active prog (from netdev_unregister());
* 10: fix rare queue stuck -- HW requires to always have at least one free Tx
      descriptor on the queue, otherwise it thinks the queue is empty and
      there's nothing to send (true Intel HW veteran bug).

Testing hints: basic Rx and Tx (TCP, UDP, VLAN, HW GRO on/off, trafficgen
stress tests, performance comparison); xdp-tools with all possible actions
(xdp-bench for PASS, DROP, TX, REDIRECT to cpumap, devmap (inc self-redirect);
xdp-trafficgen to double-check XDP xmit). Would be nice to see a perf
comparison against ice (in percent) (idpf must be plugged into a PCIe 4+).

[0] https://lore.kernel.org/intel-wired-lan/20250811161044.32329-1-aleksander.lobakin@intel.com
[1] https://lore.kernel.org/intel-wired-lan/20250730160717.28976-1-aleksander.lobakin@intel.com
[2] https://lore.kernel.org/intel-wired-lan/20250624164515.2663137-1-aleksander.lobakin@intel.com
[3] https://lore.kernel.org/intel-wired-lan/20250725184223.4084821-1-joshua.a.hay@intel.com
[4] https://lore.kernel.org/intel-wired-lan/20250305162132.1106080-1-aleksander.lobakin@intel.com
-- 
2.51.0
Re: [PATCH iwl-next v5 00/13] idpf: add XDP support
Posted by Simon Horman 1 month, 1 week ago
On Tue, Aug 26, 2025 at 05:54:54PM +0200, Alexander Lobakin wrote:
> Add XDP support (w/o XSk for now) to the idpf driver using the libeth_xdp
> sublib. All possible verdicts, .ndo_xdp_xmit(), multi-buffer etc. are here.
> In general, nothing outstanding comparing to ice, except performance --
> let's say, up to 2x for .ndo_xdp_xmit() on certain platforms and
> scenarios.
> idpf doesn't support VLAN Rx offload, so only the hash hint is
> available for now.
> 
> Patches 1-7 are prereqs, without which XDP would either not work at all or
> work slower/worse/...

Hi Alexander,

I'm wondering if you could give a hash that this patch-set applies to.
Or a branch where it has been applied.

I suspect it's terribly obvious how to do this, but I'm drawing a blank here.

Thanks!
Re: [PATCH iwl-next v5 00/13] idpf: add XDP support
Posted by Alexander Lobakin 1 month ago
From: Simon Horman <horms@kernel.org>
Date: Wed, 27 Aug 2025 18:28:28 +0100

> On Tue, Aug 26, 2025 at 05:54:54PM +0200, Alexander Lobakin wrote:
>> Add XDP support (w/o XSk for now) to the idpf driver using the libeth_xdp
>> sublib. All possible verdicts, .ndo_xdp_xmit(), multi-buffer etc. are here.
>> In general, nothing outstanding comparing to ice, except performance --
>> let's say, up to 2x for .ndo_xdp_xmit() on certain platforms and
>> scenarios.
>> idpf doesn't support VLAN Rx offload, so only the hash hint is
>> available for now.
>>
>> Patches 1-7 are prereqs, without which XDP would either not work at all or
>> work slower/worse/...
> 
> Hi Alexander,
> 
> I'm wondering if you could give a hash that this patch-set applies to.
> Or a branch where it has been applied.
> 
> I suspect it's terribly obvious how to do this, but I'm drawing a blank here.

I could've left `base-commit-id`, but Tony does rebasing of his trees
every day, so this wouldn't help at all.
Moreover, it's to be applied to Tony's next-queue, but not on top of it,
because currently there are patches in the tree that will go *after* my
series to net-next. So it's a bit complicated.

> 
> Thanks!

Thanks,
Olek
Re: [PATCH iwl-next v5 00/13] idpf: add XDP support
Posted by Tony Nguyen 1 month ago

On 8/27/2025 10:28 AM, Simon Horman wrote:
> On Tue, Aug 26, 2025 at 05:54:54PM +0200, Alexander Lobakin wrote:
>> Add XDP support (w/o XSk for now) to the idpf driver using the libeth_xdp
>> sublib. All possible verdicts, .ndo_xdp_xmit(), multi-buffer etc. are here.
>> In general, nothing outstanding comparing to ice, except performance --
>> let's say, up to 2x for .ndo_xdp_xmit() on certain platforms and
>> scenarios.
>> idpf doesn't support VLAN Rx offload, so only the hash hint is
>> available for now.
>>
>> Patches 1-7 are prereqs, without which XDP would either not work at all or
>> work slower/worse/...
> 
> Hi Alexander,
> 
> I'm wondering if you could give a hash that this patch-set applies to.
> Or a branch where it has been applied.

Hi Simon,

I believe this will apply to net-next if you apply this series [1] 
beforehand; it should merge into net-next this week. Alternatively,
you could use IWL next-queue/dev-queue [2] and replace the patches there 
(v4) with this these.

Thanks,
Tony

[1] 
https://lore.kernel.org/netdev/20250821180100.401955-1-anthony.l.nguyen@intel.com/
[2] 
https://web.git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git/

> I suspect it's terribly obvious how to do this, but I'm drawing a blank here.
> 
> Thanks!