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

net: ethernet: Align handling of different ethernet protocols in recv #83967

Conversation

clamattia
Copy link
Contributor

Distribute packets to all ethernet protocols in a unified way. This would
also fix an issue, where lldp frames would get dropped too soon.

Refactor to handle lldp in a unified way with arp, acd and ptp.

Depends on #83916

Note, that the behavior is slightly different for lldp as the ethernet header is stripped. But the src and dst are now available from net_pkt_lladdr_src(pkt)->addr, I believe. This needs to be checked, if correct. Let me know, if you know more.

Remove unused family variable from receive function in ethernet layer 2.
It is checked only once under such conditions, that do not allow the
variable to be different.

Signed-off-by: Cla Mattia Galliard <[email protected]>
@clamattia clamattia force-pushed the lldp_unite_with_other_ethernet_protocols branch 5 times, most recently from 0506b12 to dfad2e3 Compare January 15, 2025 10:35
Comment on lines 372 to 375
!net_eth_is_addr_multicast((struct net_eth_addr *)lladdr->addr) &&
!net_eth_is_addr_lldp_multicast(
(struct net_eth_addr *)lladdr->addr) &&
!net_eth_is_addr_ptp_multicast((struct net_eth_addr *)lladdr->addr) &&
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering how the group address check replaces the individual address checks. As this PR looks to be more related to refactoring the code, then this change looks to be doing a bit more than that.
Perhaps we should change this code in future PR where the actual ptype functionality is changed to be extensible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fully agree, will revert.

This is needed, as soon as we have made ethernet more extensible. We will either have to provide extentions points for this filter also. Or, what I want to propose, only filter out all non-broadcast-, non-multicast- (in the wider sense), non-unicast- (for us) frames.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted

Copy link
Member

Choose a reason for hiding this comment

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

I have handled this address checking issue in #84037

@clamattia clamattia force-pushed the lldp_unite_with_other_ethernet_protocols branch from dfad2e3 to 8eb1186 Compare January 15, 2025 11:59
Distribute packets to all ethernet protocols in a unified way.

Signed-off-by: Cla Mattia Galliard <[email protected]>
@clamattia clamattia force-pushed the lldp_unite_with_other_ethernet_protocols branch from 8eb1186 to 4ecfdb0 Compare January 15, 2025 12:59
@clamattia clamattia requested a review from jukkar January 15, 2025 13:01
@clamattia
Copy link
Contributor Author

clamattia commented Jan 17, 2025

Closing in favor of : #84037

@clamattia clamattia closed this Jan 17, 2025
@clamattia clamattia deleted the lldp_unite_with_other_ethernet_protocols branch January 17, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants