netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: bpf@vger.kernel.org, mrpre@163.com,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Jakub Sitnicki <jakub@cloudflare.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@amazon.com>,
	Willem de Bruijn <willemb@google.com>,
	Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 1/3] bpf, sockmap: Introduce a new kfunc for sockmap
Date: Mon, 28 Apr 2025 17:56:20 -0700	[thread overview]
Message-ID: <aBAjtATRrVNegYjm@pop-os.localdomain> (raw)
In-Reply-To: <20250428081744.52375-2-jiayuan.chen@linux.dev>

On Mon, Apr 28, 2025 at 04:16:52PM +0800, Jiayuan Chen wrote:
> +bpf_sk_skb_set_redirect_cpu()
> +^^^^^^^^^^^^^^^^^^^^^^
> +.. code-block:: c
> +
> +    int bpf_sk_skb_set_redirect_cpu(struct __sk_buff *s, int redir_cpu)
> +
> +This kfunc ``bpf_sk_skb_set_redirect_cpu()`` is available to
> +``BPF_PROG_TYPE_SK_SKB`` BPF programs. It sets the CPU affinity, allowing the
> +sockmap packet redirecting process to run on the specified CPU as much as
> +possible, helping users reduce the interference between the sockmap redirecting
> +background thread and other threads.
> +

I am wondering if it is a better idea to use BPF_MAP_TYPE_CPUMAP for
redirection here instead? Like we did for bpf_redirect_map(). At least
we would not need to store CPU in psock with this approach.

Thanks.

  reply	other threads:[~2025-04-29  0:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28  8:16 [PATCH bpf-next v1 0/3] bpf, sockmap: Improve performance with CPU affinity Jiayuan Chen
2025-04-28  8:16 ` [PATCH bpf-next v1 1/3] bpf, sockmap: Introduce a new kfunc for sockmap Jiayuan Chen
2025-04-29  0:56   ` Cong Wang [this message]
2025-04-29  5:23     ` Jiayuan Chen
2025-04-28  8:16 ` [PATCH bpf-next v1 2/3] bpf, sockmap: Affinitize workqueue to a specific CPU Jiayuan Chen
2025-04-28  8:16 ` [PATCH bpf-next v1 3/3] selftest/bpf/benchs: Add cpu-affinity for sockmap bench Jiayuan Chen
2025-04-29 23:26 ` [PATCH bpf-next v1 0/3] bpf, sockmap: Improve performance with CPU affinity Alexei Starovoitov
2025-04-29 23:47   ` Jiayuan Chen
2025-04-29 23:53     ` Alexei Starovoitov

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=aBAjtATRrVNegYjm@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=horms@kernel.org \
    --cc=jakub@cloudflare.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mrpre@163.com \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=willemb@google.com \
    --cc=yonghong.song@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;
as well as URLs for NNTP newsgroup(s).