RE: [PATCH bpf-next v7 06/11] bpf, sockmap: Return socket cookie on lookup from syscall

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

 



Jakub Sitnicki wrote:
> Tooling that populates the SOCK{MAP,HASH} with sockets from user-space
> needs a way to inspect its contents. Returning the struct sock * that the
> map holds to user-space is neither safe nor useful. An approach established
> by REUSEPORT_SOCKARRAY is to return a socket cookie (a unique identifier)
> instead.
> 
> Since socket cookies are u64 values, SOCK{MAP,HASH} need to support such a
> value size for lookup to be possible. This requires special handling on
> update, though. Attempts to do a lookup on a map holding u32 values will be
> met with ENOSPC error.
> 
> Signed-off-by: Jakub Sitnicki <jakub@xxxxxxxxxxxxxx>
> ---

Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux