Skip to content

idpf: add flow-based XDP fallback for FWs without Tx FIFO support

Alexander Lobakin intel-wired-lan stable 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 0 repliesNew
  2. v33 patches 1 replySuperseded
  3. v21 patch 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch4 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4idpf: always reserve one empty descriptor on XDPSQsdrivers/net/ethernet/intel/idpf/xdp.c drivers/net/ethernet/intel/idpf/xsk.c+2 -20 replies
2/4idpf: enforce strict ordering on BE when reading XDPCQEsdrivers/net/ethernet/intel/idpf/xdp.c+7 -20 replies
3/4idpf: fix possible out-of-bound cpu_to_mem() when configuring XDPSQsdrivers/net/ethernet/intel/idpf/xdp.c+1 -10 replies
4/4idpf: add flow-based XDP fallback for FWs without Tx FIFO supportdrivers/net/ethernet/intel/idpf/idpf_txrx.c drivers/net/ethernet/intel/idpf/idpf_txrx.h drivers/net/ethernet/intel/idpf/xdp.c +2 more+234 -180 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchAleksandr LoktionovYiFei ZhuPatryk Holda
1/4
2/4
3/4
4/4R-b T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH iwl-next v4 0/4] idpf: add flow-based XDP fallback for FWs without Tx FIFO support

From the first days of XDP implementation in idpf, it relied and worked solely on top of the queue-based scheduling Tx mode, which basically means simple FIFO. However, turned out not every firmware supports this mode and XDP doesn't work there at all.

Start with some good Sashiko findings. One empty XDPSQE which idpf requires is always reserved only in XSk xmit code, but not in the rest of cases. XDPCQE parsing can end up with partial reads on BE systems. XDPSQ configuration code can pass out-of-bounds values to cpu_to_mem() in rare cases (nr_cpu_ids < num_xdpsq).

Then, introduce the flow-based fallback for all XDP paths which is always supported by any FW. The actual implementation is selected during XDP program setup basing on the caps that the FW advertises, so that firmwares that already work correctly won't get performance regressions the fallback brings.

Alexander Lobakin (4):
idpf: always reserve one empty descriptor on XDPSQs
idpf: enforce strict ordering on BE when reading XDPCQEs
idpf: fix possible out-of-bound cpu_to_mem() when configuring XDPSQs
idpf: add flow-based XDP fallback for FWs without Tx FIFO support

 drivers/net/ethernet/intel/idpf/idpf_txrx.h |  18 ++-
 drivers/net/ethernet/intel/idpf/xdp.h       |  60 ++++++++
 include/net/libeth/xdp.h                    |  13 ++
 drivers/net/ethernet/intel/idpf/idpf_txrx.c |  19 ++-
 drivers/net/ethernet/intel/idpf/xdp.c       | 155 ++++++++++++++++++--
 drivers/net/ethernet/intel/idpf/xsk.c       |   2 +-
 6 files changed, 244 insertions(+), 23 deletions(-)

---
From v3[0]:
* new fix (0002): fix out-of-bound cpu_to_mem() when nr_cpu_ids is lower than the number of XDPSQs (Sashiko).

From v2[1]:
* new fix (0001): fix already existing issue with not reserving a required free Tx descriptor in case of XDP Tx, xmit, and XSk Tx (Sashiko);
* new fix (0002): enforce strict ordering when parsing XDPCQEs on Big Endian (Intel's Sashiko);
* rewrite the bitmap set-reset implementation from scratch to fix fix S/G: HW generates a completion per packet, not per descriptor (Sashiko);
* fix excessive allocations, possible pointer overwrites, and corner case static key imbalance when setting up XDPSQs (Intel's Sashiko).

From v1[2]:
* rework static key management: move to idpf_xdpsqs_{get,put}() to avoid refcount imbalance issues as .ndo_bpf() is not always called in pairs (hardware reset etc.) (Sashiko, Intel's Sashiko);
* don't zero the whole pending window but only the frames sent since the last batch to avoid missed OOO completions (Intel's Sashiko);
* micro-optimize idpf_xdpsq_set_rs{,_fb}().

Sorry I've had health issues for the last year. I hope I'll be restoring my usual "usefulness" (reviews, submissions) on the LKML bit by bit.

[0] https://lore.kernel.org/intel-wired-lan/[email protected]
[1] https://lore.kernel.org/intel-wired-lan/[email protected]
[2] https://lore.kernel.org/intel-wired-lan/[email protected]

Signature · 1 line
2.56.1