]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
authorJesper Dangaard Brouer <brouer@redhat.com>
Fri, 16 Sep 2016 20:36:12 +0000 (22:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Sep 2016 05:32:19 +0000 (01:32 -0400)
The XDP_TX action can fail transmitting the frame in case the TX ring
is full or port is down.  In case of TX failure it should drop the
frame, and not as now call 'break' which is the same as XDP_PASS.

Fixes: 9ecc2d86171a ("net/mlx4_en: add xdp forwarding and data write support")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Reviewed-by: Brenden Blanco <bblanco@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_rx.c

index 6758292311f416b823f90b2d65e1b1e9c1be80f8..c80073e4947f2f673c72835c554d70b6d0db3506 100644 (file)
@@ -906,7 +906,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
                                                        length, tx_index,
                                                        &doorbell_pending))
                                        goto consumed;
-                               break;
+                               goto next; /* Drop on xmit failure */
                        default:
                                bpf_warn_invalid_xdp_action(act);
                        case XDP_ABORTED: