-
Notifications
You must be signed in to change notification settings - Fork 373
net: factor out header validation #7557
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
base: main
Are you sure you want to change the base?
Conversation
|
|
8417e14 to
bc82d3a
Compare
Performance Measurements ⏳
|
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.
Can we keep these in src/disco/net? These are rather specific to Firedancer and the util/net bits aim to be more generic (shared across other projects)
| Returns FD_NET_SUCCESS if valid, or FD_NET_ERR_INVAL_UDP_HDR if the header is invalid: | ||
| - net_len and/or udp_sz is impossibly small | ||
| - net_len is larger than udp_sz */ |
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 doesn't define what makes a UDP header "valid" and it also doesn't look at the UDP checksum. I'd call this fd_udp_hdr_bounds_check or similar, and move it out of util/net to disco/net
| <counter name="RxPktCnt" summary="Packet receive count." /> | ||
| <counter name="RxBytesTotal" summary="Total number of bytes received (including Ethernet header)." /> | ||
| <counter name="RxUnderszCnt" summary="Number of incoming packets dropped due to being too small." /> | ||
| <counter name="RxInvalidIp4Cnt" summary="Number of incoming packets dropped due to invalid IP4 header." /> |
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.
IPv4*
This PR centralizes network header validation. The XDP tile guarantees that packets sent downstream will have passed validation.
For ease of review/reversability of desired, the first commit performs the refactor. The second commit changes the reported xdp metrics to take advantage of the new error codes.
The RX perf impact of this change is slightly positive (tested using Pktgen-DPDK from rd-merenguel1 (mlx5) to rd-chachal1 on (mlx5):
before: 8.617 Mpps
After: 8.713 Mpps