-
Notifications
You must be signed in to change notification settings - Fork 16
WIP: quick performance boost changes #148
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
cece100 to
fc3bb15
Compare
fc3bb15 to
b701a31
Compare
|
@kp-mariappan-ramasamy reworked commits and review comments |
| let old_bytes = old.octets(); | ||
| let new_bytes = new.octets(); | ||
|
|
||
| // Convert to u16 pairs for checksum calculation | ||
| let old_words = [ | ||
| u16::from_be_bytes([old_bytes[0], old_bytes[1]]), | ||
| u16::from_be_bytes([old_bytes[2], old_bytes[3]]), | ||
| ]; | ||
| let new_words = [ | ||
| u16::from_be_bytes([new_bytes[0], new_bytes[1]]), | ||
| u16::from_be_bytes([new_bytes[2], new_bytes[3]]), | ||
| ]; | ||
|
|
||
| Self(vec![ | ||
| (old_words[0], new_words[0]), | ||
| (old_words[1], new_words[1]), | ||
| ]) |
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.
usually loop-unrolling optimization would've fixed this for us, but since we use vec.push - it might miss it, so I unrolled manually
| if unlikely(true) { | ||
| warn!(protocol = ?protocol, "Unknown protocol, skipping checksum update"); | ||
| } |
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.
if you are wondering on all the unlikely(true) - it's basically a way to ensure that the WARN gets pushed out of the HOT path, so it's intended
| let mut tcp_packet = MutableTcpPacket::new(packet.payload_mut()).unwrap(); | ||
| let checksum = tcp_packet.get_checksum(); | ||
| // Only update if checksum is present (not 0) | ||
| if checksum != 0 { |
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.
added checksum != 0 check on all layers to allow OFFLOADING to hardware when possible
fe3d4bb to
e37adb4
Compare
|
Code coverage summary for 5dbdad5: ✅ Region coverage 56% passes |
ac802b3 to
d04f77e
Compare
b655365 to
ebfb4bd
Compare
c024622 to
2fb5424
Compare
ae3799e to
66b7f3a
Compare
+ add un/likely primitives (when RUST supports we should change) + consolidate checksum calculations (now support offload on all layers)
+ introduce parking_lot for better performence lock primitives + introduce DashMap for faster atomic hashmap management + adapt API usage to new primitives (no need to unwrap)
66b7f3a to
4e6c30e
Compare
this way it'll be kept in commit-history for reference
Description
feat: introduce cpu-arch, dashmap, parking_lot
Motivation and Context