diff options
author | 2025-02-14 21:12:30 +0000 | |
---|---|---|
committer | 2025-02-17 16:46:03 -0800 | |
commit | df524c8f57711a3fe54abb087794819840005fd0 (patch) | |
tree | d83b425bee255c8a642fbfc8be9173bb6c961d27 /net | |
parent | netlink: Add nla_put_empty_nest helper (diff) | |
download | wireguard-linux-df524c8f57711a3fe54abb087794819840005fd0.tar.xz wireguard-linux-df524c8f57711a3fe54abb087794819840005fd0.zip |
netdev-genl: Add an XSK attribute to queues
Expose a new per-queue nest attribute, xsk, which will be present for
queues that are being used for AF_XDP. If the queue is not being used for
AF_XDP, the nest will not be present.
In the future, this attribute can be extended to include more data about
XSK as it is needed.
Signed-off-by: Joe Damato <jdamato@fastly.com>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250214211255.14194-3-jdamato@fastly.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netdev-genl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c index 22ac51356d9f..c92fba65b20d 100644 --- a/net/core/netdev-genl.c +++ b/net/core/netdev-genl.c @@ -400,11 +400,23 @@ netdev_nl_queue_fill_one(struct sk_buff *rsp, struct net_device *netdev, if (params->mp_ops && params->mp_ops->nl_fill(params->mp_priv, rsp, rxq)) goto nla_put_failure; +#ifdef CONFIG_XDP_SOCKETS + if (rxq->pool) + if (nla_put_empty_nest(rsp, NETDEV_A_QUEUE_XSK)) + goto nla_put_failure; +#endif + break; case NETDEV_QUEUE_TYPE_TX: txq = netdev_get_tx_queue(netdev, q_idx); if (nla_put_napi_id(rsp, txq->napi)) goto nla_put_failure; +#ifdef CONFIG_XDP_SOCKETS + if (txq->pool) + if (nla_put_empty_nest(rsp, NETDEV_A_QUEUE_XSK)) + goto nla_put_failure; +#endif + break; } genlmsg_end(rsp, hdr); |