From: Gang Yan <yangang@kylinos.cn>
To: Matthieu Baerts <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [Patch, v2, 1/2] BCC: Python: Support 'fmod_ret' method for eBPF
Date: Wed, 9 Apr 2025 17:29:33 +0800 [thread overview]
Message-ID: <20250409092933.GA16105@yangang-pc> (raw)
In-Reply-To: <1d6bceea-daae-49b5-918f-60df35b0791f@kernel.org>
On Wed, Apr 09, 2025 at 10:26:23AM +0200, Matthieu Baerts wrote:
Hi Matt,
> Hi Gang,
>
> On 09/04/2025 09:17, Gang Yan wrote:
> > 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.
> >
> > But there exists a question about how to check 'fmod_ret' support in
> > kernel, do you have any suggestion? I already considered checking the
> > kernel version which seems not suitable.
> >
> > Signed-off-by: Gang Yan <yangang@kylinos.cn>
> > ---
> > src/python/bcc/__init__.py | 34 ++++++++++++++++++++++++++++++++++
> > 1 file changed, 34 insertions(+)
> >
> > diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py
> > index 8bc85516..12ce3ef6 100644
> > --- a/src/python/bcc/__init__.py
> > +++ b/src/python/bcc/__init__.py
>
> (...)
>
> > @@ -1189,6 +1205,22 @@ class BPF(object):
> > self.kfunc_entry_fds[fn_name] = fd
> > return self
> >
> > + def attach_fmod_ret(self, fn_name=b""):
> > + fn_name = _assert_is_bytes(fn_name)
> > + fn_name = BPF.add_prefix(b"kmod_ret__", fn_name)
> > +
> > + if fn_name in self.fmod_ret_fds:
> > + raise Exception("Fmod_ret func %s has been attached" % fn_name)
> Detail: maybe clearer with this:
>
> "Fmod_ret func %s is already attached"
>
> (...)
>
In BCC's attach_kfunc:
if fn_name in self.kfunc_entry_fds:
raise Exception("Kernel entry func %s has been attached" % fn_name)
So I think it's better to keep the same with it.
I agree with your view that mptcpify.py should, by default, enforce the
use of MPTCP for all applications, and this feature will be incorporated
before it is integrated into BCC tools.
The PR link:
https://github.com/iovisor/bcc/pull/5274
Thanks!
Best wishes!
Gang
> Cheers,
> Matt
> --
> Sponsored by the NGI0 Core fund.
>
>
next prev parent reply other threads:[~2025-04-09 9:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 7:17 [Patch, v2, 0/2] BCC: python: support fmod_ret Gang Yan
2025-04-09 7:17 ` [Patch, v2, 1/2] BCC: Python: Support 'fmod_ret' method for eBPF Gang Yan
2025-04-09 8:26 ` Matthieu Baerts
2025-04-09 9:29 ` Gang Yan [this message]
2025-04-09 7:17 ` [Patch, v2, 2/2] BCC: python: add a useful tool for mptcp Gang Yan
2025-04-09 8:26 ` Matthieu Baerts
2025-04-09 8:26 ` [Patch, v2, 0/2] BCC: python: support fmod_ret Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250409092933.GA16105@yangang-pc \
--to=yangang@kylinos.cn \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox