Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: 5.10 breaks rxe
Date: Thu, 29 Oct 2020 16:32:04 -0500	[thread overview]
Message-ID: <fe4f7fa9-e988-ff82-ef35-05be8ee9c143@gmail.com> (raw)
In-Reply-To: <DM6PR12MB3834AFC509E07D1711308DBDC2140@DM6PR12MB3834.namprd12.prod.outlook.com>

On 10/29/20 4:08 PM, Jason Gunthorpe wrote:
> Parav will fix it, see the note from Christoph about using dma coerce and mask
> 
> Get Outlook for Android<https://aka.ms/ghei36>
> 

I went ahead and submitted a one line patch that fixes it in rxe. Could do same thing in core.

> ________________________________
> From: Bob Pearson <rpearsonhpe@gmail.com>
> Sent: Thursday, October 29, 2020 5:37:10 PM
> To: Jason Gunthorpe <jgg@nvidia.com>
> Cc: linux-rdma@vger.kernel.org <linux-rdma@vger.kernel.org>
> Subject: 5.10 breaks rxe
> 
> Jason,
> 
> Looking at the current tree post 5.10.0-rc1 rxe is pretty broken.
> 
> The first problem I have run into is caused by the following recent patch:
> 
>    commit f959dcd6ddfd29235030e8026471ac1b022ad2b0
>    Author: Thomas Tai <thomas.tai@oracle.com>
>    Date:   Thu Sep 17 18:43:03 2020 +0200
> 
>        dma-direct: Fix potential NULL pointer dereference
> 
>        When booting the kernel v5.9-rc4 on a VM, the kernel would panic when
>        printing a warning message in swiotlb_map(). The dev->dma_mask must not
>        be a NULL pointer when calling the dma mapping layer. A NULL pointer
>        check can potentially avoid the panic.
> 
>        Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
>        Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>        Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> which causes a warning if ib_device->dma_device->dma_mask is NULL which it is at the moment for rxe.
> 
> But, rxe never does any DMA. It only copies data in software. It does however sometimes do this copy at interrupt level and will fail badly if the users memory is paged out. Rxe just follows the HW rdma model and pins MRs which solves this problem. The original rxe code does packet processing in tasklets which are software interrupts or on the NAPI thread which is also an interrupt.
> 
> Rxe calls ib_register_device() with a NULL 3rd argument which is supported. But in this case, ib_register_device just sets dma_device to point at &ib_device->dev which is sort of a dummy device and never sets dma_mask to anything. This now fails because of the above patch.
> 
> I can think of three approaches to fixing this problem:
> 
> 1. Fix ib_register_device to correctly handle a NULL dma_device argument (if anyone besides rxe uses it)
> 2. Fix rxe to provide a valid dma_device. Currently rxe assumes that ib_device->dev will be it and sets dev.parent to point at the dma_device behind the network device that has rxe installed on it.
> 3. (Much harder) Strip out all the memory pinning and DMA support and perform the copies in work queues which can sleep. The problem is that rdma code basically assumes that DMA is always there.
> 
> This may be easier than I am seeing. Let me know what you suggest.
> 
> Thanks,
> 
> Bob
> 


      parent reply	other threads:[~2020-10-29 21:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 20:37 5.10 breaks rxe Bob Pearson
     [not found] ` <DM6PR12MB3834AFC509E07D1711308DBDC2140@DM6PR12MB3834.namprd12.prod.outlook.com>
2020-10-29 21:32   ` Bob Pearson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe4f7fa9-e988-ff82-ef35-05be8ee9c143@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox