2023-03-15 23:03:50 +00:00
|
|
|
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
|
2023-03-06 20:04:57 +00:00
|
|
|
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
name: netdev
|
|
|
|
|
|
|
|
doc:
|
|
|
|
netdev configuration over generic netlink.
|
|
|
|
|
|
|
|
definitions:
|
|
|
|
-
|
|
|
|
type: flags
|
|
|
|
name: xdp-act
|
2023-03-09 12:25:27 +00:00
|
|
|
render-max: true
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
entries:
|
|
|
|
-
|
|
|
|
name: basic
|
|
|
|
doc:
|
2023-07-27 16:29:58 +00:00
|
|
|
XDP features set supported by all drivers
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
(XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)
|
|
|
|
-
|
|
|
|
name: redirect
|
|
|
|
doc:
|
|
|
|
The netdev supports XDP_REDIRECT
|
|
|
|
-
|
|
|
|
name: ndo-xmit
|
|
|
|
doc:
|
|
|
|
This feature informs if netdev implements ndo_xdp_xmit callback.
|
|
|
|
-
|
|
|
|
name: xsk-zerocopy
|
|
|
|
doc:
|
|
|
|
This feature informs if netdev supports AF_XDP in zero copy mode.
|
|
|
|
-
|
|
|
|
name: hw-offload
|
|
|
|
doc:
|
2023-02-23 07:26:56 +00:00
|
|
|
This feature informs if netdev supports XDP hw offloading.
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
-
|
|
|
|
name: rx-sg
|
|
|
|
doc:
|
|
|
|
This feature informs if netdev implements non-linear XDP buffer
|
|
|
|
support in the driver napi callback.
|
|
|
|
-
|
|
|
|
name: ndo-xmit-sg
|
|
|
|
doc:
|
|
|
|
This feature informs if netdev implements non-linear XDP buffer
|
|
|
|
support in ndo_xdp_xmit callback.
|
2023-09-13 17:13:49 +00:00
|
|
|
-
|
|
|
|
type: flags
|
|
|
|
name: xdp-rx-metadata
|
|
|
|
entries:
|
|
|
|
-
|
|
|
|
name: timestamp
|
|
|
|
doc:
|
|
|
|
Device is capable of exposing receive HW timestamp via bpf_xdp_metadata_rx_timestamp().
|
|
|
|
-
|
|
|
|
name: hash
|
|
|
|
doc:
|
|
|
|
Device is capable of exposing receive packet hash via bpf_xdp_metadata_rx_hash().
|
2023-12-05 21:08:38 +00:00
|
|
|
-
|
|
|
|
name: vlan-tag
|
|
|
|
doc:
|
|
|
|
Device is capable of exposing receive packet VLAN tag via bpf_xdp_metadata_rx_vlan_tag().
|
2023-11-27 19:03:08 +00:00
|
|
|
-
|
|
|
|
type: flags
|
|
|
|
name: xsk-flags
|
|
|
|
entries:
|
|
|
|
-
|
|
|
|
name: tx-timestamp
|
|
|
|
doc:
|
|
|
|
HW timestamping egress packets is supported by the driver.
|
|
|
|
-
|
|
|
|
name: tx-checksum
|
|
|
|
doc:
|
|
|
|
L3 checksum HW offload is supported by the driver.
|
2023-12-01 23:28:29 +00:00
|
|
|
-
|
|
|
|
name: queue-type
|
|
|
|
type: enum
|
|
|
|
entries: [ rx, tx ]
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
|
|
|
|
attribute-sets:
|
|
|
|
-
|
|
|
|
name: dev
|
|
|
|
attributes:
|
|
|
|
-
|
|
|
|
name: ifindex
|
|
|
|
doc: netdev ifindex
|
|
|
|
type: u32
|
|
|
|
checks:
|
|
|
|
min: 1
|
|
|
|
-
|
|
|
|
name: pad
|
|
|
|
type: pad
|
|
|
|
-
|
|
|
|
name: xdp-features
|
|
|
|
doc: Bitmask of enabled xdp-features.
|
|
|
|
type: u64
|
|
|
|
enum: xdp-act
|
2023-07-19 13:24:07 +00:00
|
|
|
-
|
2023-07-27 16:29:58 +00:00
|
|
|
name: xdp-zc-max-segs
|
2023-07-19 13:24:07 +00:00
|
|
|
doc: max fragment count supported by ZC driver
|
|
|
|
type: u32
|
|
|
|
checks:
|
|
|
|
min: 1
|
2023-09-13 17:13:49 +00:00
|
|
|
-
|
|
|
|
name: xdp-rx-metadata-features
|
|
|
|
doc: Bitmask of supported XDP receive metadata features.
|
|
|
|
See Documentation/networking/xdp-rx-metadata.rst for more details.
|
|
|
|
type: u64
|
|
|
|
enum: xdp-rx-metadata
|
2023-11-27 19:03:08 +00:00
|
|
|
-
|
|
|
|
name: xsk-features
|
|
|
|
doc: Bitmask of enabled AF_XDP features.
|
|
|
|
type: u64
|
|
|
|
enum: xsk-flags
|
2023-11-26 23:07:33 +00:00
|
|
|
-
|
|
|
|
name: page-pool
|
|
|
|
attributes:
|
|
|
|
-
|
|
|
|
name: id
|
|
|
|
doc: Unique ID of a Page Pool instance.
|
|
|
|
type: uint
|
|
|
|
checks:
|
|
|
|
min: 1
|
|
|
|
max: u32-max
|
|
|
|
-
|
|
|
|
name: ifindex
|
|
|
|
doc: |
|
|
|
|
ifindex of the netdev to which the pool belongs.
|
|
|
|
May be reported as 0 if the page pool was allocated for a netdev
|
|
|
|
which got destroyed already (page pools may outlast their netdevs
|
|
|
|
because they wait for all memory to be returned).
|
|
|
|
type: u32
|
|
|
|
checks:
|
|
|
|
min: 1
|
|
|
|
max: s32-max
|
|
|
|
-
|
|
|
|
name: napi-id
|
|
|
|
doc: Id of NAPI using this Page Pool instance.
|
|
|
|
type: uint
|
|
|
|
checks:
|
|
|
|
min: 1
|
|
|
|
max: u32-max
|
2023-11-26 23:07:36 +00:00
|
|
|
-
|
|
|
|
name: inflight
|
|
|
|
type: uint
|
|
|
|
doc: |
|
|
|
|
Number of outstanding references to this page pool (allocated
|
|
|
|
but yet to be freed pages). Allocated pages may be held in
|
|
|
|
socket receive queues, driver receive ring, page pool recycling
|
|
|
|
ring, the page pool cache, etc.
|
|
|
|
-
|
|
|
|
name: inflight-mem
|
|
|
|
type: uint
|
|
|
|
doc: |
|
|
|
|
Amount of memory held by inflight pages.
|
2023-11-26 23:07:37 +00:00
|
|
|
-
|
|
|
|
name: detach-time
|
|
|
|
type: uint
|
|
|
|
doc: |
|
|
|
|
Seconds in CLOCK_BOOTTIME of when Page Pool was detached by
|
|
|
|
the driver. Once detached Page Pool can no longer be used to
|
|
|
|
allocate memory.
|
|
|
|
Page Pools wait for all the memory allocated from them to be freed
|
|
|
|
before truly disappearing. "Detached" Page Pools cannot be
|
|
|
|
"re-attached", they are just waiting to disappear.
|
|
|
|
Attribute is absent if Page Pool has not been detached, and
|
|
|
|
can still be used to allocate new memory.
|
net: page_pool: expose page pool stats via netlink
Dump the stats into netlink. More clever approaches
like dumping the stats per-CPU for each CPU individually
to see where the packets get consumed can be implemented
in the future.
A trimmed example from a real (but recently booted system):
$ ./cli.py --no-schema --spec netlink/specs/netdev.yaml \
--dump page-pool-stats-get
[{'info': {'id': 19, 'ifindex': 2},
'alloc-empty': 48,
'alloc-fast': 3024,
'alloc-refill': 0,
'alloc-slow': 48,
'alloc-slow-high-order': 0,
'alloc-waive': 0,
'recycle-cache-full': 0,
'recycle-cached': 0,
'recycle-released-refcnt': 0,
'recycle-ring': 0,
'recycle-ring-full': 0},
{'info': {'id': 18, 'ifindex': 2},
'alloc-empty': 66,
'alloc-fast': 11811,
'alloc-refill': 35,
'alloc-slow': 66,
'alloc-slow-high-order': 0,
'alloc-waive': 0,
'recycle-cache-full': 1145,
'recycle-cached': 6541,
'recycle-released-refcnt': 0,
'recycle-ring': 1275,
'recycle-ring-full': 0},
{'info': {'id': 17, 'ifindex': 2},
'alloc-empty': 73,
'alloc-fast': 62099,
'alloc-refill': 413,
...
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-11-26 23:07:38 +00:00
|
|
|
-
|
|
|
|
name: page-pool-info
|
|
|
|
subset-of: page-pool
|
|
|
|
attributes:
|
|
|
|
-
|
|
|
|
name: id
|
|
|
|
-
|
|
|
|
name: ifindex
|
|
|
|
-
|
|
|
|
name: page-pool-stats
|
|
|
|
doc: |
|
|
|
|
Page pool statistics, see docs for struct page_pool_stats
|
|
|
|
for information about individual statistics.
|
|
|
|
attributes:
|
|
|
|
-
|
|
|
|
name: info
|
|
|
|
doc: Page pool identifying information.
|
|
|
|
type: nest
|
|
|
|
nested-attributes: page-pool-info
|
|
|
|
-
|
|
|
|
name: alloc-fast
|
|
|
|
type: uint
|
|
|
|
value: 8 # reserve some attr ids in case we need more metadata later
|
|
|
|
-
|
|
|
|
name: alloc-slow
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: alloc-slow-high-order
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: alloc-empty
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: alloc-refill
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: alloc-waive
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: recycle-cached
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: recycle-cache-full
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: recycle-ring
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: recycle-ring-full
|
|
|
|
type: uint
|
|
|
|
-
|
|
|
|
name: recycle-released-refcnt
|
|
|
|
type: uint
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
|
2023-12-01 23:28:51 +00:00
|
|
|
-
|
|
|
|
name: napi
|
|
|
|
attributes:
|
|
|
|
-
|
|
|
|
name: ifindex
|
|
|
|
doc: ifindex of the netdevice to which NAPI instance belongs.
|
|
|
|
type: u32
|
|
|
|
checks:
|
|
|
|
min: 1
|
|
|
|
-
|
|
|
|
name: id
|
|
|
|
doc: ID of the NAPI instance.
|
|
|
|
type: u32
|
2023-12-01 23:29:02 +00:00
|
|
|
-
|
|
|
|
name: irq
|
|
|
|
doc: The associated interrupt vector number for the napi
|
|
|
|
type: u32
|
2023-12-01 23:29:13 +00:00
|
|
|
-
|
|
|
|
name: pid
|
|
|
|
doc: PID of the napi thread, if NAPI is configured to operate in
|
|
|
|
threaded mode. If NAPI is not in threaded mode (i.e. uses normal
|
|
|
|
softirq context), the attribute will be absent.
|
|
|
|
type: u32
|
2023-12-01 23:28:29 +00:00
|
|
|
-
|
|
|
|
name: queue
|
|
|
|
attributes:
|
|
|
|
-
|
|
|
|
name: id
|
|
|
|
doc: Queue index; most queue types are indexed like a C array, with
|
|
|
|
indexes starting at 0 and ending at queue count - 1. Queue indexes
|
|
|
|
are scoped to an interface and queue type.
|
|
|
|
type: u32
|
|
|
|
-
|
|
|
|
name: ifindex
|
|
|
|
doc: ifindex of the netdevice to which the queue belongs.
|
|
|
|
type: u32
|
|
|
|
checks:
|
|
|
|
min: 1
|
|
|
|
-
|
|
|
|
name: type
|
|
|
|
doc: Queue type as rx, tx. Each queue type defines a separate ID space.
|
|
|
|
type: u32
|
|
|
|
enum: queue-type
|
|
|
|
-
|
|
|
|
name: napi-id
|
|
|
|
doc: ID of the NAPI instance which services this queue.
|
|
|
|
type: u32
|
|
|
|
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
operations:
|
|
|
|
list:
|
|
|
|
-
|
|
|
|
name: dev-get
|
|
|
|
doc: Get / dump information about a netdev.
|
|
|
|
attribute-set: dev
|
|
|
|
do:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- ifindex
|
|
|
|
reply: &dev-all
|
|
|
|
attributes:
|
|
|
|
- ifindex
|
|
|
|
- xdp-features
|
2023-07-27 16:29:58 +00:00
|
|
|
- xdp-zc-max-segs
|
2023-09-13 17:13:49 +00:00
|
|
|
- xdp-rx-metadata-features
|
2023-11-27 19:03:08 +00:00
|
|
|
- xsk-features
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
dump:
|
|
|
|
reply: *dev-all
|
|
|
|
-
|
|
|
|
name: dev-add-ntf
|
|
|
|
doc: Notification about device appearing.
|
|
|
|
notify: dev-get
|
|
|
|
mcgrp: mgmt
|
|
|
|
-
|
|
|
|
name: dev-del-ntf
|
|
|
|
doc: Notification about device disappearing.
|
|
|
|
notify: dev-get
|
|
|
|
mcgrp: mgmt
|
|
|
|
-
|
|
|
|
name: dev-change-ntf
|
|
|
|
doc: Notification about device configuration being changed.
|
|
|
|
notify: dev-get
|
|
|
|
mcgrp: mgmt
|
2023-11-26 23:07:33 +00:00
|
|
|
-
|
|
|
|
name: page-pool-get
|
|
|
|
doc: |
|
|
|
|
Get / dump information about Page Pools.
|
|
|
|
(Only Page Pools associated with a net_device can be listed.)
|
|
|
|
attribute-set: page-pool
|
|
|
|
do:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- id
|
|
|
|
reply: &pp-reply
|
|
|
|
attributes:
|
|
|
|
- id
|
|
|
|
- ifindex
|
|
|
|
- napi-id
|
2023-11-26 23:07:36 +00:00
|
|
|
- inflight
|
|
|
|
- inflight-mem
|
2023-11-26 23:07:37 +00:00
|
|
|
- detach-time
|
2023-11-26 23:07:33 +00:00
|
|
|
dump:
|
|
|
|
reply: *pp-reply
|
|
|
|
config-cond: page-pool
|
2023-11-26 23:07:35 +00:00
|
|
|
-
|
|
|
|
name: page-pool-add-ntf
|
|
|
|
doc: Notification about page pool appearing.
|
|
|
|
notify: page-pool-get
|
|
|
|
mcgrp: page-pool
|
|
|
|
config-cond: page-pool
|
|
|
|
-
|
|
|
|
name: page-pool-del-ntf
|
|
|
|
doc: Notification about page pool disappearing.
|
|
|
|
notify: page-pool-get
|
|
|
|
mcgrp: page-pool
|
|
|
|
config-cond: page-pool
|
|
|
|
-
|
|
|
|
name: page-pool-change-ntf
|
|
|
|
doc: Notification about page pool configuration being changed.
|
|
|
|
notify: page-pool-get
|
|
|
|
mcgrp: page-pool
|
|
|
|
config-cond: page-pool
|
net: page_pool: expose page pool stats via netlink
Dump the stats into netlink. More clever approaches
like dumping the stats per-CPU for each CPU individually
to see where the packets get consumed can be implemented
in the future.
A trimmed example from a real (but recently booted system):
$ ./cli.py --no-schema --spec netlink/specs/netdev.yaml \
--dump page-pool-stats-get
[{'info': {'id': 19, 'ifindex': 2},
'alloc-empty': 48,
'alloc-fast': 3024,
'alloc-refill': 0,
'alloc-slow': 48,
'alloc-slow-high-order': 0,
'alloc-waive': 0,
'recycle-cache-full': 0,
'recycle-cached': 0,
'recycle-released-refcnt': 0,
'recycle-ring': 0,
'recycle-ring-full': 0},
{'info': {'id': 18, 'ifindex': 2},
'alloc-empty': 66,
'alloc-fast': 11811,
'alloc-refill': 35,
'alloc-slow': 66,
'alloc-slow-high-order': 0,
'alloc-waive': 0,
'recycle-cache-full': 1145,
'recycle-cached': 6541,
'recycle-released-refcnt': 0,
'recycle-ring': 1275,
'recycle-ring-full': 0},
{'info': {'id': 17, 'ifindex': 2},
'alloc-empty': 73,
'alloc-fast': 62099,
'alloc-refill': 413,
...
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-11-26 23:07:38 +00:00
|
|
|
-
|
|
|
|
name: page-pool-stats-get
|
|
|
|
doc: Get page pool statistics.
|
|
|
|
attribute-set: page-pool-stats
|
|
|
|
do:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- info
|
|
|
|
reply: &pp-stats-reply
|
|
|
|
attributes:
|
|
|
|
- info
|
|
|
|
- alloc-fast
|
|
|
|
- alloc-slow
|
|
|
|
- alloc-slow-high-order
|
|
|
|
- alloc-empty
|
|
|
|
- alloc-refill
|
|
|
|
- alloc-waive
|
|
|
|
- recycle-cached
|
|
|
|
- recycle-cache-full
|
|
|
|
- recycle-ring
|
|
|
|
- recycle-ring-full
|
|
|
|
- recycle-released-refcnt
|
|
|
|
dump:
|
|
|
|
reply: *pp-stats-reply
|
|
|
|
config-cond: page-pool-stats
|
2023-12-01 23:28:29 +00:00
|
|
|
-
|
|
|
|
name: queue-get
|
|
|
|
doc: Get queue information from the kernel.
|
|
|
|
Only configured queues will be reported (as opposed to all available
|
|
|
|
hardware queues).
|
|
|
|
attribute-set: queue
|
|
|
|
do:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- ifindex
|
|
|
|
- type
|
|
|
|
- id
|
|
|
|
reply: &queue-get-op
|
|
|
|
attributes:
|
|
|
|
- id
|
|
|
|
- type
|
|
|
|
- napi-id
|
|
|
|
- ifindex
|
|
|
|
dump:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- ifindex
|
|
|
|
reply: *queue-get-op
|
2023-12-01 23:28:51 +00:00
|
|
|
-
|
|
|
|
name: napi-get
|
|
|
|
doc: Get information about NAPI instances configured on the system.
|
|
|
|
attribute-set: napi
|
|
|
|
do:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- id
|
|
|
|
reply: &napi-get-op
|
|
|
|
attributes:
|
|
|
|
- id
|
|
|
|
- ifindex
|
2023-12-01 23:29:02 +00:00
|
|
|
- irq
|
2023-12-01 23:29:13 +00:00
|
|
|
- pid
|
2023-12-01 23:28:51 +00:00
|
|
|
dump:
|
|
|
|
request:
|
|
|
|
attributes:
|
|
|
|
- ifindex
|
|
|
|
reply: *napi-get-op
|
netdev-genl: create a simple family for netdev stuff
Add a Netlink spec-compatible family for netdevs.
This is a very simple implementation without much
thought going into it.
It allows us to reap all the benefits of Netlink specs,
one can use the generic client to issue the commands:
$ ./cli.py --spec netdev.yaml --dump dev_get
[{'ifindex': 1, 'xdp-features': set()},
{'ifindex': 2, 'xdp-features': {'basic', 'ndo-xmit', 'redirect'}},
{'ifindex': 3, 'xdp-features': {'rx-sg'}}]
the generic python library does not have flags-by-name
support, yet, but we also don't have to carry strings
in the messages, as user space can get the names from
the spec.
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Co-developed-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Co-developed-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Marek Majtyka <alardam@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/327ad9c9868becbe1e601b580c962549c8cd81f2.1675245258.git.lorenzo@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-02-01 10:24:17 +00:00
|
|
|
|
|
|
|
mcast-groups:
|
|
|
|
list:
|
|
|
|
-
|
|
|
|
name: mgmt
|
2023-11-26 23:07:35 +00:00
|
|
|
-
|
|
|
|
name: page-pool
|