Re: [PATCH bpf-next v1 1/3] bpf, sockmap: Introduce a new kfunc for sockmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux