Skip to content

AF_XDP PMD Fixes

Ciara Loftus dpdk-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 2 repliesIn review
  2. v33 patches 4 repliesSuperseded
  3. v23 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches0 repliesSuperseded

Changes in v4 from the cover letter

* Deduct XDP_PACKET_HEADROOM from max mtu for copy mode.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net/af_xdp: fix umem frame size & headroom calculationsdrivers/net/af_xdp/rte_eth_af_xdp.c+8 -50 replies
2/3net/af_xdp: use correct fill queue addressesdrivers/net/af_xdp/rte_eth_af_xdp.c+17 -80 replies
3/3net/af_xdp: fix maximum MTU valuedrivers/net/af_xdp/rte_eth_af_xdp.c+11 -121 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchXiaolong Ye
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [dpdk-dev] [PATCH v4 0/3] AF_XDP PMD Fixes

This series introduces some fixes for the zero copy path of the AF_XDP. In zero copy, the mempool objects are mapped directly into the AF_XDP UMEM. Below depicts the layout of an object in a mempool.

+-----+--------+------+------+-----+-------------+
| mp  | struct | mbuf | mbuf | XDP |             |
| hdr | rte_   | priv |  hr  | hr  |   payload   |
| obj | mbuf   |      |      |     |             |
+-----+--------+------+------+-----+-------------+
  64     128       *     128   256        *

<---------------- frame size --------------------> <---- frame hr ------------->

1: net/af_xdp: fix umem frame size & headroom calculations
* The previous frame size calculation incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size. Instead of performing a manual calculation, use the rte_mempool_calc_obj_size API to determine the frame size.
* The previous frame headroom calculation also incorrectly used mb_pool->private_data_size and didn't include mb_pool->header_size or the mbuf priv size.

2. net/af_xdp: use correct fill queue addresses
The fill queue addresses should start at the beginning of the mempool object instead of the beginning of the mbuf. This is because the umem frame headroom includes the mp hdrobj size. Starting at this point ensures AF_XDP doesn't write past the available room in the frame, in the case of larger packets which are close to the size of the mbuf.

3. net/af_xdp: fix maximum MTU value
The maximum MTU for af_xdp zero copy is equal to the page size less the frame overhead introduced by AF_XDP (XDP HR = 256) and DPDK (frame hr = 320). The patch updates this value to reflect this, and removes some unneeded constants for both zero-copy and copy mode.

v4:
* Deduct XDP_PACKET_HEADROOM from max mtu for copy mode.

v3:
* Fix send-email issue - use in-reply-to

v2:
* Include mbuf priv size in rx mbuf data_off calculation

Ciara Loftus (3):
net/af_xdp: fix umem frame size & headroom calculations net/af_xdp: use correct fill queue addresses net/af_xdp: fix maximum MTU value

 drivers/net/af_xdp/rte_eth_af_xdp.c | 61 +++++++++++++++++------------
 1 file changed, 36 insertions(+), 25 deletions(-)
Signature · 1 line
2.17.1