mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
Subsystems (4)
PATCH 1/1 mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
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.
---
Note, this fix have nothing to do with the page-refcnt bug I just reported.
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx4/en_rx.c +1 -0
@@ -906,6 +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; + goto next;break ;default :bpf_warn_invalid_xdp_action (act);
Quoted 9 lines · Jesper Dangaard Brouer
The
XDP_TXaction 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 asXDP_PASS.Fixes 9ecc2d86171a ("net/mlx4_en: add xdp forwarding and data write support")Signed-off-by Jesper Dangaard Brouer <[email protected]>---
Note, this fix have nothing to do with the page-refcnt bug I just reported.
Yeah, the e1000 driver proposal patch had the same issue.
Quoted 9 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/mellanox/mlx4/en_rx.c +0
-0
drivers/net/ethernet/mellanox/mlx4/en_rx.c int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · line 910
Quoted 5 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c +1
-0@@ -906,6 +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; + goto next;break ;
Why keeping this break; then ? ;)
Quoted 3 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c +0
-0default :bpf_warn_invalid_xdp_action (act);
Quoted 4 lines · On Fri, 16 Sep 2016 13:00:50 -0700 Eric Dumazet <[email protected]> wrote:
Quoted 4 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c +0
-0
Quoted 8 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · line 910
Quoted 6 lines
drivers/net/ethernet/mellanox/mlx4/en_rx.c +1
-0@@ -906,6 +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; + goto next;break ;Why keeping this break; then ? ;)
I'll send a V2
Signature · 5 lines
Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer