aboutsummaryrefslogtreecommitdiff
path: root/tools/net/ynl/generated/netdev-user.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-12-04 18:04:08 -0800
committerJakub Kicinski <kuba@kernel.org>2023-12-04 18:04:09 -0800
commita90d56049acc45802f67cd7d4c058ac45b1bc26f (patch)
treebe114090f7ef16761647fd78573ca7b4fe6a40e8 /tools/net/ynl/generated/netdev-user.h
parent3706f141e5639d3034bd83448e929b8462362651 (diff)
parente3b57ffdb3256e4ff2cf83be0dc076c4b07f92b9 (diff)
Merge branch 'introduce-queue-and-napi-support-in-netdev-genl-was-introduce-napi-queues-support'
Amritha Nambiar says: ==================== Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support) Add the capability to export the following via netdev-genl interface: - queue information supported by the device - NAPI information supported by the device Introduce support for associating queue and NAPI instance. Extend the netdev_genl generic netlink family for netdev with queue and NAPI data. The queue parameters exposed are: - queue index - queue type - ifindex - NAPI id associated with the queue Additional rx and tx queue parameters can be exposed in follow up patches by stashing them in netdev queue structures. XDP queue type can also be supported in future. The NAPI fields exposed are: - NAPI id - NAPI device ifindex - Interrupt number associated with the NAPI instance - PID for the NAPI thread This series only supports 'get' ability for retrieving certain queue and NAPI attributes. The 'set' ability for configuring queue and associated NAPI instance via netdev-genl will be submitted as a separate patch series. Previous discussion at: https://lore.kernel.org/netdev/c8476530638a5f4381d64db0e024ed49c2db3b02.camel@gmail.com/T/#m00999652a8b4731fbdb7bf698d2e3666c65a60e7 $ ./cli.py --spec netdev.yaml --do queue-get --json='{"ifindex": 12, "id": 0, "type": 0}' {'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'rx'} $ ./cli.py --spec netdev.yaml --do queue-get --json='{"ifindex": 12, "id": 0, "type": 1}' {'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'tx'} $ ./cli.py --spec netdev.yaml --dump queue-get --json='{"ifindex": 12}' [{'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'rx'}, {'id': 1, 'ifindex': 12, 'napi-id': 594, 'type': 'rx'}, {'id': 2, 'ifindex': 12, 'napi-id': 595, 'type': 'rx'}, {'id': 3, 'ifindex': 12, 'napi-id': 596, 'type': 'rx'}, {'id': 0, 'ifindex': 12, 'napi-id': 593, 'type': 'tx'}, {'id': 1, 'ifindex': 12, 'napi-id': 594, 'type': 'tx'}, {'id': 2, 'ifindex': 12, 'napi-id': 595, 'type': 'tx'}, {'id': 3, 'ifindex': 12, 'napi-id': 596, 'type': 'tx'}] $ ./cli.py --spec netdev.yaml --do napi-get --json='{"id": 593}' {'id': 593, 'ifindex': 12, 'irq': 291, 'pid': 3727} $ ./cli.py --spec netdev.yaml --dump napi-get --json='{"ifindex": 12}' [{'id': 596, 'ifindex': 12, 'irq': 294, 'pid': 3724}, {'id': 595, 'ifindex': 12, 'irq': 293, 'pid': 3725}, {'id': 594, 'ifindex': 12, 'irq': 292, 'pid': 3726}, {'id': 593, 'ifindex': 12, 'irq': 291, 'pid': 3727}] ==================== Link: https://lore.kernel.org/r/170147307026.5260.9300080745237900261.stgit@anambiarhost.jf.intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net/ynl/generated/netdev-user.h')
-rw-r--r--tools/net/ynl/generated/netdev-user.h178
1 files changed, 178 insertions, 0 deletions
diff --git a/tools/net/ynl/generated/netdev-user.h b/tools/net/ynl/generated/netdev-user.h
index cc3d80d1cf8c..3830cf2ab6b8 100644
--- a/tools/net/ynl/generated/netdev-user.h
+++ b/tools/net/ynl/generated/netdev-user.h
@@ -20,6 +20,7 @@ const char *netdev_op_str(int op);
const char *netdev_xdp_act_str(enum netdev_xdp_act value);
const char *netdev_xdp_rx_metadata_str(enum netdev_xdp_rx_metadata value);
const char *netdev_xsk_flags_str(enum netdev_xsk_flags value);
+const char *netdev_queue_type_str(enum netdev_queue_type value);
/* Common nested types */
struct netdev_page_pool_info {
@@ -261,4 +262,181 @@ netdev_page_pool_stats_get_list_free(struct netdev_page_pool_stats_get_list *rsp
struct netdev_page_pool_stats_get_list *
netdev_page_pool_stats_get_dump(struct ynl_sock *ys);
+/* ============== NETDEV_CMD_QUEUE_GET ============== */
+/* NETDEV_CMD_QUEUE_GET - do */
+struct netdev_queue_get_req {
+ struct {
+ __u32 ifindex:1;
+ __u32 type:1;
+ __u32 id:1;
+ } _present;
+
+ __u32 ifindex;
+ enum netdev_queue_type type;
+ __u32 id;
+};
+
+static inline struct netdev_queue_get_req *netdev_queue_get_req_alloc(void)
+{
+ return calloc(1, sizeof(struct netdev_queue_get_req));
+}
+void netdev_queue_get_req_free(struct netdev_queue_get_req *req);
+
+static inline void
+netdev_queue_get_req_set_ifindex(struct netdev_queue_get_req *req,
+ __u32 ifindex)
+{
+ req->_present.ifindex = 1;
+ req->ifindex = ifindex;
+}
+static inline void
+netdev_queue_get_req_set_type(struct netdev_queue_get_req *req,
+ enum netdev_queue_type type)
+{
+ req->_present.type = 1;
+ req->type = type;
+}
+static inline void
+netdev_queue_get_req_set_id(struct netdev_queue_get_req *req, __u32 id)
+{
+ req->_present.id = 1;
+ req->id = id;
+}
+
+struct netdev_queue_get_rsp {
+ struct {
+ __u32 id:1;
+ __u32 type:1;
+ __u32 napi_id:1;
+ __u32 ifindex:1;
+ } _present;
+
+ __u32 id;
+ enum netdev_queue_type type;
+ __u32 napi_id;
+ __u32 ifindex;
+};
+
+void netdev_queue_get_rsp_free(struct netdev_queue_get_rsp *rsp);
+
+/*
+ * Get queue information from the kernel. Only configured queues will be reported (as opposed to all available hardware queues).
+ */
+struct netdev_queue_get_rsp *
+netdev_queue_get(struct ynl_sock *ys, struct netdev_queue_get_req *req);
+
+/* NETDEV_CMD_QUEUE_GET - dump */
+struct netdev_queue_get_req_dump {
+ struct {
+ __u32 ifindex:1;
+ } _present;
+
+ __u32 ifindex;
+};
+
+static inline struct netdev_queue_get_req_dump *
+netdev_queue_get_req_dump_alloc(void)
+{
+ return calloc(1, sizeof(struct netdev_queue_get_req_dump));
+}
+void netdev_queue_get_req_dump_free(struct netdev_queue_get_req_dump *req);
+
+static inline void
+netdev_queue_get_req_dump_set_ifindex(struct netdev_queue_get_req_dump *req,
+ __u32 ifindex)
+{
+ req->_present.ifindex = 1;
+ req->ifindex = ifindex;
+}
+
+struct netdev_queue_get_list {
+ struct netdev_queue_get_list *next;
+ struct netdev_queue_get_rsp obj __attribute__((aligned(8)));
+};
+
+void netdev_queue_get_list_free(struct netdev_queue_get_list *rsp);
+
+struct netdev_queue_get_list *
+netdev_queue_get_dump(struct ynl_sock *ys,
+ struct netdev_queue_get_req_dump *req);
+
+/* ============== NETDEV_CMD_NAPI_GET ============== */
+/* NETDEV_CMD_NAPI_GET - do */
+struct netdev_napi_get_req {
+ struct {
+ __u32 id:1;
+ } _present;
+
+ __u32 id;
+};
+
+static inline struct netdev_napi_get_req *netdev_napi_get_req_alloc(void)
+{
+ return calloc(1, sizeof(struct netdev_napi_get_req));
+}
+void netdev_napi_get_req_free(struct netdev_napi_get_req *req);
+
+static inline void
+netdev_napi_get_req_set_id(struct netdev_napi_get_req *req, __u32 id)
+{
+ req->_present.id = 1;
+ req->id = id;
+}
+
+struct netdev_napi_get_rsp {
+ struct {
+ __u32 id:1;
+ __u32 ifindex:1;
+ __u32 irq:1;
+ __u32 pid:1;
+ } _present;
+
+ __u32 id;
+ __u32 ifindex;
+ __u32 irq;
+ __u32 pid;
+};
+
+void netdev_napi_get_rsp_free(struct netdev_napi_get_rsp *rsp);
+
+/*
+ * Get information about NAPI instances configured on the system.
+ */
+struct netdev_napi_get_rsp *
+netdev_napi_get(struct ynl_sock *ys, struct netdev_napi_get_req *req);
+
+/* NETDEV_CMD_NAPI_GET - dump */
+struct netdev_napi_get_req_dump {
+ struct {
+ __u32 ifindex:1;
+ } _present;
+
+ __u32 ifindex;
+};
+
+static inline struct netdev_napi_get_req_dump *
+netdev_napi_get_req_dump_alloc(void)
+{
+ return calloc(1, sizeof(struct netdev_napi_get_req_dump));
+}
+void netdev_napi_get_req_dump_free(struct netdev_napi_get_req_dump *req);
+
+static inline void
+netdev_napi_get_req_dump_set_ifindex(struct netdev_napi_get_req_dump *req,
+ __u32 ifindex)
+{
+ req->_present.ifindex = 1;
+ req->ifindex = ifindex;
+}
+
+struct netdev_napi_get_list {
+ struct netdev_napi_get_list *next;
+ struct netdev_napi_get_rsp obj __attribute__((aligned(8)));
+};
+
+void netdev_napi_get_list_free(struct netdev_napi_get_list *rsp);
+
+struct netdev_napi_get_list *
+netdev_napi_get_dump(struct ynl_sock *ys, struct netdev_napi_get_req_dump *req);
+
#endif /* _LINUX_NETDEV_GEN_H */