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: <20161217.102057.1497114610120684110.davem@davemloft.net>
Date:   Sat, 17 Dec 2016 10:20:57 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     thomas.petazzoni@...e-electrons.com
Cc:     netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        jason@...edaemon.net, andrew@...n.ch,
        sebastian.hesselbarth@...il.com,
        gregory.clement@...e-electrons.com, mw@...ihalf.com,
        stefanc@...vell.com, nadavh@...vell.com, hannah@...vell.com,
        yehuday@...vell.com, raphael.glon@...p.ovh.com,
        stable@...r.kernel.org
Subject: Re: [PATCH] net: mvpp2: fix dma unmapping of TX buffers for
 fragments

From: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Date: Tue, 13 Dec 2016 17:53:15 +0100

> diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
> index 1026c45..d168b13 100644
> --- a/drivers/net/ethernet/marvell/mvpp2.c
> +++ b/drivers/net/ethernet/marvell/mvpp2.c
> @@ -791,6 +791,8 @@ struct mvpp2_txq_pcpu {
>  	/* Array of transmitted buffers' physical addresses */
>  	dma_addr_t *tx_buffs;
>  
> +	size_t *tx_data_size;
> +

You're really destroying cache locality, and making things overly
complicated, by having two arrays.  Actually this is now the third in
this structure alone.  That's crazy.

Just have one array for the TX ring software state:

struct tx_buff_info {
	struct sk_buff	*skb;
	dma_addr_t	dma_addr;
	unsigned int	size;
};

Then in the per-cpu TX struct:

	struct tx_buff_info	*info;

This way every data access by the cpu for processing a ring entry
will be localized, increasing cache hit rates.

This also significantly simplifies the code that allocates and
frees this memory.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ