Add an ability to query if the zcrx rx page size setting is available.
Note, even when the API is supported by io_uring, the registration can
still get rejected for various reasons, e.g. when the NIC or the driver
doesn't support it, when the particular specified size is unsupported,
when the memory area doesn't satisfy all requirements, etc.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
ZCRX_REG_IMPORT = 1,
};
+enum zcrx_features {
+ /*
+ * The user can ask for the desired rx page size by passing the
+ * value in struct io_uring_zcrx_ifq_reg::rx_buf_len.
+ */
+ ZCRX_FEATURE_RX_PAGE_SIZE = 1 << 0,
+};
+
/*
* Argument for IORING_REGISTER_ZCRX_IFQ
*/
__u64 area_flags;
/* The number of supported ZCRX_CTRL_* opcodes */
__u32 nr_ctrl_opcodes;
- __u32 __resv1;
+ /* Bitmask of ZCRX_FEATURE_* indicating which features are available */
+ __u32 features;
/* The refill ring header size */
__u32 rq_hdr_size;
/* The alignment for the header */
e->nr_ctrl_opcodes = __ZCRX_CTRL_LAST;
e->rq_hdr_size = sizeof(struct io_uring);
e->rq_hdr_alignment = L1_CACHE_BYTES;
- e->__resv1 = 0;
+ e->features = ZCRX_FEATURE_RX_PAGE_SIZE;
e->__resv2 = 0;
return sizeof(*e);
}