-
Notifications
You must be signed in to change notification settings - Fork 131
netdev CI testing #6666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kuba-moo
wants to merge
175
commits into
kernel-patches:bpf-next_base
Choose a base branch
from
linux-netdev:to-test
base: bpf-next_base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
netdev CI testing #6666
+13,711
−5,163
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4f22ee0
to
8a9a8e0
Compare
64c403f
to
8da1f58
Compare
78ebb17
to
9325308
Compare
c8c7b2f
to
a71aae6
Compare
9325308
to
7940ae1
Compare
d8feb00
to
b16a6b9
Compare
7940ae1
to
8f1ff3c
Compare
4164329
to
c5cecb3
Compare
A not-so-careful NAT46 BPF program can crash the kernel if it indiscriminately flips ingress packets from v4 to v6: BUG: kernel NULL pointer dereference, address: 0000000000000000 ip6_rcv_core (net/ipv6/ip6_input.c:190:20) ipv6_rcv (net/ipv6/ip6_input.c:306:8) process_backlog (net/core/dev.c:6186:4) napi_poll (net/core/dev.c:6906:9) net_rx_action (net/core/dev.c:7028:13) do_softirq (kernel/softirq.c:462:3) netif_rx (net/core/dev.c:5326:3) dev_loopback_xmit (net/core/dev.c:4015:2) ip_mc_finish_output (net/ipv4/ip_output.c:363:8) NF_HOOK (./include/linux/netfilter.h:314:9) ip_mc_output (net/ipv4/ip_output.c:400:5) dst_output (./include/net/dst.h:459:9) ip_local_out (net/ipv4/ip_output.c:130:9) ip_send_skb (net/ipv4/ip_output.c:1496:8) udp_send_skb (net/ipv4/udp.c:1040:8) udp_sendmsg (net/ipv4/udp.c:1328:10) The output interface has a 4->6 program attached at ingress. We try to loop the multicast skb back to the sending socket. Ingress BPF runs as part of netif_rx(), pushes a valid v6 hdr and changes skb->protocol to v6. We enter ip6_rcv_core which tries to use skb_dst(). But the dst is still an IPv4 one left after IPv4 mcast output. Clear the dst in all BPF helpers which change the protocol. Also clear the dst if we did an encap or decap as those will most likely make the dst stale. Try to preserve metadata dsts, those may carry non-routing metadata. Reviewed-by: Maciej Żenczykowski <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Fixes: d219df6 ("bpf: Add ipip6 and ip6ip decap support for bpf_skb_adjust_room()") Fixes: 1b00e0d ("bpf: update skb->protocol in bpf_skb_net_grow") Fixes: 6578171 ("bpf: add bpf_skb_change_proto helper") Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
… failure Fix compilation warning: In file included from ./include/linux/kernel.h:15, from ./include/linux/list.h:9, from ./include/linux/module.h:12, from net/ipv4/inet_hashtables.c:12: net/ipv4/inet_hashtables.c: In function ‘inet_ehash_locks_alloc’: ./include/linux/minmax.h:20:35: warning: comparison of distinct pointer types lacks a cast 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^~ ./include/linux/minmax.h:26:18: note: in expansion of macro ‘__typecheck’ 26 | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~ ./include/linux/minmax.h:36:31: note: in expansion of macro ‘__safe_cmp’ 36 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ ./include/linux/minmax.h:52:25: note: in expansion of macro ‘__careful_cmp’ 52 | #define max(x, y) __careful_cmp(x, y, >) | ^~~~~~~~~~~~~ net/ipv4/inet_hashtables.c:946:19: note: in expansion of macro ‘max’ 946 | nblocks = max(nblocks, num_online_nodes() * PAGE_SIZE / locksz); | ^~~ CC block/badblocks.o When warnings are treated as errors, this causes the build to fail. The issue is a type mismatch between the operands passed to the max() macro. Here, nblocks is an unsigned int, while the expression num_online_nodes() * PAGE_SIZE / locksz is promoted to unsigned long. This happens because: - num_online_nodes() returns int - PAGE_SIZE is typically defined as an unsigned long (depending on the architecture) - locksz is unsigned int The resulting arithmetic expression is promoted to unsigned long. Thus, the max() macro compares values of different types: unsigned int vs unsigned long. This issue was introduced in commit b53d6e9525af ("tcp: bring back NUMA dispersion in inet_ehash_locks_alloc()") during the update from kernel v5.10.237 to v5.10.238. It does not exist in newer kernel branches (e.g., v5.15.185 and all 6.x branches), because they include commit d53b5d862acd ("minmax: allow min()/max()/clamp() if the arguments have the same signedness.") Fix the issue by using max_t(unsigned int, ...) to explicitly cast both operands to the same type, avoiding the type mismatch and ensuring correctness. Fixes: b53d6e9525af ("tcp: bring back NUMA dispersion in inet_ehash_locks_alloc()") Signed-off-by: Eliav Farber <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1. Add yunsilicon xsc driver basic compile framework, including xsc_pci driver and xsc_eth driver 2. Implemented PCI device initialization. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
The command queue is a hardware channel for sending commands between the driver and the firmware. xsc_cmd.h defines the command protocol structures. The logic for command allocation, sending, completion handling, and error handling is implemented in cmdq.c. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
After CMDQ is initialized, the driver can retrieve hardware information from the firmware. This patch provides APIs to obtain the Hardware Component Adapter (HCA) capabilities, the Globally Unique Identifier (GUID) of the board, activate the hardware configuration, and reset function-specific resources. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Our hardware uses queue pairs (QP) and completion queues (CQ) for packet transmission and reception. In the PCI driver, all QP and CQ resources used by all xsc drivers(ethernet and rdma) are recorded witch radix tree. This patch defines the QP and CQ structures and initializes the QP and CQ resource management during PCI initialization. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Add eq management and buffer alloc apis This patch, along with the next one, implements the event handling mechanism. The hardware uses the event queue (EQ) for event reporting, notifying the CPU through interrupts, which then reads and processes events from the EQ. 1. This patch implements the EQ API, including the initialization of the EQ table, and the creation/destroy, start/stop operations of the EQ. 2. When creating an event queue, a large amount of DMA memory is required to store the ring buffer, necessitating multiple DMA page allocations and unified management. For this purpose, we define struct xsc_buff and use xsc_buf_alloc/free to allocate and free memory. The usage of QP and CQ will also rely on these in the future. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
This patch implements the initialization of PCI MSI-X interrupts. It handles the allocation of MSI-X interrupt vectors, registration of interrupt requests (IRQs), configuration of interrupt affinity , and interrupt handlers for different event types, including: - Completion events (handled via completion queues). - Command queue (cmdq) events (via xsc_cmd_handler). - Asynchronous events (via xsc_event_handler). Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Our device supports both Ethernet and RDMA functionalities, and leveraging the auxiliary bus perfectly addresses our needs for managing these distinct features. This patch utilizes auxiliary device to handle the Ethernet functionality, while defining xsc_adev_list to reserve expansion space for future RDMA capabilities. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Implement an auxiliary driver for ethernet and initialize the netdevice simply. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Initialize network device: 1. Prepare xsc_eth_params, set up the network parameters such as MTU, number of channels, and RSS configuration 2. Configure netdev, Set the MTU, features 3. Set mac addr to hardware, and attach netif Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1. For Ethernet data transmission and reception, this patch adds APIs for using QP and CQ. For QPs, it includes Create QP, Modify QP Status, and Destroy QP. For CQs, it includes Create CQ and Destroy CQ. Since these operations are common to both Ethernet and RDMA, they are added to the xsc_pci driver. In the xsc_eth driver, Ethernet-specific operations are added, including create RSS RQ and modify QP. 2. Ethernet QP and CQ ring buffer allocation functions are added: xsc_eth_cqwq_create for CQ and xsc_eth_wq_cyc_create for QP. Corresponding DMA buffer allocation functions are also added in alloc.c. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
This patch implements ndo_open and ndo_close. The main task is to initialize the channel resources. A channel is a data transmission path. Each CPU is bound to a channel, and each channel is associated with an interrupt. A channel consists of one RX queue and multiple TX queues, with the number of TX queues corresponding to the number of traffic classes. Each TX queue and RX queue is a separate queue pair (QP). The TX queue is used only for transmission, while the RX queue is used only for reception. Each queue pair is bound to a completion queue (CQ). Each channel also has its own NAPI context. The patch also add event handling functionality. Added a workqueue and event handler to process asynchronous events from the hardware. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
This patch adds core data transmission functionality, focusing on the ndo_start_xmit interface. The main steps are: 1. Transmission Entry The entry point selects the appropriate transmit queue (SQ) and verifies hardware readiness before calling xsc_eth_xmit_frame for packet transmission. 2. Packet Processing Supports TCP/UDP GSO, calculates MSS and IHS. If necessary, performs SKB linearization and handles checksum offload. Maps data for DMA using dma_map_single and skb_frag_dma_map. 3. Descriptor Generation Constructs control (cseg) and data (dseg) segments, including setting operation codes, segment counts, and DMA addresses. Hardware Notification & Queue Management: 4. Notifies hardware using a doorbell register and manages queue flow to avoid overloading. 5. Combines small packets using netdev_xmit_more to reduce doorbell writes and supports zero-copy transmission for efficiency. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
rx data path: 1. The hardware writes incoming packets into the RQ ring buffer and generates a event queue entry 2. The event handler function(xsc_eth_completion_event in xsc_eth_events.c) is triggered, invokes napi_schedule() to schedule a softirq. 3. The kernel triggers the softirq handler net_rx_action, which calls the driver's NAPI poll function (xsc_eth_napi_poll in xsc_eth_txrx.c). The driver retrieves CQEs from the Completion Queue (CQ) via xsc_poll_rx_cq. 4. xsc_eth_build_rx_skb constructs an sk_buff structure, and submits the SKB to the kernel network stack via napi_gro_receive 5. The driver recycles the RX buffer and notifies the NIC via xsc_eth_post_rx_wqes to prepare for new packets. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Added basic network interface statistics. Co-developed-by: Honggang Wei <[email protected]> Signed-off-by: Honggang Wei <[email protected]> Co-developed-by: Lei Yan <[email protected]> Signed-off-by: Lei Yan <[email protected]> Signed-off-by: Xin Tian <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Widen protocol name column from %-9s to %-11s to properly display UNIX-STREAM and keep table alignment. before modification: console:/ # cat /proc/net/protocols protocol size sockets memory press maxhdr slab module cl co di ac io in de sh ss gs se re sp bi br ha uh gp em PPPOL2TP 920 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n HIDP 808 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n BNEP 808 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n RFCOMM 840 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n KEY 864 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n PACKET 1536 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n PINGv6 1184 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n RAWv6 1184 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n UDPLITEv6 1344 0 0 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n UDPv6 1344 0 0 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n TCPv6 2352 0 0 no 320 yes kernel y y y y y y y y y y y y y n y y y y y PPTP 920 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n PPPOE 920 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n UNIX-STREAM 1024 29 -1 NI 0 yes kernel y n n n n n n n n n n n n n n n y n n UNIX 1024 193 -1 NI 0 yes kernel y n n n n n n n n n n n n n n n n n n UDP-Lite 1152 0 0 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n PING 976 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n RAW 984 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n UDP 1152 0 0 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n TCP 2192 0 0 no 320 yes kernel y y y y y y y y y y y y y n y y y y y SCO 848 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n L2CAP 824 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n HCI 888 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n NETLINK 1104 18 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n after modification: console:/ # cat /proc/net/protocols protocol size sockets memory press maxhdr slab module cl co di ac io in de sh ss gs se re sp bi br ha uh gp em PPPOL2TP 920 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n HIDP 808 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n BNEP 808 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n RFCOMM 840 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n KEY 864 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n PACKET 1536 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n PINGv6 1184 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n RAWv6 1184 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n UDPLITEv6 1344 0 0 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n UDPv6 1344 0 0 NI 0 yes kernel y y y n y y y n y y y y n n n y y y n TCPv6 2352 0 0 no 320 yes kernel y y y y y y y y y y y y y n y y y y y PPTP 920 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n PPPOE 920 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n UNIX-STREAM 1024 29 -1 NI 0 yes kernel y n n n n n n n n n n n n n n n y n n UNIX 1024 193 -1 NI 0 yes kernel y n n n n n n n n n n n n n n n n n n UDP-Lite 1152 0 0 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n PING 976 0 -1 NI 0 yes kernel y y y n n y n n y y y y n y y y y y n RAW 984 0 -1 NI 0 yes kernel y y y n y y y n y y y y n y y y y n n UDP 1152 0 0 NI 0 yes kernel y y y n y y y n y y y y y n n y y y n TCP 2192 0 0 no 320 yes kernel y y y y y y y y y y y y y n y y y y y SCO 848 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n L2CAP 824 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n HCI 888 0 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n NETLINK 1104 18 -1 NI 0 no kernel n n n n n n n n n n n n n n n n n n n Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: MoYuanhao <[email protected]> Signed-off-by: NipaLocal <nipa@local>
…s dynamically instead of the previously hardcoded value of 2 Add a module parameter `radios` to allow users to configure the number of virtual radios created by mac802154_hwsim at module load time. This replaces the previously hardcoded value of 2. * Added a new module parameter `radios` * Modified the loop in hwsim_probe() * Updated log message in hwsim_probe() Signed-off-by: Ramon Fontes <[email protected]> Signed-off-by: NipaLocal <nipa@local>
tc_actions.sh keeps hanging the forwarding tests. sdf@: tdc & tdc-dbg started intermittenly failing around Sep 25th Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reusable PR for hooking netdev CI to BPF testing.