-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Python-BCC: support fmod_ret attaching method, and add a useful tool for mptcp #5274
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
Open
Dwyane-Yan
wants to merge
3
commits into
iovisor:master
Choose a base branch
from
Dwyane-Yan:fmod_ret
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
chenhengqi
reviewed
Apr 9, 2025
chenhengqi
reviewed
Apr 10, 2025
chenhengqi
reviewed
Apr 14, 2025
matttbe
reviewed
Apr 15, 2025
Followed by the suggestions of Hengqi, which judging the kernel whether supported 'fmod_ret' by using 'kernel_struct_has_field' to check the existence of enum 'BPF_MODIFY_RETURN'. But, the 'kernel_struct_has_filed' is not supported the 'enum' type, so this patch provides an interface 'kernel_enum_has_val' to achieve this. Co-developed-by: Geliang Tang <[email protected]> Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Gang Yan <[email protected]>
In kernel, there exists a lot of 'fmod_ret' functions, such as 'update_socket_protocol'. But it cannot attached in BCC-python directly, so this patch provides an interface for python to use 'fmod_ret' attaching method. This patch is suggested by Yonghong: ''' On Sun, 2024-08-25 at 21:05 -0700, Yonghong Song wrote: ... > Gang Yan, could you explore to add fmod_ret support in bcc? It should > be similar to kfunc/kretfunc support. I am happy to review your patches. ''' And the method to check 'fmod_ret' support in kernel is from Hengqi. Co-developed-by: Geliang Tang <[email protected]> Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Gang Yan <[email protected]>
Multipath TCP (MPTCP) is an extension of the standard TCP protocol that allows a single transport connection to use multiple network interfaces or paths. MPTCP is useful for applications like bandwidth aggregation, failover, and more resilient connections. Linux kernel starts to support MPTCP since v5.6, this patch provides a method which can easily force applications use MPTCP socket without modifing its code. Co-developed-by: Geliang Tang <[email protected]> Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Gang Yan <[email protected]>
Hi @chenhengqi and @yonghong-song, It was truly delightful to receive your valuable suggestions regarding this pull request. I'm pleased to inform you that all the issues have now been addressed. Would you mind taking another look at it when you have a moment? Thank you so much! |
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.
Multipath TCP (MPTCP) serves as an enhancement to the conventional TCP
protocol, enabling a single transport-layer connection to leverage
multiple network interfaces. This capability makes MPTCP advantageous
for applications requiring bandwidth consolidation, seamless failover
mechanisms, and more robust connectivity solutions.
Linux kernel starts to support MPTCP since v5.6, and it provides a
fmod_ret interface 'update_socket_protocol' to force applications using
MPTCP instead of TCP without modifyiing its code.
So these patches provide a tool named 'mptcpify' which can achieve this.
Using python-BCC is a more easy way for future development, so it is so
important to support 'fmod_ret' in python-BCC.
The first patch is suggested by Yonghong:
‘’‘
On Sun, 2024-08-25 at 21:05 -0700, Yonghong Song wrote:
...
> Gang Yan, could you explore to add fmod_ret support in bcc? It should
> be similar to kfunc/kretfunc support. I am happy to review your patches.
’‘’
when I try to make a commit to kernel. (Link attached below)
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
@matttbe from the MPTCP kernel team had a look at the new tool.