io_uring/zcrx: drop "notif" from stats struct names

Keep zcrx statistics generic and don't stick "notif" to its uapi
definitions. Stats dosn't need to be bound to notification details,
it makes it cleaner and more readable.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/6a39676b6f71b67d3f89c6ebab7a3739873834a3.1784726895.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Pavel Begunkov 2026-07-22 14:42:15 +01:00 committed by Jens Axboe
parent ab05caca12
commit af78c00204
5 changed files with 10 additions and 10 deletions

View File

@ -66,10 +66,10 @@ struct io_uring_query_zcrx {
struct io_uring_query_zcrx_notif {
/* Bitmask of supported ZCRX_NOTIF_* flags */
__u32 notif_flags;
/* Size of io_uring_zcrx_notif_stats */
__u32 notif_stats_size;
/* Size of zcrx_stats */
__u32 stats_size;
/* Required alignment for the stats struct within the region (ie stats_offset) */
__u32 notif_stats_off_alignment;
__u32 stats_off_alignment;
__u32 __resv1;
__u64 __resv2[4];
};

View File

@ -76,11 +76,11 @@ enum zcrx_notification_type {
};
enum zcrx_notification_desc_flags {
/* If set, stats_offset holds a valid offset to a notif_stats struct */
/* If set, stats_offset holds a valid offset to a zcrx_stats struct */
ZCRX_NOTIF_DESC_FLAG_STATS = 1 << 0,
};
struct zcrx_notif_stats {
struct zcrx_stats {
__u64 copy_count; /* cumulative copy-fallback CQEs */
__u64 copy_bytes; /* cumulative bytes copied */
};

View File

@ -50,8 +50,8 @@ static ssize_t io_query_zcrx_notif(union io_query_data *data)
struct io_uring_query_zcrx_notif *e = &data->zcrx_notif;
e->notif_flags = ZCRX_NOTIF_TYPE_MASK;
e->notif_stats_size = sizeof(struct zcrx_notif_stats);
e->notif_stats_off_alignment = __alignof__(struct zcrx_notif_stats);
e->stats_size = sizeof(struct zcrx_stats);
e->stats_off_alignment = __alignof__(struct zcrx_stats);
e->__resv1 = 0;
memset(&e->__resv2, 0, sizeof(e->__resv2));
return sizeof(*e);

View File

@ -863,12 +863,12 @@ static int zcrx_validate_notif_stats(struct io_zcrx_ifq *ifq,
used = reg->offsets.rqes +
sizeof(struct io_uring_zcrx_rqe) * reg->rq_entries;
if (!IS_ALIGNED(stats_off, __alignof__(struct zcrx_notif_stats)))
if (!IS_ALIGNED(stats_off, __alignof__(struct zcrx_stats)))
return -EINVAL;
if (stats_off < used)
return -ERANGE;
if (check_add_overflow(stats_off,
sizeof(struct zcrx_notif_stats),
sizeof(struct zcrx_stats),
&end))
return -ERANGE;
if (end > io_region_size(&ifq->rq_region))

View File

@ -80,7 +80,7 @@ struct io_zcrx_ifq {
u32 allowed_notif_mask;
u32 fired_notifs;
u64 notif_data;
struct zcrx_notif_stats *notif_stats;
struct zcrx_stats *notif_stats;
};
#if defined(CONFIG_IO_URING_ZCRX)