nfp: xdp: report if program is offloaded
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 22 Jun 2017 01:25:10 +0000 (18:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jun 2017 17:42:20 +0000 (13:42 -0400)
Make use of just added XDP_ATTACHED_HW.

Signed-off-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 c9fc1df1823e14d7f1077401f6dcd8efc25e24fb..2134493ec8a801dc2a6b7d9dee860846fbba37fa 100644 (file)
@@ -3341,6 +3341,8 @@ static int nfp_net_xdp(struct net_device *netdev, struct netdev_xdp *xdp)
                                         xdp->extack);
        case XDP_QUERY_PROG:
                xdp->prog_attached = !!nn->xdp_prog;
+               if (nn->dp.bpf_offload_xdp)
+                       xdp->prog_attached = XDP_ATTACHED_HW;
                xdp->prog_id = nn->xdp_prog ? nn->xdp_prog->aux->id : 0;
                return 0;
        default: