diff options
author | Tirthendu Sarkar <tirthendu.sarkar@intel.com> | 2023-07-19 15:23:58 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-07-19 09:56:48 -0700 |
commit | 63a64a56bc3f77c74085047ee45356ac850da3e8 (patch) | |
tree | 38b4a906c0eb73640bb4f8c0fcc811ed37b9d878 /include/uapi/linux/if_xdp.h | |
parent | 492e797fdab25f2d8eb1b6bb3236f4aac474f878 (diff) |
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/uapi/linux/if_xdp.h')
-rw-r--r-- | include/uapi/linux/if_xdp.h | 7 |
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 */ |