Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2019-01-03 Thread Tariq Toukan
On 1/2/2019 6:29 PM, Stephen Warren wrote: > On 12/20/18 10:43 AM, Jason Gunthorpe wrote: >> On Wed, Dec 19, 2018 at 11:20:31AM -0700, Stephen Warren wrote: >>> From: Stephen Warren >>> >>> This patch solves a crash at the time of mlx4 driver unload or system >>> shutdown. The crash occurs becau

Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2019-01-02 Thread Christoph Hellwig
Btw, one other little request if you resend this: the mlx5 icm code touched here oddly enough uses the deprecated pci_map_sg/pci_unmap_sg instead of the preferred dma_map_sg/dma_unmap_sg despite otherwise using the generic DMA API. Can you throw in a little cleanup patch for that into your series?

Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2019-01-02 Thread Stephen Warren
On 12/20/18 10:43 AM, Jason Gunthorpe wrote: On Wed, Dec 19, 2018 at 11:20:31AM -0700, Stephen Warren wrote: From: Stephen Warren This patch solves a crash at the time of mlx4 driver unload or system shutdown. The crash occurs because dma_alloc_coherent() returns one value in mlx4_alloc_icm_co

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-25 Thread Gal Pressman
On 25-Dec-18 01:12, Jason Gunthorpe wrote: > On Sun, Dec 23, 2018 at 06:42:20PM +0200, Gal Pressman wrote: >> On 22-Dec-18 01:52, Jason Gunthorpe wrote: >>> On Thu, Dec 20, 2018 at 09:12:43PM -0800, Joe Perches wrote: Care to submit a coding_style.rst patch or improve the one below this?

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-24 Thread Jason Gunthorpe
On Sun, Dec 23, 2018 at 06:42:20PM +0200, Gal Pressman wrote: > On 22-Dec-18 01:52, Jason Gunthorpe wrote: > > On Thu, Dec 20, 2018 at 09:12:43PM -0800, Joe Perches wrote: > >> Care to submit a coding_style.rst patch or > >> improve the one below this? > > > > I took yours and revised it a little

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-24 Thread Jason Gunthorpe
On Sun, Dec 23, 2018 at 04:53:12PM +, Al Viro wrote: > On Sun, Dec 23, 2018 at 06:42:20PM +0200, Gal Pressman wrote: > > > -17) Don't re-invent the kernel macros > > > +17) Using bool > > > +-- > > > + > > > +The Linux kernel uses the C11 standard for the bool type. bool values > >

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-23 Thread Al Viro
On Sun, Dec 23, 2018 at 06:42:20PM +0200, Gal Pressman wrote: > > -17) Don't re-invent the kernel macros > > +17) Using bool > > +-- > > + > > +The Linux kernel uses the C11 standard for the bool type. bool values can > > only C99, surely?

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-23 Thread Gal Pressman
On 22-Dec-18 01:52, Jason Gunthorpe wrote: > On Thu, Dec 20, 2018 at 09:12:43PM -0800, Joe Perches wrote: >> Care to submit a coding_style.rst patch or >> improve the one below this? > > I took yours and revised it a little bit. I spent some time looking at > assembly and decided to drop the perfo

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-21 Thread Jason Gunthorpe
On Thu, Dec 20, 2018 at 09:12:43PM -0800, Joe Perches wrote: > Care to submit a coding_style.rst patch or > improve the one below this? I took yours and revised it a little bit. I spent some time looking at assembly and decided to drop the performance note, the number of cases that run into overhe

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-20 Thread Joe Perches
On Thu, 2018-12-20 at 20:31 -0700, Jason Gunthorpe wrote: > On Thu, Dec 20, 2018 at 06:25:05PM -0800, Joe Perches wrote: > > > I agree it's not a very good message nor is bool use > > of structure members a real problem except in very > > few cases. > > I think the issue is that the link it shows

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-20 Thread Jason Gunthorpe
On Thu, Dec 20, 2018 at 06:25:05PM -0800, Joe Perches wrote: > I agree it's not a very good message nor is bool use > of structure members a real problem except in very > few cases. I think the issue is that the link it shows lacks the context of the discussion thread - and the actual guidance he

Re: rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-20 Thread Andrew Morton
On Thu, 20 Dec 2018 18:25:05 -0800 Joe Perches wrote: > On Thu, 2018-12-20 at 09:49 -0800, Bart Van Assche wrote: > > On Thu, 2018-12-20 at 18:44 +0100, Christoph Hellwig wrote: > > > On Thu, Dec 20, 2018 at 10:43:18AM -0700, Jason Gunthorpe wrote: > > > > > - chunk->coherent is an int not a bo

rfc: bool structure members (was Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent)

2018-12-20 Thread Joe Perches
On Thu, 2018-12-20 at 09:49 -0800, Bart Van Assche wrote: > On Thu, 2018-12-20 at 18:44 +0100, Christoph Hellwig wrote: > > On Thu, Dec 20, 2018 at 10:43:18AM -0700, Jason Gunthorpe wrote: > > > > - chunk->coherent is an int not a bool since checkpatch complains > > > > about > > > > using b

Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-20 Thread Bart Van Assche
On Thu, 2018-12-20 at 18:44 +0100, Christoph Hellwig wrote: > On Thu, Dec 20, 2018 at 10:43:18AM -0700, Jason Gunthorpe wrote: > > > - chunk->coherent is an int not a bool since checkpatch complains about > > > using bool in structs; see https://lkml.org/lkml/2017/11/21/384. > > > > :( bool

Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2018 at 10:43:18AM -0700, Jason Gunthorpe wrote: > > - chunk->coherent is an int not a bool since checkpatch complains about > > using bool in structs; see https://lkml.org/lkml/2017/11/21/384. > > :( bool is much more readable and there is no performance concern in > this st

Re: [PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-20 Thread Jason Gunthorpe
On Wed, Dec 19, 2018 at 11:20:31AM -0700, Stephen Warren wrote: > From: Stephen Warren > > This patch solves a crash at the time of mlx4 driver unload or system > shutdown. The crash occurs because dma_alloc_coherent() returns one > value in mlx4_alloc_icm_coherent(), but a different value is pas

[PATCH V3] net/mlx4: Get rid of page operation after dma_alloc_coherent

2018-12-19 Thread Stephen Warren
From: Stephen Warren This patch solves a crash at the time of mlx4 driver unload or system shutdown. The crash occurs because dma_alloc_coherent() returns one value in mlx4_alloc_icm_coherent(), but a different value is passed to dma_free_coherent() in mlx4_free_icm_coherent(). In turn this is be