* [PATCH 1/1] mvneta: fix prefetch location
@ 2020-06-14 7:11 Sven Auhagen
2020-06-14 8:23 ` Jesper Dangaard Brouer
0 siblings, 1 reply; 3+ messages in thread
From: Sven Auhagen @ 2020-06-14 7:11 UTC (permalink / raw)
To: netdev; +Cc: thomas.petazzoni, brouer, lorenzo
The packet header prefetch is at an offset
now. Correct the prefetch address.
Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 51889770958d..344fc5f649b4 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2229,7 +2229,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp,
len, dma_dir);
/* Prefetch header */
- prefetch(data);
+ prefetch(data + pp->rx_offset_correction + MVNETA_MH_SIZE);
xdp->data_hard_start = data;
xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mvneta: fix prefetch location
2020-06-14 7:11 [PATCH 1/1] mvneta: fix prefetch location Sven Auhagen
@ 2020-06-14 8:23 ` Jesper Dangaard Brouer
2020-06-15 9:10 ` Sven Auhagen
0 siblings, 1 reply; 3+ messages in thread
From: Jesper Dangaard Brouer @ 2020-06-14 8:23 UTC (permalink / raw)
To: Sven Auhagen; +Cc: netdev, thomas.petazzoni, lorenzo, brouer
On Sun, 14 Jun 2020 09:11:28 +0200
Sven Auhagen <sven.auhagen@voleatech.de> wrote:
> The packet header prefetch is at an offset
> now. Correct the prefetch address.
>
> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
> ---
> drivers/net/ethernet/marvell/mvneta.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 51889770958d..344fc5f649b4 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -2229,7 +2229,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp,
> len, dma_dir);
>
> /* Prefetch header */
> - prefetch(data);
> + prefetch(data + pp->rx_offset_correction + MVNETA_MH_SIZE);
The comment does say "header", so I guess your change is correct if we
are talking about the packet header.
Currently this prefetch will help XDP-redirect, as it store xdp_frame
in this area.
> xdp->data_hard_start = data;
> xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;
If you really need to prefetch the packet headers, it would be the same
as calling prefetch(xdp->data), right?
Have you benchmarked that this prefetch is a benefit?
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mvneta: fix prefetch location
2020-06-14 8:23 ` Jesper Dangaard Brouer
@ 2020-06-15 9:10 ` Sven Auhagen
0 siblings, 0 replies; 3+ messages in thread
From: Sven Auhagen @ 2020-06-15 9:10 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: netdev, thomas.petazzoni, lorenzo
On Sun, Jun 14, 2020 at 10:23:43AM +0200, Jesper Dangaard Brouer wrote:
> On Sun, 14 Jun 2020 09:11:28 +0200
> Sven Auhagen <sven.auhagen@voleatech.de> wrote:
>
> > The packet header prefetch is at an offset
> > now. Correct the prefetch address.
> >
> > Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
> > ---
> > drivers/net/ethernet/marvell/mvneta.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> > index 51889770958d..344fc5f649b4 100644
> > --- a/drivers/net/ethernet/marvell/mvneta.c
> > +++ b/drivers/net/ethernet/marvell/mvneta.c
> > @@ -2229,7 +2229,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp,
> > len, dma_dir);
> >
> > /* Prefetch header */
> > - prefetch(data);
> > + prefetch(data + pp->rx_offset_correction + MVNETA_MH_SIZE);
>
> The comment does say "header", so I guess your change is correct if we
> are talking about the packet header.
>
> Currently this prefetch will help XDP-redirect, as it store xdp_frame
> in this area.
>
> > xdp->data_hard_start = data;
> > xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;
>
> If you really need to prefetch the packet headers, it would be the same
> as calling prefetch(xdp->data), right?
Yes, that is correct.
>
> Have you benchmarked that this prefetch is a benefit?
I just ran some forwarding tests and the difference is not measureable
in normal forwarding.
You are correct XDP Forwarding seems to be 1-2% slower.
I guess you can disregard the patch.
>
> --
> Best regards,
> Jesper Dangaard Brouer
> MSc.CS, Principal Kernel Engineer at Red Hat
> LinkedIn: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fin%2Fbrouer&data=02%7C01%7Csven.auhagen%40voleatech.de%7C4f3ae28c82514407dfd508d8103c4d1b%7Cb82a99f679814a7295344d35298f847b%7C0%7C0%7C637277198467217085&sdata=qIJ3tkU2mHFqZpArOGnQWSPEVtTBMXK8MpekSGcKavw%3D&reserved=0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-15 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-14 7:11 [PATCH 1/1] mvneta: fix prefetch location Sven Auhagen
2020-06-14 8:23 ` Jesper Dangaard Brouer
2020-06-15 9:10 ` Sven Auhagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox