Skip to content
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

mac: improve rx checker #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maass-hamburg
Copy link
Contributor

@maass-hamburg maass-hamburg commented Feb 3, 2025

  • implement padding checker, to drop packets when payload size < minimum ethernet payload size

@rowanG077
Copy link
Contributor

rowanG077 commented Feb 3, 2025

The preamble is not required by the spec to always be present on receive. When a MAC starts receiving bytes the only part that is required to be present is the SFD.

@maass-hamburg
Copy link
Contributor Author

@rowanG077 can you cite that part of the spec? I through it was mandatory, if it doesn't I wont mind adding a option to limit it to the sfd.

the check for the preamble until now depended on the selected dw. so when you had a dw of 8 it was just the sfd, but anything longer would also match the preamble. This change would only make this check behave the same on all dw.

@rowanG077
Copy link
Contributor

rowanG077 commented Feb 5, 2025

@maass-hamburg Sure...

I'm looking at the IEEE 802.3 2012 spec. It's basically sprinked all over the document but the most clear is the following:

4.2.6 Start frame sequence
The receiveDataValid signal is the indication to the MAC that the frame reception process should begin.
Upon reception of the sequence 10101011 following the assertion of receiveDataValid,
PhysicalSignalDecap shall begin passing successive bits to ReceiveLinkMgmt for passing to the MAC
client

And PhysicalSignalDecap is defined as:

procedure PhysicalSignalDecap;
begin
{Receive one bit at a time from physical medium until a valid sfd is detected, discard bits and return}
end; {PhysicalSignalDecap}

Different phy links specify different things here. Some say that the full 8 bytes must be transmitted but can be corrupted. Some say full bytes can be ommited for CDR to sync.

implement LiteEthMACPaddingChecker, to drop
packet when payload size < minimum ethernet payload size

Signed-off-by: Fin Maaß <[email protected]>
@maass-hamburg
Copy link
Contributor Author

@rowanG077 thanks, I removed that part. One possible concern I am worried at dw bigger that 8, where the sfd is not at the end, but that would be something for another PR.

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.

2 participants