-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
- Avoiding ntohs() operation for every incoming packet
- We read the source and destination port from the packet and change the byte order before doing look-up. We can do this operation while updating the port in the MAP, so that we can avoid it doing for every packet. ntohs() is done twice for every packet.
- Performing Bitwise operation instead of Modulo
- Even or odd can be identified by doing bitwise & with 1, instead of modulo operation which involves division and getting the reminder i.e requires more operations. (((*ifany) >> (0)) % 2 == 1) is done thrice for every packet if the variable 'ifany' is configured.
Metadata
Metadata
Assignees
Labels
No labels