On 02/07/2017 03:02 AM, Alexei Starovoitov wrote:
in cases where bpf programs are looking at sockets and packets
that belong to different netns, it could be useful to get an id
that uniquely identify a netns within the whole system.
Therefore introduce 'u64 bpf_sk_netns_id(sk);' helper. It returns
unique value that identifies netns of given socket or dev_net(skb->dev)
The upper 32-bits of the return value contain device id where namespace
filesystem resides and lower 32-bits contain inode number within that
filesystem.
[...]
Signed-off-by: Alexei Starovoitov <a...@kernel.org>
Reviewed-by: David Ahern <d...@cumulusnetworks.com>
Tested-by: David Ahern <d...@cumulusnetworks.com>
For the BPF bits:
Acked-by: Daniel Borkmann <dan...@iogearbox.net>