mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhangmingyi <zhangmingyi5@huawei.com>
To: <daniel@iogearbox.net>
Cc: <ast@kernel.org>, <andrii@kernel.org>, <martin.lau@linux.dev>,
	<song@kernel.org>, <yhs@fb.com>, <john.fastabend@gmail.com>,
	<kpsingh@kernel.org>, <sdf@google.com>, <haoluo@google.com>,
	<jolsa@kernel.org>, <bpf@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <yanan@huawei.com>,
	<wuchangye@huawei.com>, <xiesongyang@huawei.com>,
	<liuxin350@huawei.com>, <liwei883@huawei.com>,
	<tianmuyang@huawei.com>, <zhangmingyi5@huawei.com>
Subject: Re: [PATCH] ipv4, bpf: Introduced to support the ULP to modify sockets during setopt
Date: Sun, 26 Jan 2025 11:36:19 +0800	[thread overview]
Message-ID: <20250126033619.3167023-1-zhangmingyi5@huawei.com> (raw)
In-Reply-To: <66f2d886-e3d4-4f8f-a735-b0ce1c412ee2@iogearbox.net>

We want to call `bpf_setsockopt` to replace the kernel module in the TCP_ULP case. The purpose is to customize the behavior in `connect` and `sendmsg`. We have an open-source community project kmesh (kmesh.net). Based on this, we refer to some processes of TCP Fast Open to implement delayed connect and perform HTTP DNAT when `sendmsg`.

I'll send a patch with a full description and test cases later.

> > Signed-off-by: zhangmingyi <zhangmingyi5@huawei.com>
> > ---
> >   net/core/filter.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/net/core/filter.c b/net/core/filter.c
> > index 713d6f454df3..f23d3f87e690 100644
> > --- a/net/core/filter.c
> > +++ b/net/core/filter.c
> > @@ -5383,6 +5383,10 @@ static int sol_tcp_sockopt(struct sock *sk, int optname,
> >             if (*optlen < 1)
> >                     return -EINVAL;
> >             break;
> > +   case TCP_ULP:
> > +           if (getopt)
> > +                   return -EINVAL;
> > +           break;
> >     case TCP_BPF_SOCK_OPS_CB_FLAGS:
> >             if (*optlen != sizeof(int))
> >                     return -EINVAL;
> 

      reply	other threads:[~2025-01-26  3:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21  8:05 zhangmingyi
2025-01-23 21:14 ` Daniel Borkmann
2025-01-26  3:36   ` zhangmingyi [this message]

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=20250126033619.3167023-1-zhangmingyi5@huawei.com \
    --to=zhangmingyi5@huawei.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuxin350@huawei.com \
    --cc=liwei883@huawei.com \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=tianmuyang@huawei.com \
    --cc=wuchangye@huawei.com \
    --cc=xiesongyang@huawei.com \
    --cc=yanan@huawei.com \
    --cc=yhs@fb.com \
    /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

all inboxes | Powered by JetHome®