History

selftests/xsk: add basic multi-buffer test

Add the first basic multi-buffer test that sends a stream of 9K packets and validates that they are received at the other end. In order to enable sending and receiving multi-buffer packets, code that sets the MTU is introduced as well as modifications to the XDP programs so that they signal that they are multi-buffer enabled.

Magnus Karlsson committed 3 years ago

Commit f540d441 parent 17f10346 files · +219 −3Browse files

Showing the changes to tools/include/uapi/linux (1 of 6 files). Show all

Unified · Split

tools/include/uapi/linux/if_xdp.h+6−0
@@ -25,6 +25,12 @@ · 24 unmodified lines
2525 * application.
2626 */
2727 #define XDP_USE_NEED_WAKEUP (1 << 3)
28+/* By setting this option, userspace application indicates that it can
29+ * handle multiple descriptors per packet thus enabling xsk core to split
30+ * multi-buffer XDP frames into multiple Rx descriptors. Without this set
31+ * such frames will be dropped by xsk.
32+ */
33+#define XDP_USE_SG (1 << 4)
2834
2935 /* Flags for xsk_umem_config flags */
3036 #define XDP_UMEM_UNALIGNED_CHUNK_FLAG (1 << 0)