You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(linux): Consolidate XDP documentation to a unified location for ICSSG and CPSW
- Add new centralized XDP documentation at
Kernel/Kernel_Drivers/Network/XDP.rst
- Add kernel_xdp reference label that can be used throughout the docs
- Update PRU_ICSSG_XDP.rst to redirect to the consolidated XDP docs
- Update features supported in PRU_ICSSG_Ethernet.rst
- Update CPSW-Ethernet.rst to reference kernel_xdp instead of
pru_icssg_xdp
- Add XDP.rst to AM64X device-specific table of contents
- Add XDP.rst to main Kernel Drivers toctree
The new XDP documentation covers:
- XDP introduction and concepts
- Use cases and kernel configuration
- AF_XDP sockets and zero-copy mode
- Testing with xdp-tools (xdp-bench, xdp-trafficgen)
- Performance comparison for CPSW and ICSSG drivers
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Meghana Malladi <m-malladi@ti.com>
XDP (eXpress Data Path) provides a framework for BPF that enables high-performance programmable packet processing in the Linux kernel. It runs the BPF program at the earliest possible point in software, namely at the moment the network driver receives the packet.
14
+
eXpress Data Path (XDP) provides a framework for extended Berkeley Packet Filters (eBPF) that enables high-performance programmable packet processing in the Linux kernel. It runs the eBPF program at the earliest possible point in software, namely at the moment the network driver receives the packet.
15
15
16
-
XDP allows running a BPF program just before the skbs are allocated in the driver, the BPF program can look at the packet and return the following things.
16
+
XDP allows running an eBPF program just before the socket buffers (skbs) are allocated in the driver. The eBPF program can examine the packet and return one of the following actions.
17
17
18
-
- XDP_DROP :- The packet is dropped right away, without wasting any resources. Useful for firewall etc.
19
-
- XDP_ABORTED :- Similar to drop, an exception is generated.
20
-
- XDP_PASS :- Pass the packet to kernel stack, i.e. the skbs are allocated and it works normally.
21
-
- XDP_TX :- Send the packet back to same NIC with modification(if done by the program).
22
-
- XDP_REDIRECT :- Send the packet to another NIC or to the user space through AF_XDP Socket(discussed below).
18
+
- ``XDP_DROP`` :- The packet is dropped right away, without wasting any resources. Useful for firewall etc.
19
+
- ``XDP_ABORTED`` :- Similar to drop, an exception is generated.
20
+
- ``XDP_PASS`` :- Pass the packet to kernel stack, i.e. the skbs are allocated and it works normally.
21
+
- ``XDP_TX`` :- Send the packet back to same NIC with modification(if done by the program).
22
+
- ``XDP_REDIRECT`` :- Send the packet to another NIC or to the user space through AF_XDP Socket(discussed below).
23
23
24
-
.. Image:: /images/XDP-packet-processing.png
24
+
.. image:: /images/XDP-packet-processing.png
25
25
26
-
As explained before, the XDP_REDIRECT sends packets directly to the user space.
26
+
As explained before, the ``XDP_REDIRECT`` sends packets directly to the user space.
27
27
This works by using the AF_XDP socket type which was introduced specifically for this usecase.
28
28
29
29
In this process, the packet is directly sent to the user space without going through the kernel network stack.
30
30
31
-
.. Image:: /images/xdp-packet.png
31
+
.. image:: /images/xdp-packet.png
32
32
33
33
Use cases for XDP
34
34
=================
@@ -42,10 +42,10 @@ XDP is particularly useful for these common networking scenarios:
42
42
5. **Network Analytics**: Real-time traffic analysis and monitoring
43
43
6. **Custom Network Functions**: Specialized packet handling for unique requirements
44
44
45
-
How to run XDP with PRU_ICSSG
46
-
=============================
45
+
How to run XDP on EVM
46
+
=====================
47
47
48
-
The kernel configuration requires the following changes to use XDP with PRU_ICSSG:
48
+
The kernel configuration requires the following changes to use XDP:
49
49
50
50
.. code-block:: console
51
51
@@ -89,8 +89,8 @@ How AF_XDP Works
89
89
AF_XDP sockets operate through a shared memory mechanism:
90
90
91
91
1. XDP program intercepts packets at driver level
92
-
2. XDP_REDIRECT action sends packets to the socket
93
-
3. Shared memory rings (RX/TX/FILL/COMPLETION) manage packet data
92
+
2. ``XDP_REDIRECT`` action sends packets to the socket
93
+
3. Shared memory rings (``RX``/``TX``/``FILL``/``COMPLETION``) manage packet data
94
94
4. Userspace application directly accesses the packet data
95
95
5. Zero or minimal copying depending on the mode used
96
96
@@ -99,22 +99,13 @@ The AF_XDP architecture uses several ring buffers:
99
99
- **RX Ring**: Received packets ready for consumption
100
100
- **TX Ring**: Packets to be transmitted
101
101
- **FILL Ring**: Pre-allocated buffers for incoming packets
While xdpsock is not packaged into the SDK, the same functionality can be done with xsk-trafficgen and xsk-bench from the xdp-tools package.
199
+
For more details on xdpsock and how it performs XDP zero copy testing refer to `xdpsock <https://github.com/xdp-project/bpf-examples/tree/main/AF_XDP-example>`_
151
200
152
201
Performance Comparison
153
202
======================
154
203
155
204
Performance testing shows that zero-copy mode can provide substantial throughput improvements compared to copy mode:
156
205
157
-
`xdpsock <https://github.com/xdp-project/bpf-examples/tree/main/AF_XDP-example>`_ opensource tool was used for testing XDP zero copy.
158
-
AF_XDP performance while using 64 byte packets in Kpps:
206
+
AF_XDP performance while using 64 byte packets for ICSSG (in Kpps):
159
207
160
208
.. list-table::
161
209
:header-rows: 1
@@ -173,13 +221,20 @@ AF_XDP performance while using 64 byte packets in Kpps:
173
221
- 354
174
222
- 855
175
223
176
-
Performance Considerations
177
-
==========================
224
+
AF_XDP performance while using 64 byte packets for CPSW (in Kpps):
178
225
179
-
When implementing XDP applications, consider these performance factors:
226
+
.. list-table::
227
+
:header-rows: 1
180
228
181
-
1. **Memory Alignment**: Buffers should be aligned to page boundaries for optimal performance
182
-
2. **Batch Processing**: Process multiple packets in batches when possible
183
-
3. **Poll Mode**: Use poll() or similar mechanisms to avoid blocking on socket operations
184
-
4. **Core Affinity**: Bind application threads to specific CPU cores to reduce cache contention
185
-
5. **NUMA Awareness**: Consider NUMA topology when allocating memory for packet buffers
Copy file name to clipboardExpand all lines: source/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/PRU_ICSSG_Ethernet.rst
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Features supported
44
44
- Different MII modes for Real-Time Ethernet ports (MII_G_RT1 and MII_G_RT2) on different PRU_ICSSG instances. For example, MII on a PRU_ICSSG1 port, and RGMII on a PRU_ICSSG2 port, is supported.
45
45
- IRQ Coalescing also known as interrupt pacing.
46
46
- Multi-cast HW filtering
47
-
- XDP Native Mode and XDP Generic Mode
47
+
- XDP Native Mode, XDP Generic Mode and Zero-copy mode
48
48
- Cut Through forwarding
49
49
- PHY Interrupt mode for ICSSG2
50
50
- Multicast filtering support for VLAN interfaces
@@ -54,7 +54,6 @@ Features supported
54
54
- VLAN HW filtering
55
55
- All-multi mode is always enabled
56
56
- Different MII modes for Real-Time Ethernet ports (MII_G_RT1 and MII_G_RT2) on a single PRU_ICSSG instance. For example, MII_G_RT1=MII and MII_G_RT2=RGMII.
57
-
- XDP with Zero-copy mode
58
57
59
58
Driver Configuration
60
59
####################
@@ -713,8 +712,8 @@ To turn off PPS,
713
712
XDP
714
713
###
715
714
716
-
The PRU_ICSSG Ethernet driver supports Native XDP as well as Generic XDP. XDP with Zero-copy mode is not supported yet.
717
-
For detailed setup and how to test XDP please refer to :ref:`pru_icssg_xdp`.
715
+
The PRU_ICSSG Ethernet driver supports Native XDP, Generic XDP, and Zero-copy mode.
0 commit comments