android_kernel_msm-6.1_noth.../include/uapi/linux
Petr Machata 9309f97aef net: dev: Add hardware stats support
Offloading switch device drivers may be able to collect statistics of the
traffic taking place in the HW datapath that pertains to a certain soft
netdevice, such as VLAN. Add the necessary infrastructure to allow exposing
these statistics to the offloaded netdevice in question. The API was shaped
by the following considerations:

- Collection of HW statistics is not free: there may be a finite number of
  counters, and the act of counting may have a performance impact. It is
  therefore necessary to allow toggling whether HW counting should be done
  for any particular SW netdevice.

- As the drivers are loaded and removed, a particular device may get
  offloaded and unoffloaded again. At the same time, the statistics values
  need to stay monotonic (modulo the eventual 64-bit wraparound),
  increasing only to reflect traffic measured in the device.

  To that end, the netdevice keeps around a lazily-allocated copy of struct
  rtnl_link_stats64. Device drivers then contribute to the values kept
  therein at various points. Even as the driver goes away, the struct stays
  around to maintain the statistics values.

- Different HW devices may be able to count different things. The
  motivation behind this patch in particular is exposure of HW counters on
  Nvidia Spectrum switches, where the only practical approach to counting
  traffic on offloaded soft netdevices currently is to use router interface
  counters, and count L3 traffic. Correspondingly that is the statistics
  suite added in this patch.

  Other devices may be able to measure different kinds of traffic, and for
  that reason, the APIs are built to allow uniform access to different
  statistics suites.

- Because soft netdevices and offloading drivers are only loosely bound, a
  netdevice uses a notifier chain to communicate with the drivers. Several
  new notifiers, NETDEV_OFFLOAD_XSTATS_*, have been added to carry messages
  to the offloading drivers.

- Devices can have various conditions for when a particular counter is
  available. As the device is configured and reconfigured, the device
  offload may become or cease being suitable for counter binding. A
  netdevice can use a notifier type NETDEV_OFFLOAD_XSTATS_REPORT_USED to
  ping offloading drivers and determine whether anyone currently implements
  a given statistics suite. This information can then be propagated to user
  space.

  When the driver decides to unoffload a netdevice, it can use a
  newly-added function, netdev_offload_xstats_report_delta(), to record
  outstanding collected statistics, before destroying the HW counter.

This patch adds a helper, call_netdevice_notifiers_info_robust(), for
dispatching a notifier with the possibility of unwind when one of the
consumers bails. Given the wish to eventually get rid of the global
notifier block altogether, this helper only invokes the per-netns notifier
block.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-03 10:37:23 +00:00
..
android binder: fix freeze race 2021-09-14 08:46:08 +02:00
byteorder uapi: Fix undefined __always_inline on non-glibc systems 2021-12-21 15:09:46 -08:00
caif
can can: netlink: report the CAN controller mode supported flags 2022-01-05 12:09:06 +01:00
cifs cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
dvb Revert "media: dvb header files: move some headers to staging" 2021-08-23 09:49:09 -07:00
genwqe
hdlc
hsi
iio
isdn
misc
mmc
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-10 17:29:56 -08:00
netfilter_arp
netfilter_bridge
netfilter_ipv4
netfilter_ipv6
nfsd NFSD: move filehandle format declarations out of "uapi". 2021-10-02 15:50:45 -04:00
raid
sched
spi
sunrpc
surface_aggregator
tc_act
tc_ematch
usb
a.out.h
acct.h
acrn.h virt: acrn: Introduce interfaces for virtual device creating/destroying 2021-10-05 16:14:10 +02:00
adb.h
adfs_fs.h
affs_hardblocks.h
agpgart.h
aio_abi.h
am437x-vpfe.h
amt.h amt: add control plane of amt interface 2021-11-01 13:36:08 +00:00
apm_bios.h
arcfb.h
arm_sdei.h
aspeed-lpc-ctrl.h
aspeed-p2a-ctrl.h
atalk.h
atm.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_tcp.h
atm_zatm.h
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
audit.h audit: replace zero-length array with flexible-array member 2021-12-20 14:53:27 -05:00
auto_dev-ioctl.h
auto_fs.h
auto_fs4.h
auxvec.h
ax25.h
batadv_packet.h
batman_adv.h
baycom.h
bcm933xx_hcs.h
bfs_fs.h
binfmts.h
blkpg.h
blktrace_api.h
blkzoned.h
bpf.h bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide 2022-02-09 11:40:45 -08:00
bpf_common.h
bpf_perf_event.h
bpfilter.h
bpqether.h
bsg.h
bt-bmc.h
btf.h bpf: Support BTF_KIND_TYPE_TAG for btf_type_tag attributes 2021-11-11 17:41:11 -08:00
btrfs.h btrfs: send: prepare for v2 protocol 2021-10-29 12:38:43 +02:00
btrfs_tree.h btrfs: remove no longer needed logic for replaying directory deletes 2022-01-03 15:09:42 +01:00
can.h
capability.h
capi.h
cciss_defs.h
cciss_ioctl.h
ccs.h
cdrom.h drivers/cdrom: improved ioctl for media change detection 2021-09-14 20:05:26 -06:00
cec-funcs.h
cec.h
cfm_bridge.h
cgroupstats.h
chio.h
close_range.h
cm4000_cs.h
cn_proc.h
coda.h
coff.h
comedi.h comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
connector.h
const.h
coresight-stm.h
counter.h counter: Add character device interface 2021-10-17 10:53:52 +01:00
cramfs_fs.h
cryptouser.h
cuda.h
cxl_mem.h cxl/uapi: Fix defined but not used warnings 2021-09-07 11:39:01 -07:00
cyclades.h tty: Partially revert the removal of the Cyclades public API 2022-01-26 14:49:46 +01:00
cycx_cfm.h
dcbnl.h
dccp.h
devlink.h devlink: report maximum number of snapshots with regions 2021-10-01 14:28:55 +01:00
dlm.h
dlm_device.h treewide: Replace 0-element memcpy() destinations with flexible arrays 2021-10-18 12:28:53 -07:00
dlm_netlink.h
dlm_plock.h
dlmconstants.h
dm-ioctl.h dm ima: measure data on table load 2021-08-10 13:32:40 -04:00
dm-log-userspace.h
dma-buf.h
dma-heap.h
dn.h
dns_resolver.h
dqblk_xfs.h
edd.h
efs_fs_sb.h
elf-em.h
elf-fdpic.h
elf.h
errno.h
errqueue.h
erspan.h
ethtool.h ethtool: add support to set/get tx copybreak buf size via ethtool 2021-11-22 12:31:47 +00:00
ethtool_netlink.h ethtool: add support to set/get completion queue event size 2022-02-23 20:33:05 -08:00
eventpoll.h
f2fs.h
fadvise.h
falloc.h
fanotify.h fanotify: report old and/or new parent+name in FAN_RENAME event 2021-12-15 15:57:31 +01:00
fb.h
fcntl.h
fd.h
fdreg.h
fib_rules.h
fiemap.h
filter.h
firewire-cdev.h
firewire-constants.h
fou.h
fpga-dfl.h
fs.h
fscrypt.h
fsi.h
fsl_hypervisor.h
fsl_mc.h
fsmap.h
fsverity.h
fuse.h fuse: support per inode DAX in fuse protocol 2021-12-14 11:09:36 +01:00
futex.h futex: Implement sys_futex_waitv() 2021-10-07 13:51:11 +02:00
gameport.h
gen_stats.h
genetlink.h
gfs2_ondisk.h
gpio.h
gsmmux.h
gtp.h
hash_info.h
hdlc.h
hdlcdrv.h
hdreg.h
hid.h
hiddev.h
hidraw.h
hpet.h
hsr_netlink.h
hw_breakpoint.h
hyperv.h hyper-v: Replace uuid.h with types.h 2021-10-06 12:05:51 +00:00
i2c-dev.h Revert "Merge branch 'mctp-i2c-driver'" 2021-11-15 07:53:10 -08:00
i2c.h Revert "Merge branch 'mctp-i2c-driver'" 2021-11-15 07:53:10 -08:00
i2o-dev.h
i8k.h
icmp.h
icmpv6.h
idxd.h dmaengine: idxd: change MSIX allocation based on per wq activation 2022-01-05 13:11:22 +05:30
if.h
if_addr.h net: Add new protocol attribute to IP addresses 2022-02-18 21:20:06 -08:00
if_addrlabel.h
if_alg.h
if_arcnet.h
if_arp.h
if_bonding.h
if_bridge.h net: bridge: vlan: convert mcast router global option to per-vlan entry 2021-08-20 15:00:35 +01:00
if_cablemodem.h
if_eql.h
if_ether.h if_ether.h: add EtherCAT Ethertype 2022-03-01 18:29:27 -08:00
if_fc.h
if_fddi.h
if_hippi.h
if_infiniband.h
if_link.h net: dev: Add hardware stats support 2022-03-03 10:37:23 +00:00
if_ltalk.h
if_macsec.h
if_packet.h
if_phonet.h
if_plip.h
if_ppp.h
if_pppol2tp.h
if_pppox.h
if_slip.h
if_team.h
if_tun.h
if_tunnel.h
if_vlan.h
if_x25.h
if_xdp.h
ife.h
igmp.h
ila.h
in.h net/ipv4/ipv6: Replace one-element arraya with flexible-array members 2021-08-05 11:46:42 +01:00
in6.h
in_route.h
inet_diag.h
inotify.h
input-event-codes.h
input.h
io_uring.h io_uring: add option to skip CQE posting 2021-11-24 11:17:53 -07:00
ioam6.h
ioam6_genl.h
ioam6_iptunnel.h uapi: ioam: Insertion frequency 2022-02-04 20:24:45 -08:00
ioctl.h
iommu.h
ioprio.h block: fix default IO priority handling 2021-08-18 07:23:15 -06:00
ip.h net: arp: introduce arp_evict_nocarrier sysctl parameter 2021-11-01 19:57:14 -07:00
ip6_tunnel.h
ip_vs.h
ipc.h
ipmi.h ipmi: Add support for IPMB direct messages 2021-10-05 06:54:16 -05:00
ipmi_bmc.h
ipmi_msgdefs.h
ipsec.h
ipv6.h net: ndisc: introduce ndisc_evict_nocarrier sysctl parameter 2021-11-01 19:57:14 -07:00
ipv6_route.h
irqnr.h
iso_fs.h
isst_if.h
ivtv.h
ivtvfb.h
jffs2.h
joystick.h
kcm.h
kcmp.h
kcov.h
kd.h
kdev_t.h
kernel-page-flags.h
kernel.h
kernelcapi.h
kexec.h
keyboard.h
keyctl.h
kfd_ioctl.h drm/amdkfd: Allow querying SVM attributes that are clear 2021-08-06 16:12:32 -04:00
kfd_sysfs.h drm/amdkfd: make SPDX License expression more sound 2022-01-11 15:44:27 -05:00
kvm.h kvm: Move KVM_GET_XSAVE2 IOCTL definition at the end of kvm.h 2022-01-31 09:21:56 -05:00
kvm_para.h
l2tp.h
landlock.h
libc-compat.h
limits.h
lirc.h
llc.h
loop.h
lp.h
lwtunnel.h
magic.h The highlight is the new mount "device" string syntax implemented 2022-01-20 13:46:20 +02:00
major.h
map_to_7segment.h
map_to_14segment.h uapi: Add <linux/map_to_14segment.h> 2021-10-21 23:36:28 +02:00
matroxfb.h
max2175.h
mctp.h mctp: Add SIOCMCTP{ALLOC,DROP}TAG ioctls for tag control 2022-02-09 12:00:11 +00:00
mdio.h net: phy: add constants for fast retrain related register 2021-10-25 14:04:18 +01:00
media-bus-format.h
media.h
mei.h
membarrier.h
memfd.h
mempolicy.h mm/mempolicy: add MPOL_PREFERRED_MANY for multiple preferred nodes 2021-09-03 09:58:17 -07:00
meye.h
mii.h
minix_fs.h
mman.h
mmtimer.h
module.h module: add in-kernel support for decompressing 2022-01-11 18:45:02 -08:00
mount.h
mpls.h
mpls_iptunnel.h
mptcp.h mptcp: add missing documented NL params 2021-12-14 18:49:40 -08:00
mqueue.h
mroute.h
mroute6.h net: ip6mr: add support for passing full packet on wrong mif 2022-02-19 16:05:54 +00:00
mrp_bridge.h
msdos_fs.h
msg.h
mtio.h
nbd-netlink.h
nbd.h
ncsi.h
ndctl.h
neighbour.h net, neigh: Add NTF_MANAGED flag for managed neighbor entries 2021-10-12 11:27:47 +01:00
net.h
net_dropmon.h net: drop_monitor: support drop reason 2022-02-09 17:25:57 -08:00
net_namespace.h
net_tstamp.h net_tstamp: define new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-29 12:31:36 -08:00
netconf.h
netdevice.h
netfilter.h netfilter: Introduce egress hook 2021-10-14 23:06:28 +02:00
netfilter_arp.h
netfilter_bridge.h
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netlink.h
netlink_diag.h
netrom.h
nexthop.h
nfc.h nfc: uapi: use kernel size_t to fix user-space builds 2021-12-27 14:58:37 +00:00
nfs.h
nfs2.h
nfs3.h
nfs4.h
nfs4_mount.h
nfs_fs.h
nfs_idmap.h
nfs_mount.h
nfsacl.h
nilfs2_api.h
nilfs2_ondisk.h
nitro_enclaves.h nitro_enclaves: Add fixes for checkpatch spell check reports 2021-09-14 11:11:20 +02:00
nl80211-vnd-intel.h nl80211: vendor-cmd: intel: add more details for IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP 2021-10-21 17:25:17 +02:00
nl80211.h nl80211: clarify comment for mesh PLINK_BLOCKED state 2022-01-04 15:50:23 +01:00
nsfs.h
nubus.h
nvme_ioctl.h
nvram.h
omap3isp.h
omapfb.h
oom.h
openat2.h
openvswitch.h net: openvswitch: IPv6: Add IPv6 extension header support 2022-02-25 10:32:55 +00:00
packet_diag.h
param.h
parport.h
patchkey.h
pci.h
pci_regs.h pci-v5.17-changes 2022-01-16 08:08:11 +02:00
pcitest.h
perf_event.h perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures 2022-02-02 13:11:40 +01:00
personality.h
pfkeyv2.h xfrm: Add support for SM4 symmetric cipher algorithm 2021-12-23 09:32:51 +01:00
pfrut.h ACPI: Introduce Platform Firmware Runtime Telemetry driver 2021-12-27 17:12:58 +01:00
pg.h
phantom.h
phonet.h
pidfd.h
pkt_cls.h flow_offload: add skip_hw and skip_sw to control if offload the action 2021-12-19 14:08:48 +00:00
pkt_sched.h fq_codel: generalise ce_threshold marking for subset of traffic 2021-10-20 15:24:36 -07:00
pktcdvd.h
pmu.h
poll.h
posix_acl.h
posix_acl_xattr.h
posix_types.h
ppdev.h
ppp-comp.h
ppp-ioctl.h
ppp_defs.h
pps.h
pr.h
prctl.h mm: add a field to store names for private anonymous memory 2022-01-15 16:30:27 +02:00
psample.h
psci.h
psp-sev.h
ptp_clock.h
ptrace.h
qemu_fw_cfg.h
qnx4_fs.h
qnxtypes.h
qrtr.h
quota.h
radeonfb.h
random.h
rds.h
reboot.h
reiserfs_fs.h
reiserfs_xattr.h
remoteproc_cdev.h
resource.h Increase default MLOCK_LIMIT to 8 MiB 2021-12-10 17:10:55 -08:00
rfkill.h
rio_cm_cdev.h
rio_mport_cdev.h
rkisp1-config.h
romfs_fs.h
rose.h
route.h
rpl.h
rpl_iptunnel.h
rpmsg.h
rpmsg_types.h
rseq.h
rtc.h rtc: add BSM parameter 2021-10-18 17:20:50 +02:00
rtnetlink.h rtnetlink: add new rtm tunnel api for tunnel id filtering 2022-03-01 08:38:02 +00:00
rxrpc.h
scc.h
sched.h
scif_ioctl.h
screen_info.h
sctp.h
seccomp.h
securebits.h
sed-opal.h
seg6.h
seg6_genl.h
seg6_hmac.h
seg6_iptunnel.h
seg6_local.h
selinux_netlink.h
sem.h
serial.h
serial_core.h
serial_reg.h
serio.h
shm.h
signal.h
signalfd.h
smc.h net/smc: Add global configure for handshake limitation by netlink 2022-02-11 11:14:58 +00:00
smc_diag.h Partially revert "net/smc: Add netlink net namespace support" 2022-02-02 07:42:41 -08:00
smiapp.h
snmp.h Revert "net: snmp: add statistics for tcp small queue check" 2021-12-01 19:06:09 -08:00
sock_diag.h
socket.h txhash: Add socket option to control TX hash rethink behavior 2022-01-31 15:05:25 +00:00
sockios.h
sonet.h
sonypi.h
sound.h
soundcard.h kbuild: move headers_check.pl to usr/include/ 2022-01-08 17:41:00 +09:00
stat.h
stddef.h stddef: Introduce DECLARE_FLEX_ARRAY() helper 2021-10-18 12:28:52 -07:00
stm.h
string.h
suspend_ioctls.h
swab.h
switchtec_ioctl.h
sync_file.h
synclink.h
sysctl.h net: arp: introduce arp_evict_nocarrier sysctl parameter 2021-11-01 19:57:14 -07:00
sysinfo.h
target_core_user.h
taskstats.h delayacct: track delays from memory compact 2022-01-20 08:52:55 +02:00
tcp.h
tcp_metrics.h
tee.h
termios.h
thermal.h
time.h
time_types.h
timerfd.h
times.h
timex.h
tiocl.h
tipc.h
tipc_config.h
tipc_netlink.h
tipc_sockets_diag.h
tls.h net/tls: support SM4 GCM/CCM algorithm 2021-09-16 14:36:26 +01:00
toshiba.h
tty.h mctp: Add MCTP-over-serial transport binding 2021-11-23 11:47:51 +00:00
tty_flags.h
types.h
udf_fs_i.h
udmabuf.h
udp.h
uhid.h
uinput.h
uio.h
uleds.h
ultrasound.h
um_timetravel.h
un.h
unistd.h
unix_diag.h
usbdevice_fs.h
usbip.h
userfaultfd.h
userio.h
utime.h
utsname.h
uuid.h uuid: remove licence boilerplate text from the header 2022-01-20 08:52:54 +02:00
uvcvideo.h
v4l2-common.h
v4l2-controls.h media: uapi: Add VP9 stateless decoder controls 2021-11-22 07:44:55 +00:00
v4l2-dv-timings.h
v4l2-mediabus.h
v4l2-subdev.h
vbox_err.h
vbox_vmmdev_types.h
vboxguest.h
vdpa.h vdpa: Support reporting max device capabilities 2022-01-14 18:50:54 -05:00
vduse.h vduse: Introduce VDUSE - vDPA Device in Userspace 2021-09-06 07:20:58 -04:00
veth.h
vfio.h
vfio_ccw.h
vfio_zdev.h
vhost.h
vhost_types.h
videodev2.h media: uapi: Add VP9 stateless decoder controls 2021-11-22 07:44:55 +00:00
virtio_9p.h
virtio_balloon.h
virtio_blk.h
virtio_bt.h
virtio_config.h
virtio_console.h
virtio_crypto.h
virtio_fs.h
virtio_gpio.h virtio_gpio: drop packed attribute 2021-11-04 16:36:54 +01:00
virtio_gpu.h virtio-gpu api: multiple context types with explicit initialization 2021-09-29 09:22:29 +02:00
virtio_i2c.h i2c: virtio: Add support for zero-length requests 2021-11-01 05:26:48 -04:00
virtio_ids.h virtio,vdpa,vhost: features, fixes 2021-09-11 14:48:42 -07:00
virtio_input.h
virtio_iommu.h iommu/virtio: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG 2021-12-06 15:03:05 +01:00
virtio_mem.h virtio-mem: support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 2021-11-10 15:32:38 +01:00
virtio_mmio.h
virtio_net.h
virtio_pci.h
virtio_pcidev.h um: virt-pci: fix uapi documentation 2021-08-26 22:28:03 +02:00
virtio_pmem.h
virtio_ring.h
virtio_rng.h
virtio_scmi.h firmware: arm_scmi: Add virtio transport 2021-08-05 10:24:08 +01:00
virtio_scsi.h
virtio_snd.h
virtio_types.h
virtio_vsock.h virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOR' bit. 2021-09-05 16:23:09 -04:00
vm_sockets.h vsock: Enable y2038 safe timeval for timeout 2021-10-08 16:21:53 +01:00
vm_sockets_diag.h
vmcore.h
vsockmon.h
vt.h
vtpm_proxy.h
wait.h
watch_queue.h
watchdog.h
wireguard.h
wireless.h
wmi.h
wwan.h
x25.h
xattr.h
xdp_diag.h
xfrm.h xfrm: rate limit SA mapping change message to user space 2021-12-23 09:32:51 +01:00
xilinx-v4l2-controls.h
zorro.h
zorro_ids.h