diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2018-05-24 16:46:17 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-05-24 18:36:15 -0700 |
commit | e74de52e55c092e7113f839e74400ce9dbe12ceb (patch) | |
tree | 811913647e2becd8bfa53ea1a36bf4dc631aeb1d /kernel/bpf | |
parent | 735fc4054b3a25034445c6713d259da0f96f8131 (diff) | |
download | talos-op-linux-e74de52e55c092e7113f839e74400ce9dbe12ceb.tar.gz talos-op-linux-e74de52e55c092e7113f839e74400ce9dbe12ceb.zip |
xdp/trace: extend tracepoint in devmap with an err
Extending tracepoint xdp:xdp_devmap_xmit in devmap with an err code
allow people to easier identify the reason behind the ndo_xdp_xmit
call to a given driver is failing.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/devmap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index 77908311ec98..ae16d0c373ef 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -220,7 +220,7 @@ static int bq_xmit_all(struct bpf_dtab_netdev *obj, struct xdp_bulk_queue *bq) { struct net_device *dev = obj->dev; - int sent = 0, drops = 0; + int sent = 0, drops = 0, err = 0; int i; if (unlikely(!bq->count)) @@ -234,6 +234,7 @@ static int bq_xmit_all(struct bpf_dtab_netdev *obj, sent = dev->netdev_ops->ndo_xdp_xmit(dev, bq->count, bq->q); if (sent < 0) { + err = sent; sent = 0; goto error; } @@ -242,7 +243,7 @@ out: bq->count = 0; trace_xdp_devmap_xmit(&obj->dtab->map, obj->bit, - sent, drops, bq->dev_rx, dev); + sent, drops, bq->dev_rx, dev, err); bq->dev_rx = NULL; return 0; error: |