Pull networking updates from Paolo Abeni: "Core: - Introduce a config option to tweak MAX_SKB_FRAGS. Increasing the default value allows for better BIG TCP performances - Reduce compound page head access for zero-copy data transfers - RPS/RFS improvements, avoiding unneeded NET_RX_SOFTIRQ when possible - Threaded NAPI improvements, adding defer skb free support and unneeded softirq avoidance - Address dst_entry reference count scalability issues, via false sharing avoidance and optimize refcount tracking - Add lockless accesses annotation to sk_err[_soft] - Optimize again the skb struct layout - Extends the skb drop reasons to make it usable by multiple subsystems - Better const qualifier awareness for socket casts BPF: - Add skb and XDP typed dynptrs which allow BPF programs for more ergonomic and less brittle iteration through data and variable-sized accesses - Add a new BPF netfilter program type and minimal support to hook BPF programs to netfilter hooks such as prerouting or forward - Add more precise memory usage reporting for all BPF map types - Adds support for using {FOU,GUE} encap with an ipip device operating in collect_md mode and add a set of BPF kfuncs for controlling encap params - Allow BPF programs to detect at load time whether a particular kfunc exists or not, and also add support for this in light skeleton - Bigger batch of BPF verifier improvements to prepare for upcoming BPF open-coded iterators allowing for less restrictive looping capabilities - Rework RCU enforcement in the verifier, add kptr_rcu and enforce BPF programs to NULL-check before passing such pointers into kfunc - Add support for kptrs in percpu hashmaps, percpu LRU hashmaps and in local storage maps - Enable RCU semantics for task BPF kptrs and allow referenced kptr tasks to be stored in BPF maps - Add support for refcounted local kptrs to the verifier for allowing shared ownership, useful for adding a node to both the BPF list and rbtree - Add BPF verifier support for ST instructions in convert_ctx_access() which will help new -mcpu=v4 clang flag to start emitting them - Add ARM32 USDT support to libbpf - Improve bpftool's visual program dump which produces the control flow graph in a DOT format by adding C source inline annotations Protocols: - IPv4: Allow adding to IPv4 address a 'protocol' tag. Such value indicates the provenance of the IP address - IPv6: optimize route lookup, dropping unneeded R/W lock acquisition - Add the handshake upcall mechanism, allowing the user-space to implement generic TLS handshake on kernel's behalf - Bridge: support per-{Port, VLAN} neighbor suppression, increasing resilience to nodes failures - SCTP: add support for Fair Capacity and Weighted Fair Queueing schedulers - MPTCP: delay first subflow allocation up to its first usage. This will allow for later better LSM interaction - xfrm: Remove inner/outer modes from input/output path. These are not needed anymore - WiFi: - reduced neighbor report (RNR) handling for AP mode - HW timestamping support - support for randomized auth/deauth TA for PASN privacy - per-link debugfs for multi-link - TC offload support for mac80211 drivers - mac80211 mesh fast-xmit and fast-rx support - enable Wi-Fi 7 (EHT) mesh support Netfilter: - Add nf_tables 'brouting' support, to force a packet to be routed instead of being bridged - Update bridge netfilter and ovs conntrack helpers to handle IPv6 Jumbo packets properly, i.e. fetch the packet length from hop-by-hop extension header. This is needed for BIT TCP support - The iptables 32bit compat interface isn't compiled in by default anymore - Move ip(6)tables builtin icmp matches to the udptcp one. This has the advantage that icmp/icmpv6 match doesn't load the iptables/ip6tables modules anymore when iptables-nft is used - Extended netlink error report for netdevice in flowtables and netdev/chains. Allow for incrementally add/delete devices to netdev basechain. Allow to create netdev chain without device Driver API: - Remove redundant Device Control Error Reporting Enable, as PCI core has already error reporting enabled at enumeration time - Move Multicast DB netlink handlers to core, allowing devices other then bridge to use them - Allow the page_pool to directly recycle the pages from safely localized NAPI - Implement lockless TX queue stop/wake combo macros, allowing for further code de-duplication and sanitization - Add YNL support for user headers and struct attrs - Add partial YNL specification for devlink - Add partial YNL specification for ethtool - Add tc-mqprio and tc-taprio support for preemptible traffic classes - Add tx push buf len param to ethtool, specifies the maximum number of bytes of a transmitted packet a driver can push directly to the underlying device - Add basic LED support for switch/phy - Add NAPI documentation, stop relaying on external links - Convert dsa_master_ioctl() to netdev notifier. This is a preparatory work to make the hardware timestamping layer selectable by user space - Add transceiver support and improve the error messages for CAN-FD controllers New hardware / drivers: - Ethernet: - AMD/Pensando core device support - MediaTek MT7981 SoC - MediaTek MT7988 SoC - Broadcom BCM53134 embedded switch - Texas Instruments CPSW9G ethernet switch - Qualcomm EMAC3 DWMAC ethernet - StarFive JH7110 SoC - NXP CBTX ethernet PHY - WiFi: - Apple M1 Pro/Max devices - RealTek rtl8710bu/rtl8188gu - RealTek rtl8822bs, rtl8822cs and rtl8821cs SDIO chipset - Bluetooth: - Realtek RTL8821CS, RTL8851B, RTL8852BS - Mediatek MT7663, MT7922 - NXP w8997 - Actions Semi ATS2851 - QTI WCN6855 - Marvell 88W8997 - Can: - STMicroelectronics bxcan stm32f429 Drivers: - Ethernet NICs: - Intel (1G, icg): - add tracking and reporting of QBV config errors - add support for configuring max SDU for each Tx queue - Intel (100G, ice): - refactor mailbox overflow detection to support Scalable IOV - GNSS interface optimization - Intel (i40e): - support XDP multi-buffer - nVidia/Mellanox: - add the support for linux bridge multicast offload - enable TC offload for egress and engress MACVLAN over bond - add support for VxLAN GBP encap/decap flows offload - extend packet offload to fully support libreswan - support tunnel mode in mlx5 IPsec packet offload - extend XDP multi-buffer support - support MACsec VLAN offload - add support for dynamic msix vectors allocation - drop RX page_cache and fully use page_pool - implement thermal zone to report NIC temperature - Netronome/Corigine: - add support for multi-zone conntrack offload - Solarflare/Xilinx: - support offloading TC VLAN push/pop actions to the MAE - support TC decap rules - support unicast PTP - Other NICs: - Broadcom (bnxt): enforce software based freq adjustments only on shared PHC NIC - RealTek (r8169): refactor to addess ASPM issues during NAPI poll - Micrel (lan8841): add support for PTP_PF_PEROUT - Cadence (macb): enable PTP unicast - Engleder (tsnep): add XDP socket zero-copy support - virtio-net: implement exact header length guest feature - veth: add page_pool support for page recycling - vxlan: add MDB data path support - gve: add XDP support for GQI-QPL format - geneve: accept every ethertype - macvlan: allow some packets to bypass broadcast queue - mana: add support for jumbo frame - Ethernet high-speed switches: - Microchip (sparx5): Add support for TC flower templates - Ethernet embedded switches: - Broadcom (b54): - configure 6318 and 63268 RGMII ports - Marvell (mv88e6xxx): - faster C45 bus scan - Microchip: - lan966x: - add support for IS1 VCAP - better TX/RX from/to CPU performances - ksz9477: add ETS Qdisc support - ksz8: enhance static MAC table operations and error handling - sama7g5: add PTP capability - NXP (ocelot): - add support for external ports - add support for preemptible traffic classes - Texas Instruments: - add CPSWxG SGMII support for J7200 and J721E - Intel WiFi (iwlwifi): - preparation for Wi-Fi 7 EHT and multi-link support - EHT (Wi-Fi 7) sniffer support - hardware timestamping support for some devices/firwmares - TX beacon protection on newer hardware - Qualcomm 802.11ax WiFi (ath11k): - MU-MIMO parameters support - ack signal support for management packets - RealTek WiFi (rtw88): - SDIO bus support - better support for some SDIO devices (e.g. MAC address from efuse) - RealTek WiFi (rtw89): - HW scan support for 8852b - better support for 6 GHz scanning - support for various newer firmware APIs - framework firmware backwards compatibility - MediaTek WiFi (mt76): - P2P support - mesh A-MSDU support - EHT (Wi-Fi 7) support - coredump support" * tag 'net-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2078 commits) net: phy: hide the PHYLIB_LEDS knob net: phy: marvell-88x2222: remove unnecessary (void*) conversions tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp. net: amd: Fix link leak when verifying config failed net: phy: marvell: Fix inconsistent indenting in led_blink_set lan966x: Don't use xdp_frame when action is XDP_TX tsnep: Add XDP socket zero-copy TX support tsnep: Add XDP socket zero-copy RX support tsnep: Move skb receive action to separate function tsnep: Add functions for queue enable/disable tsnep: Rework TX/RX queue initialization tsnep: Replace modulo operation with mask net: phy: dp83867: Add led_brightness_set support net: phy: Fix reading LED reg property drivers: nfc: nfcsim: remove return value check of `dev_dir` net: phy: dp83867: Remove unnecessary (void*) conversions net: ethtool: coalesce: try to make user settings stick twice net: mana: Check if netdev/napi_alloc_frag returns single page net: mana: Rename mana_refill_rxoob and remove some empty lines net: veth: add page_pool stats ...
Showing the changes to samples (9 of 1925 files). Show all
Unified · Split
| @@ -76,8 +76,8 @@ struct { · 75 unmodified lines | |||
| 76 | 76 | ||
| 77 | /* | 77 | /* |
| 78 | * The trace events for cpu_idle and cpu_frequency are taken from: | 78 | * The trace events for cpu_idle and cpu_frequency are taken from: |
| 79 | * /sys/kernel/debug/tracing/events/power/cpu_idle/format | 79 | * /sys/kernel/tracing/events/power/cpu_idle/format |
| 80 | * /sys/kernel/debug/tracing/events/power/cpu_frequency/format | 80 | * /sys/kernel/tracing/events/power/cpu_frequency/format |
| 81 | * | 81 | * |
| 82 | * These two events have same format, so define one common structure. | 82 | * These two events have same format, so define one common structure. |
| 83 | */ | 83 | */ |
| @@ -65,7 +65,7 @@ static void Usage(void); · 64 unmodified lines | |||
| 65 | static void read_trace_pipe2(void); | 65 | static void read_trace_pipe2(void); |
| 66 | static void do_error(char *msg, bool errno_flag); | 66 | static void do_error(char *msg, bool errno_flag); |
| 67 | 67 | ||
| 68 | #define DEBUGFS "/sys/kernel/debug/tracing/" | 68 | #define TRACEFS "/sys/kernel/tracing/" |
| 69 | 69 | ||
| 70 | static struct bpf_program *bpf_prog; | 70 | static struct bpf_program *bpf_prog; |
| 71 | static struct bpf_object *obj; | 71 | static struct bpf_object *obj; |
| @@ -77,7 +77,7 @@ static void read_trace_pipe2(void) · 5 unmodified lines | |||
| 77 | FILE *outf; | 77 | FILE *outf; |
| 78 | char *outFname = "hbm_out.log"; | 78 | char *outFname = "hbm_out.log"; |
| 79 | 79 | ||
| 80 | trace_fd = open(DEBUGFS "trace_pipe", O_RDONLY, 0); | 80 | trace_fd = open(TRACEFS "trace_pipe", O_RDONLY, 0); |
| 81 | if (trace_fd < 0) { | 81 | if (trace_fd < 0) { |
| 82 | printf("Error opening trace_pipe\n"); | 82 | printf("Error opening trace_pipe\n"); |
| 83 | return; | 83 | return; |
| @@ -315,6 +315,7 @@ static int run_bpf_prog(char *prog, int cg_id) · 231 unmodified lines | |||
| 315 | fout = fopen(fname, "w"); | 315 | fout = fopen(fname, "w"); |
| 316 | fprintf(fout, "id:%d\n", cg_id); | 316 | fprintf(fout, "id:%d\n", cg_id); |
| 317 | fprintf(fout, "ERROR: Could not lookup queue_stats\n"); | 317 | fprintf(fout, "ERROR: Could not lookup queue_stats\n"); |
| 318 | fclose(fout); | ||
| 318 | } else if (stats_flag && qstats.lastPacketTime > | 319 | } else if (stats_flag && qstats.lastPacketTime > |
| 319 | qstats.firstPacketTime) { | 320 | qstats.firstPacketTime) { |
| 320 | long long delta_us = (qstats.lastPacketTime - | 321 | long long delta_us = (qstats.lastPacketTime - |
| @@ -39,8 +39,8 @@ struct { · 38 unmodified lines | |||
| 39 | /* Taken from the current format defined in | 39 | /* Taken from the current format defined in |
| 40 | * include/trace/events/ib_umad.h | 40 | * include/trace/events/ib_umad.h |
| 41 | * and | 41 | * and |
| 42 | * /sys/kernel/debug/tracing/events/ib_umad/ib_umad_read/format | 42 | * /sys/kernel/tracing/events/ib_umad/ib_umad_read/format |
| 43 | * /sys/kernel/debug/tracing/events/ib_umad/ib_umad_write/format | 43 | * /sys/kernel/tracing/events/ib_umad/ib_umad_write/format |
| 44 | */ | 44 | */ |
| 45 | struct ib_umad_rw_args { | 45 | struct ib_umad_rw_args { |
| 46 | u64 pad; | 46 | u64 pad; |
| @@ -5,7 +5,7 @@ NS1=lwt_ns1 · 4 unmodified lines | |||
| 5 | VETH0=tst_lwt1a | 5 | VETH0=tst_lwt1a |
| 6 | VETH1=tst_lwt1b | 6 | VETH1=tst_lwt1b |
| 7 | BPF_PROG=lwt_len_hist.bpf.o | 7 | BPF_PROG=lwt_len_hist.bpf.o |
| 8 | TRACE_ROOT=/sys/kernel/debug/tracing | 8 | TRACE_ROOT=/sys/kernel/tracing |
| 9 | 9 | ||
| 10 | function cleanup { | 10 | function cleanup { |
| 11 | # To reset saved histogram, remove pinned map | 11 | # To reset saved histogram, remove pinned map |
| @@ -110,7 +110,7 @@ static inline int update_counts(void *ctx, u32 pid, u64 delta) · 109 unmodified lines | |||
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | #if 1 | 112 | #if 1 |
| 113 | /* taken from /sys/kernel/debug/tracing/events/sched/sched_switch/format */ | 113 | /* taken from /sys/kernel/tracing/events/sched/sched_switch/format */ |
| 114 | struct sched_switch_args { | 114 | struct sched_switch_args { |
| 115 | unsigned long long pad; | 115 | unsigned long long pad; |
| 116 | char prev_comm[TASK_COMM_LEN]; | 116 | char prev_comm[TASK_COMM_LEN]; |
| @@ -21,10 +21,10 @@ · 20 unmodified lines | |||
| 21 | #define DEFAULT_FREQ 99 | 21 | #define DEFAULT_FREQ 99 |
| 22 | #define DEFAULT_SECS 5 | 22 | #define DEFAULT_SECS 5 |
| 23 | #define MAX_IPS 8192 | 23 | #define MAX_IPS 8192 |
| 24 | #define PAGE_OFFSET 0xffff880000000000 | ||
| 25 | 24 | ||
| 26 | static int map_fd; | 25 | static int map_fd; |
| 27 | static int nr_cpus; | 26 | static int nr_cpus; |
| 27 | static long _text_addr; | ||
| 28 | 28 | ||
| 29 | static void usage(void) | 29 | static void usage(void) |
| 30 | { | 30 | { |
| @@ -108,7 +108,7 @@ static void print_ip_map(int fd) · 77 unmodified lines | |||
| 108 | /* sort and print */ | 108 | /* sort and print */ |
| 109 | qsort(counts, max, sizeof(struct ipcount), count_cmp); | 109 | qsort(counts, max, sizeof(struct ipcount), count_cmp); |
| 110 | for (i = 0; i < max; i++) { | 110 | for (i = 0; i < max; i++) { |
| 111 | if (counts[i].ip > PAGE_OFFSET) { | 111 | if (counts[i].ip > _text_addr) { |
| 112 | sym = ksym_search(counts[i].ip); | 112 | sym = ksym_search(counts[i].ip); |
| 113 | if (!sym) { | 113 | if (!sym) { |
| 114 | printf("ksym not found. Is kallsyms loaded?\n"); | 114 | printf("ksym not found. Is kallsyms loaded?\n"); |
| @@ -169,6 +169,13 @@ int main(int argc, char **argv) · 54 unmodified lines | |||
| 169 | return 2; | 169 | return 2; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | /* used to determine whether the address is kernel space */ | ||
| 173 | _text_addr = ksym_get_addr("_text"); | ||
| 174 | if (!_text_addr) { | ||
| 175 | fprintf(stderr, "ERROR: no '_text' in /proc/kallsyms\n"); | ||
| 176 | return 3; | ||
| 177 | } | ||
| 178 | |||
| 172 | /* create perf FDs for each CPU */ | 179 | /* create perf FDs for each CPU */ |
| 173 | nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); | 180 | nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); |
| 174 | links = calloc(nr_cpus, sizeof(struct bpf_link *)); | 181 | links = calloc(nr_cpus, sizeof(struct bpf_link *)); |
| @@ -235,7 +235,7 @@ static int test_debug_fs_uprobe(char *binary_path, long offset, bool is_return) · 234 unmodified lines | |||
| 235 | struct bpf_link *link; | 235 | struct bpf_link *link; |
| 236 | ssize_t bytes; | 236 | ssize_t bytes; |
| 237 | 237 | ||
| 238 | snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/%s_events", | 238 | snprintf(buf, sizeof(buf), "/sys/kernel/tracing/%s_events", |
| 239 | event_type); | 239 | event_type); |
| 240 | kfd = open(buf, O_WRONLY | O_TRUNC, 0); | 240 | kfd = open(buf, O_WRONLY | O_TRUNC, 0); |
| 241 | CHECK_PERROR_RET(kfd < 0); | 241 | CHECK_PERROR_RET(kfd < 0); |
| @@ -252,7 +252,7 @@ static int test_debug_fs_uprobe(char *binary_path, long offset, bool is_return) · 10 unmodified lines | |||
| 252 | close(kfd); | 252 | close(kfd); |
| 253 | kfd = -1; | 253 | kfd = -1; |
| 254 | 254 | ||
| 255 | snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id", | 255 | snprintf(buf, sizeof(buf), "/sys/kernel/tracing/events/%ss/%s/id", |
| 256 | event_type, event_alias); | 256 | event_type, event_alias); |
| 257 | efd = open(buf, O_RDONLY, 0); | 257 | efd = open(buf, O_RDONLY, 0); |
| 258 | CHECK_PERROR_RET(efd < 0); | 258 | CHECK_PERROR_RET(efd < 0); |
| @@ -21,7 +21,7 @@ IP_LOCAL="192.168.99.1" · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | PROG_SRC="test_lwt_bpf.c" | 22 | PROG_SRC="test_lwt_bpf.c" |
| 23 | BPF_PROG="test_lwt_bpf.o" | 23 | BPF_PROG="test_lwt_bpf.o" |
| 24 | TRACE_ROOT=/sys/kernel/debug/tracing | 24 | TRACE_ROOT=/sys/kernel/tracing |
| 25 | CONTEXT_INFO=$(cat ${TRACE_ROOT}/trace_options | grep context) | 25 | CONTEXT_INFO=$(cat ${TRACE_ROOT}/trace_options | grep context) |
| 26 | 26 | ||
| 27 | function lookup_mac() | 27 | function lookup_mac() |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | |||
| 7 | #include "vmlinux.h" | 7 | #include "vmlinux.h" |
| 8 | #include <bpf/bpf_helpers.h> | 8 | #include <bpf/bpf_helpers.h> |
| 9 | 9 | ||
| 10 | /* from /sys/kernel/debug/tracing/events/task/task_rename/format */ | 10 | /* from /sys/kernel/tracing/events/task/task_rename/format */ |
| 11 | struct task_rename { | 11 | struct task_rename { |
| 12 | __u64 pad; | 12 | __u64 pad; |
| 13 | __u32 pid; | 13 | __u32 pid; |
| @@ -21,7 +21,7 @@ int prog(struct task_rename *ctx) · 7 unmodified lines | |||
| 21 | return 0; | 21 | return 0; |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | /* from /sys/kernel/debug/tracing/events/fib/fib_table_lookup/format */ | 24 | /* from /sys/kernel/tracing/events/fib/fib_table_lookup/format */ |
| 25 | struct fib_table_lookup { | 25 | struct fib_table_lookup { |
| 26 | __u64 pad; | 26 | __u64 pad; |
| 27 | __u32 tb_id; | 27 | __u32 tb_id; |