aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Tirthendu Sarkar <tirthendu.sarkar@intel.com> 2023-07-19 15:23:58 +0200
committerGravatar Alexei Starovoitov <ast@kernel.org> 2023-07-19 09:56:48 -0700
commit63a64a56bc3f77c74085047ee45356ac850da3e8 (patch)
tree38b4a906c0eb73640bb4f8c0fcc811ed37b9d878 /include
parentbpf, x86: initialize the variable "first_off" in save_args() (diff)
downloadlinux-63a64a56bc3f77c74085047ee45356ac850da3e8.tar.gz
linux-63a64a56bc3f77c74085047ee45356ac850da3e8.tar.bz2
linux-63a64a56bc3f77c74085047ee45356ac850da3e8.zip
xsk: prepare 'options' in xdp_desc for multi-buffer use
Use the 'options' field in xdp_desc as a packet continuity marker. Since 'options' field was unused till now and was expected to be set to 0, the 'eop' descriptor will have it set to 0, while the non-eop descriptors will have to set it to 1. This ensures legacy applications continue to work without needing any change for single-buffer packets. Add helper functions and extend xskq_prod_reserve_desc() to use the 'options' field. Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com> Link: https://lore.kernel.org/r/20230719132421.584801-2-maciej.fijalkowski@intel.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/if_xdp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/uapi/linux/if_xdp.h b/include/uapi/linux/if_xdp.h
index a78a8096f4ce..434f313dc26c 100644
--- a/include/uapi/linux/if_xdp.h
+++ b/include/uapi/linux/if_xdp.h
@@ -108,4 +108,11 @@ struct xdp_desc {
/* UMEM descriptor is __u64 */
+/* Flag indicating that the packet continues with the buffer pointed out by the
+ * next frame in the ring. The end of the packet is signalled by setting this
+ * bit to zero. For single buffer packets, every descriptor has 'options' set
+ * to 0 and this maintains backward compatibility.
+ */
+#define XDP_PKT_CONTD (1 << 0)
+
#endif /* _LINUX_IF_XDP_H */