Skip to content

[FPGA] Fix ethernet rejected packet overwriting accepted packet data#533

Merged
raylau1 merged 1 commit intolowRISC:mainfrom
raylau1:fix_ethernet_rejected_overwrite
May 8, 2026
Merged

[FPGA] Fix ethernet rejected packet overwriting accepted packet data#533
raylau1 merged 1 commit intolowRISC:mainfrom
raylau1:fix_ethernet_rejected_overwrite

Conversation

@raylau1
Copy link
Copy Markdown
Contributor

@raylau1 raylau1 commented May 7, 2026

This improves the Rx first 8 bytes patch to prevent a rejected packet from overwriting data from an accepted packet.

Closes #532

To test that the issue is fixed, run the Ethernet example software, and send packets by running the following in python:

s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x5A"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x82"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x5A"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x82"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x5A"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x82"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x79" + b"\xCE"*(1500-6))
s.send(b"\x9A\xBC\x12\x34\x56\x78" + b"\x5A"*(1500-6))

There should not be a received packet with 0xCECECECECECECECE in its data.

This improves the Rx first 8 byte patch to use incremented Rx buffer
offset for the entire packet if a packet is rejected.
@raylau1 raylau1 requested a review from marnovandermaas May 7, 2026 14:18
Copy link
Copy Markdown
Collaborator

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this change. Just a small change from my point of view it would be good to assign rx_use_incr_buf_offset for all rx_addr_axis values.

Comment thread hw/vendor/ethernet/framing_top.sv
Copy link
Copy Markdown
Collaborator

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me from a code review. Feel free to merge once you're happy with your local testing on FPGA.

@raylau1 raylau1 merged commit 8649baf into lowRISC:main May 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix accepted packet data overwritten by rejected packet after first 8 bytes

2 participants