DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3 0/3] AF_XDP PMD Fixes
@ 2020-02-10 11:40 Ciara Loftus
  2020-02-10 11:40 ` [dpdk-dev] [PATCH v3 1/3] net/af_xdp: fix umem frame size & headroom calculations Ciara Loftus
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ciara Loftus @ 2020-02-10 11:40 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus

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.

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(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-13  8:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 11:40 [dpdk-dev] [PATCH v3 0/3] AF_XDP PMD Fixes Ciara Loftus
2020-02-10 11:40 ` [dpdk-dev] [PATCH v3 1/3] net/af_xdp: fix umem frame size & headroom calculations Ciara Loftus
2020-02-13  2:45   ` Ye Xiaolong
2020-02-10 11:40 ` [dpdk-dev] [PATCH v3 2/3] net/af_xdp: use correct fill queue addresses Ciara Loftus
2020-02-13  3:09   ` Ye Xiaolong
2020-02-10 11:40 ` [dpdk-dev] [PATCH v3 3/3] net/af_xdp: fix maximum MTU value Ciara Loftus
2020-02-13  3:05   ` Ye Xiaolong
2020-02-13  8:43     ` Loftus, Ciara

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).