From: Dragos Tatulea Date: Fri, 12 Jun 2026 21:17:03 +0000 (+0300) Subject: netdev: expose io_uring rx_page_order order via netlink X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c4adb7fb46fac348197c5a15c676a066dd1f88e;p=thirdparty%2Fkernel%2Flinux.git netdev: expose io_uring rx_page_order order via netlink This adds observability for the io_uring zcrx rx-buf-len configuration. Signed-off-by: Dragos Tatulea Reviewed-by: Yael Chemla Reviewed-by: Tariq Toukan Acked-by: Pavel Begunkov Link: https://patch.msgid.link/20260612211709.1456966-3-dtatulea@nvidia.com Signed-off-by: Jakub Kicinski --- diff --git a/Documentation/netlink/specs/netdev.yaml b/Documentation/netlink/specs/netdev.yaml index 49862b666d7da..5f143da7458cf 100644 --- a/Documentation/netlink/specs/netdev.yaml +++ b/Documentation/netlink/specs/netdev.yaml @@ -127,7 +127,14 @@ attribute-sets: enum: xsk-flags - name: io-uring-provider-info - attributes: [] + attributes: + - + name: rx-buf-len + type: uint + doc: | + RX buffer length in bytes for this io_uring memory provider. + Reflects the rx_buf_len passed at io_uring zerocopy rx + registration time. - name: page-pool attributes: diff --git a/include/uapi/linux/netdev.h b/include/uapi/linux/netdev.h index 7df1056a35fda..2f3ab75e8cc0f 100644 --- a/include/uapi/linux/netdev.h +++ b/include/uapi/linux/netdev.h @@ -97,6 +97,8 @@ enum { }; enum { + NETDEV_A_IO_URING_PROVIDER_INFO_RX_BUF_LEN = 1, + __NETDEV_A_IO_URING_PROVIDER_INFO_MAX, NETDEV_A_IO_URING_PROVIDER_INFO_MAX = (__NETDEV_A_IO_URING_PROVIDER_INFO_MAX - 1) }; diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 19837e0b5e918..c7b167c2d4e4c 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -1156,6 +1156,7 @@ static void io_pp_zc_destroy(struct page_pool *pp) static int io_pp_nl_fill(void *mp_priv, struct sk_buff *rsp, struct netdev_rx_queue *rxq) { + struct io_zcrx_ifq *ifq = mp_priv; struct nlattr *nest; int type; @@ -1163,6 +1164,13 @@ static int io_pp_nl_fill(void *mp_priv, struct sk_buff *rsp, nest = nla_nest_start(rsp, type); if (!nest) return -EMSGSIZE; + + if (nla_put_uint(rsp, NETDEV_A_IO_URING_PROVIDER_INFO_RX_BUF_LEN, + 1ULL << ifq->niov_shift)) { + nla_nest_cancel(rsp, nest); + return -EMSGSIZE; + } + nla_nest_end(rsp, nest); return 0; diff --git a/tools/include/uapi/linux/netdev.h b/tools/include/uapi/linux/netdev.h index 7df1056a35fda..2f3ab75e8cc0f 100644 --- a/tools/include/uapi/linux/netdev.h +++ b/tools/include/uapi/linux/netdev.h @@ -97,6 +97,8 @@ enum { }; enum { + NETDEV_A_IO_URING_PROVIDER_INFO_RX_BUF_LEN = 1, + __NETDEV_A_IO_URING_PROVIDER_INFO_MAX, NETDEV_A_IO_URING_PROVIDER_INFO_MAX = (__NETDEV_A_IO_URING_PROVIDER_INFO_MAX - 1) };