Limit filter hwports mask to only interfaces with the filtered IP - #336
Open
zhuyifei1999 wants to merge 1 commit into
Open
Limit filter hwports mask to only interfaces with the filtered IP#336zhuyifei1999 wants to merge 1 commit into
zhuyifei1999 wants to merge 1 commit into
Conversation
Ths change adds a module option to, when a filter is installed, the filter is only installed to interfaces with the IP of that filter. For wild sockets, Onload duplicates the filter for each local address. The original behavior would be that each such filter would be installed to every active interface. Assuming N interfaces and each interface has a different IP, this would result in N filters being installed to each interface, and N^2 filters installed in total. With this option on, however, each interface would get only one filter and N filters being installed in total. When new local addresses are being added, the code will retroactively add apply it existing filters, just like original behavior. However, if an existing local address of one interface is added to a new interface, the original code ignores it, since it assumes that the filter for that existing local address has already been added to all active interfaces. This assumption no longer holds with this patch, so the filters will be re-applied. For local address removal, original code postpones filter removal until the local address is unused on all active interfaces. This behavior is preserved because local address removal is a rare operation not worth optimizing for, in my opinion. The module option is defaulted off for backwards compatibility, in case a user depends on the original behavior, such as relying on a connection being accelerated even when it is received on an interface when the destination address corresponds to a different interface. Multicast logic is untouched. DNAT logic I was unable to test. Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Contributor
Author
|
This patch complements PR #335 so fewer filters are created in multi-NIC machines where those NICs have different IPs |
Contributor
|
Hi folks! This is a somewhat critical issue & fix for users. If you could take a look that would be much appreciated! Thanks! We're available to address any issues you may find. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ths change adds a module option to, when a filter is installed, the filter is only installed to interfaces with the IP of that filter. For wild sockets, Onload duplicates the filter for each local address. The original behavior would be that each such filter would be installed to every active interface. Assuming N interfaces and each interface has a different IP, this would result in N filters being installed to each interface, and N^2 filters installed in total. With this option on, however, each interface would get only one filter and N filters being installed in total.
When new local addresses are being added, the code will retroactively add apply it existing filters, just like original behavior. However, if an existing local address of one interface is added to a new interface, the original code ignores it, since it assumes that the filter for that existing local address has already been added to all active interfaces. This assumption no longer holds with this patch, so the filters will be re-applied.
For local address removal, original code postpones filter removal until the local address is unused on all active interfaces. This behavior is preserved because local address removal is a rare operation not worth optimizing for, in my opinion.
The module option is defaulted off for backwards compatibility, in case a user depends on the original behavior, such as relying on a connection being accelerated even when it is received on an interface when the destination address corresponds to a different interface.
Multicast logic is untouched. DNAT logic I was unable to test.