bpf: nfp: Report bpf_prog ID during XDP_QUERY_PROG
authorMartin KaFai Lau <kafai@fb.com>
Fri, 16 Jun 2017 00:29:16 +0000 (17:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 15:58:37 +0000 (11:58 -0400)
Add support to nfp to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 49d1756d6a8e0e74b4045b58e6b34c546ad48cc1..378512dec80d476269a822ae219174581bee7589 100644 (file)
@@ -3256,6 +3256,7 @@ static int nfp_net_xdp(struct net_device *netdev, struct netdev_xdp *xdp)
                return nfp_net_xdp_setup(nn, xdp);
        case XDP_QUERY_PROG:
                xdp->prog_attached = !!nn->dp.xdp_prog;
+               xdp->prog_id = nn->dp.xdp_prog ? nn->dp.xdp_prog->aux->id : 0;
                return 0;
        default:
                return -EINVAL;