lkml.org 
[lkml]   [2020]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH bpf-next 5/6] bpf: sockmap: allow update from BPF
    From
    Date


    On 8/19/20 2:24 AM, Lorenz Bauer wrote:
    > Allow calling bpf_map_update_elem on sockmap and sockhash from a BPF
    > context. The synchronization required for this is a bit fiddly: we
    > need to prevent the socket from changing it's state while we add it
    > to the sockmap, since we rely on getting a callback via
    > sk_prot->unhash. However, we can't just lock_sock like in
    > sock_map_sk_acquire because that might sleep. So instead we disable
    > softirq processing and use bh_lock_sock to prevent further
    > modification.
    >
    > Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>

    Acked-by: Yonghong Song <yhs@fb.com>

    \
     
     \ /
      Last update: 2020-08-19 22:37    [W:3.038 / U:3.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site