-
Notifications
You must be signed in to change notification settings - Fork 8.3k
net: Support partial checksum offloading #73985
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: Support partial checksum offloading #73985
Conversation
pdgendt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a driver capability, not a global setting. If multiple drivers are used, each should work properly.
211c1a5 to
9f988f5
Compare
|
Please check compliance results, there are missing spaces etc. |
f5a9774 to
e6ee845
Compare
rlubos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the compliance report.
Also the commit title could be updated, the changeset is no longer specific to ICMP.
|
This is convenient, I was planning to look into something like this after LTS because NXP ENET has the same limitation, it only doesn't accelerate ICMPv6 checksum |
Some of the complaints in the compliance report refer to code that I did not change. I could run the corresponding files through clang-format or manually fix the violations, but this would bloat the PR. git diff HEAD~1 HEAD | ./scripts/checkpatch.pl - |
e6ee845 to
66d30ba
Compare
f1abf1e to
90402bf
Compare
include/zephyr/net/ethernet.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Please align with the opening bracket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Btw., the return type was also incorrect, this is fixed as well.
90402bf to
4eed806
Compare
include/zephyr/net/net_if.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| NET_IF_CHECKSUM_IPV4_UDP = NET_IF_CHECKSUM_IPV4_HEADER_BIT| | |
| NET_IF_CHECKSUM_UDP_BIT, | |
| NET_IF_CHECKSUM_IPV4_UDP = NET_IF_CHECKSUM_IPV4_HEADER_BIT | | |
| NET_IF_CHECKSUM_UDP_BIT, |
etc, just reads better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@decsny Good to hear that - feel free to participate in the review, to make sure those changes fit your HW needs as well. |
4eed806 to
ec6dcc7
Compare
I have a draft implementation for the Xilinx AXI Ethernet subsystem, which is where I initially came across this issue, here: #73986 |
ec6dcc7 to
39db211
Compare
39db211 to
0213c5a
Compare
The Xilinx AXI Ethernet subsystem is capable of RX/Tx checksum offloading. While it supports computing IP and UDP/TCP checksums, it does not support computing ICMP checksums and only computes IP checksums for ICMP messages. Thus, this patch adds an additional configuration for ethernet drivers that indicates for which protocols checksum offloading is (to be) supported. This flag is then considered by the IP subsystem in determining when flags need to be computed in software. Signed-off-by: Eric Ackermann <[email protected]>
0213c5a to
5114fd4
Compare
|
It feels kind of strange for this to come from the ethernet config, since this is not really a configuration but rather a hardware capability? why not come from the get_capabilities function? |
decsny
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocking until question is answered
The original motivation was to save bits in the existing hardware capabilities enum. |
not going to block this but I will want to revisit this from the perspective of determining hardware supported features and not just software requests to enable/disable
|
Hi @WorldofJARcraft! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
The Xilinx AXI Ethernet subsystem is capable of RX/Tx checksum offloading. While it supports computing IP and UDP/TCP checksums, it does not support computing ICMP checksums and only computes IP checksums for ICMP messages. Thus, this patch adds an default-disabled option for always computing the ICMP checksum in software while relying on hardware to compute the remaining checksums.