* [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
@ 2016-09-16 19:47 Jesper Dangaard Brouer
2016-09-16 20:00 ` Eric Dumazet
0 siblings, 1 reply; 8+ messages in thread
From: Jesper Dangaard Brouer @ 2016-09-16 19:47 UTC (permalink / raw)
To: netdev, tariqt
Cc: tom, bblanco, rana.shahot, David S. Miller,
Jesper Dangaard Brouer
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>
---
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(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 2040dad8611d..d414c67dfd12 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -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);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
2016-09-16 19:47 [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full Jesper Dangaard Brouer
@ 2016-09-16 20:00 ` Eric Dumazet
2016-09-16 20:29 ` Jesper Dangaard Brouer
0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2016-09-16 20:00 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: netdev, tariqt, tom, bblanco, rana.shahot, David S. Miller
On Fri, 2016-09-16 at 21:47 +0200, Jesper Dangaard Brouer wrote:
> 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>
>
> ---
> 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.
>
> drivers/net/ethernet/mellanox/mlx4/en_rx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 2040dad8611d..d414c67dfd12 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -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 ? ;)
> default:
> bpf_warn_invalid_xdp_action(act);
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
2016-09-16 20:00 ` Eric Dumazet
@ 2016-09-16 20:29 ` Jesper Dangaard Brouer
0 siblings, 0 replies; 8+ messages in thread
From: Jesper Dangaard Brouer @ 2016-09-16 20:29 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev, tariqt, tom, bblanco, rana.shahot,
"David S. Miller\" <davem
On Fri, 16 Sep 2016 13:00:50 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> > index 2040dad8611d..d414c67dfd12 100644
> > --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> > +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> > @@ -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
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
@ 2016-09-16 20:36 Jesper Dangaard Brouer
2016-09-16 20:37 ` Jesper Dangaard Brouer
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jesper Dangaard Brouer @ 2016-09-16 20:36 UTC (permalink / raw)
To: netdev, tariqt
Cc: Eric Dumazet, tom, bblanco, Jesper Dangaard Brouer, rana.shahot,
David S. Miller
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>
---
Note, this fix have nothing to do with the page-refcnt bug I just reported.
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 2040dad8611d..adcd55c655db 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -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:
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
2016-09-16 20:36 Jesper Dangaard Brouer
@ 2016-09-16 20:37 ` Jesper Dangaard Brouer
2016-09-16 20:43 ` Brenden Blanco
2016-09-19 5:32 ` David Miller
2 siblings, 0 replies; 8+ messages in thread
From: Jesper Dangaard Brouer @ 2016-09-16 20:37 UTC (permalink / raw)
To: netdev, tariqt
Cc: Eric Dumazet, tom, bblanco, rana.shahot, David S. Miller, brouer
On Fri, 16 Sep 2016 22:36:12 +0200
Jesper Dangaard Brouer <brouer@redhat.com> wrote:
> 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.
Ups, forgot to add the V2 subject tag... Dave let me know if I should
resend with V2 in subj.?
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
2016-09-16 20:36 Jesper Dangaard Brouer
2016-09-16 20:37 ` Jesper Dangaard Brouer
@ 2016-09-16 20:43 ` Brenden Blanco
2016-09-17 14:46 ` Jesper Dangaard Brouer
2016-09-19 5:32 ` David Miller
2 siblings, 1 reply; 8+ messages in thread
From: Brenden Blanco @ 2016-09-16 20:43 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: netdev, tariqt, Eric Dumazet, tom, rana.shahot, David S. Miller
On Fri, Sep 16, 2016 at 10:36:12PM +0200, Jesper Dangaard Brouer wrote:
> 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>
You could in theory have also tried to recycle the page instead of
dropping it, but that's probably not worth optimizing when tx is backed
up, as you'll only save a handful of page_put's. The code to do so
wouldn't have been pretty.
Reviewed-by: Brenden Blanco <bblanco@plumgrid.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
2016-09-16 20:43 ` Brenden Blanco
@ 2016-09-17 14:46 ` Jesper Dangaard Brouer
0 siblings, 0 replies; 8+ messages in thread
From: Jesper Dangaard Brouer @ 2016-09-17 14:46 UTC (permalink / raw)
To: Brenden Blanco
Cc: brouer, netdev, tariqt, Eric Dumazet, tom, rana.shahot,
David S. Miller
On Fri, 16 Sep 2016 13:43:50 -0700
Brenden Blanco <bblanco@plumgrid.com> wrote:
> On Fri, Sep 16, 2016 at 10:36:12PM +0200, Jesper Dangaard Brouer wrote:
> > 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>
>
> You could in theory have also tried to recycle the page instead of
> dropping it, but that's probably not worth optimizing when tx is backed
> up, as you'll only save a handful of page_put's. The code to do so
> wouldn't have been pretty.
Yes, we could (and perhaps should) recycle the page instead. But as you
also mention it would not look pretty. I'll send a V3, as XDPs primary
concern is performance.
> Reviewed-by: Brenden Blanco <bblanco@plumgrid.com>
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full
2016-09-16 20:36 Jesper Dangaard Brouer
2016-09-16 20:37 ` Jesper Dangaard Brouer
2016-09-16 20:43 ` Brenden Blanco
@ 2016-09-19 5:32 ` David Miller
2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2016-09-19 5:32 UTC (permalink / raw)
To: brouer; +Cc: netdev, tariqt, eric.dumazet, tom, bblanco, rana.shahot
From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Fri, 16 Sep 2016 22:36:12 +0200
> 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>
This patch is for net-next, please be explicit about that in the future.
Applied, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-09-19 5:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16 19:47 [net PATCH] mlx4: fix XDP_TX is acting like XDP_PASS on TX ring full Jesper Dangaard Brouer
2016-09-16 20:00 ` Eric Dumazet
2016-09-16 20:29 ` Jesper Dangaard Brouer
-- strict thread matches above, loose matches on Subject: below --
2016-09-16 20:36 Jesper Dangaard Brouer
2016-09-16 20:37 ` Jesper Dangaard Brouer
2016-09-16 20:43 ` Brenden Blanco
2016-09-17 14:46 ` Jesper Dangaard Brouer
2016-09-19 5:32 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).