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: <YoSvAPd6QaEZi0vh@lore-desk>
Date:   Wed, 18 May 2022 10:32:00 +0200
From:   Lorenzo Bianconi <lorenzo@...nel.org>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     netdev@...r.kernel.org, nbd@....name, john@...ozen.org,
        sean.wang@...iatek.com, Mark-MC.Lee@...iatek.com,
        davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
        Sam.Shih@...iatek.com, linux-mediatek@...ts.infradead.org,
        devicetree@...r.kernel.org, robh@...nel.org,
        lorenzo.bianconi@...hat.com
Subject: Re: [PATCH v2 net-next 05/15] net: ethernet: mtk_eth_soc: rely on
 txd_size in mtk_tx_alloc/mtk_tx_clean

> On Mon, 16 May 2022 18:06:32 +0200 Lorenzo Bianconi wrote:
> >  static int mtk_tx_alloc(struct mtk_eth *eth)
> >  {
> > +	const struct mtk_soc_data *soc = eth->soc;
> >  	struct mtk_tx_ring *ring = &eth->tx_ring;
> > -	int i, sz = sizeof(*ring->dma);
> 
> The change would be smaller if you left sz in place. 
> I guess you have a reason not to?

ack, I will do in v3.

> 
> > +	struct mtk_tx_dma *txd;
> > +	int i;
> >  
> >  	ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
> >  			       GFP_KERNEL);
> >  	if (!ring->buf)
> >  		goto no_tx_mem;
> >  
> > -	ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
> > +	ring->dma = dma_alloc_coherent(eth->dma_dev,
> > +				       MTK_DMA_SIZE * soc->txrx.txd_size,
> >  				       &ring->phys, GFP_ATOMIC);
> 
> Another GFP nugget.

ack I will fix it in v3.

Regards,
Lorenzo

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ