All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, Mat Martineau <martineau@kernel.org>
Cc: Geliang Tang <tanggeliang@kylinos.cn>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v3 1/2] mptcp: add bpf_iter_task for mptcp_sock
Date: Fri, 21 Mar 2025 11:16:46 +0100	[thread overview]
Message-ID: <27d5f3b4-35ae-4ffc-a4dd-0139ddeca7bf@kernel.org> (raw)
In-Reply-To: <45ade20cc4eadcb81fa022aabac69f25d32fc16f.camel@kernel.org>

On 21/03/2025 11:05, Geliang Tang wrote:
> Hi Matt,
> 
> On Fri, 2025-03-21 at 10:19 +0100, Matthieu Baerts wrote:
>> Hi Geliang,
>>
>> On 21/03/2025 05:14, Geliang Tang wrote:
>>> On Tue, 2025-03-18 at 12:26 +0100, Matthieu Baerts wrote:
>>
>> (...)
>>
>>>> Mmh, all 8 callbacks from add_addr to here seem to be linked to
>>>> Netlink
>>>> commands, right? If yes, they should not be here: they don't make
>>>> sense
>>>> for a BPF PM, no? BPF PMs should be configured with BPF, and not
>>>> via
>>>
>>> Do you have any idea how we can pass commands like ADD_ADDR and
>>> addresses from user space to BPF?
>>
>> The userspace can inject any kind of BPF program. Additional
>> addresses
>> can then be hardcoded in this program, or it can load them from eBPF
>> maps, or read skel->bss->(...), etc.
>>
>> Netlink is then not needed.
>>
>>> What I can think of is passing through sockopt, the user space
>>> passes
>>> the command and the address through setsockopt, and the BPF program
>>> handles it through the custom "cgroup/setsockopt". I would like to
>>> hear
>>> your opinions. If you also agree to use sockopt to implement it, I
>>> can
>>> write a test program for this.
> 
> I just tested it and found it difficult to use setsockopt.
> 
> "cgroup/setsockopt" program doesn't work. We need to invoke sleepable
> kfuncs in BPF PM:

(...)

> It seems that we can only choose one of fentry/fexit/fmod_ret, lsm,
> iter, uprobe, or struct_ops type to implement BPF PM.
Thank you for having checked. I think we can look at that aspect later.
I don't think many apps will want this kind of control. They can always
set something in a map, and the BPF program can look at it when needed.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2025-03-21 10:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10  3:30 [PATCH mptcp-next v3 0/2] add bpf_iter_task Geliang Tang
2025-03-10  3:30 ` [PATCH mptcp-next v3 1/2] mptcp: add bpf_iter_task for mptcp_sock Geliang Tang
2025-03-17  9:41   ` Geliang Tang
2025-03-17 10:29     ` Matthieu Baerts
2025-03-17 10:59       ` Geliang Tang
2025-03-17 13:57         ` Matthieu Baerts
2025-03-18  1:25           ` Mat Martineau
2025-03-18 10:54             ` Matthieu Baerts
2025-03-18 20:09               ` Mat Martineau
2025-03-18 10:35           ` Geliang Tang
2025-03-18 11:26             ` Matthieu Baerts
2025-03-21  4:14               ` Geliang Tang
2025-03-21  9:19                 ` Matthieu Baerts
2025-03-21 10:05                   ` Geliang Tang
2025-03-21 10:16                     ` Matthieu Baerts [this message]
2025-03-10  3:30 ` [PATCH mptcp-next v3 2/2] bpf: Customize mptcp's own sock lock Geliang Tang
2025-03-10  5:12 ` [PATCH mptcp-next v3 0/2] add bpf_iter_task MPTCP CI

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=27d5f3b4-35ae-4ffc-a4dd-0139ddeca7bf@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.