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]
Date:	Fri, 2 May 2008 11:09:08 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Ben Hutchings <bhutchings@...arflare.com>
Cc:	netdev@...r.kernel.org, linux-net-drivers@...arflare.com
Subject: Re: New driver "sfc" for Solarstorm SFC4000 controller.

On Fri, 2 May 2008 17:05:35 +0100 Ben Hutchings <bhutchings@...arflare.com> wrote:

> > Oh dear, it found
> > 
> > #5617: FILE: drivers/net/sfc/falcon.c:1877:
> > +               if (*(volatile u32 *)dma_done == FALCON_STATS_DONE)
> > 
> > which was naughty of you.  Perhaps this was already discussed in review
> > with the people who actually know what they're talking about.
> 
> There wasn't any specific discussion of this.  Is it wrong?  We want to
> prevent the compiler from caching *dma_done, which is itself written by DMA.

Documentation/volatile-considered-harmful.txt has some dicussion.

> ...
> > > +#define EFX_DRIVER_VERSION	"2.2.0136"
> > 
> > I would suggest that you remove this.  It's just not a useful way of
> > establishing what version of the driver your users are running.  We use the
> > kernel version information for this.
>  
> This is common practice for net drivers.  Maybe we are in our own little
> world on netdev?

That would make it easy for a researcher to work out how often we change a
driver versus how often we increment its private version number.

> > > +static inline int efx_init_rx_buffer_page(struct efx_rx_queue *rx_queue,
> > > +					  struct efx_rx_buffer *rx_buf)
> > > +{
> > > +	struct efx_nic *efx = rx_queue->efx;
> > > +	int bytes, space, offset;
> > > +
> > > +	bytes = efx->rx_buffer_len - EFX_PAGE_IP_ALIGN;
> > > +
> > > +	/* If there is space left in the previously allocated page,
> > > +	 * then use it. Otherwise allocate a new one */
> > > +	rx_buf->page = rx_queue->buf_page;
> > > +	if (rx_buf->page == NULL) {
> > > +		dma_addr_t dma_addr;
> > > +
> > > +		rx_buf->page = alloc_pages(__GFP_COLD | __GFP_COMP | GFP_ATOMIC,
> > > +					   efx->rx_buffer_order);
> > 
> > I don't think we should be using the open-coded __GFP_COMP here.  That's
> > more an mm-internal thing.
> 
> What's the alternative?

Just remove the __GFP_COMP, I expect.  __GFP_COMP will ask the page
allocator to add extra book-keeping info to the pageframe (via
prep_compound_page()).  I doubt if the driver uses that information.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ