@@ -286,6 +286,8 @@ attribute-sets:
-
name: type
doc: Queue type as rx, tx. Each queue type defines a separate ID space.
+ XDP TX queues allocated in the kernel are not linked to NAPIs and
+ thus not listed. AF_XDP queues have the xsk attribute set.
type: u32
enum: queue-type
-
@@ -296,7 +298,12 @@ attribute-sets:
name: dmabuf
doc: ID of the dmabuf attached to this queue, if any.
type: u32
-
+ -
+ name: xsk
+ doc: Non-zero for queues which are used for XSK (AF_XDP), 0 otherwise.
+ type: u32
+ checks:
+ max: 1
-
name: qstats
doc: |
@@ -637,6 +644,7 @@ operations:
- napi-id
- ifindex
- dmabuf
+ - xsk
dump:
request:
attributes:
@@ -136,6 +136,7 @@ enum {
NETDEV_A_QUEUE_TYPE,
NETDEV_A_QUEUE_NAPI_ID,
NETDEV_A_QUEUE_DMABUF,
+ NETDEV_A_QUEUE_XSK,
__NETDEV_A_QUEUE_MAX,
NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)
@@ -394,12 +394,18 @@ netdev_nl_queue_fill_one(struct sk_buff *rsp, struct net_device *netdev,
nla_put_u32(rsp, NETDEV_A_QUEUE_DMABUF, binding->id))
goto nla_put_failure;
+ if (nla_put_u32(rsp, NETDEV_A_QUEUE_XSK, !!rxq->pool))
+ goto nla_put_failure;
+
break;
case NETDEV_QUEUE_TYPE_TX:
txq = netdev_get_tx_queue(netdev, q_idx);
if (txq->napi && nla_put_u32(rsp, NETDEV_A_QUEUE_NAPI_ID,
txq->napi->napi_id))
goto nla_put_failure;
+
+ if (nla_put_u32(rsp, NETDEV_A_QUEUE_XSK, !!txq->pool))
+ goto nla_put_failure;
}
genlmsg_end(rsp, hdr);
@@ -136,6 +136,7 @@ enum {
NETDEV_A_QUEUE_TYPE,
NETDEV_A_QUEUE_NAPI_ID,
NETDEV_A_QUEUE_DMABUF,
+ NETDEV_A_QUEUE_XSK,
__NETDEV_A_QUEUE_MAX,
NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)
Expose a new per-queue attribute, xsk, which indicates that a queue is being used for AF_XDP. Update the documentation to more explicitly state which queue types are linked. Signed-off-by: Joe Damato <jdamato@fastly.com> --- Documentation/netlink/specs/netdev.yaml | 10 +++++++++- include/uapi/linux/netdev.h | 1 + net/core/netdev-genl.c | 6 ++++++ tools/include/uapi/linux/netdev.h | 1 + 4 files changed, 17 insertions(+), 1 deletion(-)