CM4: Cannot send on eth0 with raw socket specified with both PACKET_TX_RING and PACKET_RX_RING
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c, linux, raspberry-pi, ubuntu
- Domain
- embedded-iot, networking, operating-systems
Research direction
Start by building and running the linked gist on the Raspberry Pi CM4, comparing the PACKET_RX_RING-only and combined PACKET_TX_RING/PACKET_RX_RING cases. Trace Linux raw packet socket handling for eth0 and identify why send() succeeds without transmitting; done means the Tx-MMAP case sends and receives correctly on the reported kernel while Tx-Send still passes.
Written by the indexing model from the issue text.
Description
Describe the bug
On a Raspberry Pi CM4, when a raw socket is opened on eth0 with both PACKET_TX_RING and PACKET_RX_RING options, it is possible to read incoming packets, but it is not possible to send packets. The send() return value does not indicate a problem, but a packet never goes out the physical port.
Steps to reproduce the behaviour
It's easiest to reproduce the bug when attempting to communicate to an EtherCAT device since it will send the packet back to the Raspberry Pi.
The application at this gist tests whether an ethernet port can correctly send and receive
data with both PACKET_TX_RING and PACKET_RX_RING enabled.
The application uses EtherCAT packets and is intended to communicate with an EtherCAT slave device
connected to the eth0 port. This core problem looks to be unrelated to the use of EtherCAT; it's just
that communicating with a single device that echos (or almost echos) data is easier to write a test for.
The test contains 2 sub-tests:
(1) Send and receive data using PACKET_RX_RING but without PACKET_TX_RING. (named 'Tx-Send' in the test output)
(2) Send and receive data using both PACKET_RX_RING and PACKET_TX_RING. (named 'Tx-MMAP' in the test output)
On x86-64 machines with Ubuntu 23.04, the test generates the following output
using interface: eth0
Rx [30]:
Rx [60]:
OK w/Tx-Send
Rx [30]:
Rx [60]:
OK w/Tx-MMAP
The above is the expected output.
On a Raspberry Pi CM4 with Ubuntu 23.04, the test generates the following output
using interface: eth0
Rx [30]:
Rx [60]:
OK w/Tx-Send
Rx [30]:
Failed w/Tx-MMAP
On some EtherCAT device, the first run of this program will result in data not being sent back correctly
reporting that both Tx-Send and Tx-MMAP failed. Subsequent runs do show that Tx-Send succeeds but that Tx-MMAP fails.
Device (s)
Raspberry Pi CM4
System
Ubuntu 23.04 Desktop
vcgencmd version reported VCHI initialization failed
Linux kevin-desktop 6.2.0-1013-raspi #15-Ubuntu SMP PREEMPT Fri Sept 8 18:53:11 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
Logs
No response
Additional context
No response
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·