Skip to contentSkip to conversation

XDP requirements on the NIC

DISCUSSION Jesper Dangaard Brouer 1 participant 1 message Apr 10, 2017 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · On Sun, 09 Apr 2017 19:14:06 -0700 (PDT) David Miller <[email protected]>…

From: Florian Fainelli <[email protected]>
Date: Sun, 9 Apr 2017 19:05:39 -0700

Quoted 3 lines

In order for a NIC and its driver to support XDP, it sounds like we need:

- page-based RX

Not exactly.

The requirement is actually that the packet-page is _writable_. These packet-pages come from the NIC DMA engine, and this complicates keeping them writable, in the case where a RX-page is used for containing two (or more) packets. Careful use of the DMA API does make it possible to page packet sharing to co-exist with XDP (consult Alex Duyck to review such driver changes).

Quoted 4 lines
Quoted 1 line

- TX multiqueue support

Also, not really required.

Quoted 8 lines

What you need to be able to do is to provide enough space in each RX buffer for:

1) a full size frame
2) 256 bytes (XDP_PACKET_HEADROOM) of headroom

This is XDP's main set of requirements, a linear buffer and enough room to push XDP_PACKET_HEADROOM's worth of headers.

True.

Quoted 3 lines

Then if you want to be able to easily wrap the RX packet into an SKB for XDP_PASS, you need to have enough tailroom for skb_shared_info() which you basically give to something like build_skb().

True this is a stack requirement.

Quoted 6 lines

If you look at __build_skb() it's comment states "Caller provides space holding head and skb_shared_info".

For XDP_TX you just have to be able to queue up a raw skb'less packet into your transmit queue. TX multiqueue is not required for this to work.

Signature · 4 lines
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer