lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200614102343.47837452@carbon>
Date:   Sun, 14 Jun 2020 10:23:43 +0200
From:   Jesper Dangaard Brouer <brouer@...hat.com>
To:     Sven Auhagen <sven.auhagen@...eatech.de>
Cc:     netdev@...r.kernel.org, thomas.petazzoni@...tlin.com,
        lorenzo@...nel.org, brouer@...hat.com
Subject: Re: [PATCH 1/1] mvneta: fix prefetch location

On Sun, 14 Jun 2020 09:11:28 +0200
Sven Auhagen <sven.auhagen@...eatech.de> wrote:

> The packet header prefetch is at an offset
> now. Correct the prefetch address.
> 
> Signed-off-by: Sven Auhagen <sven.auhagen@...eatech.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ