Re: [PATCH rdma-next] RDMA: Explicitly pass in the dma_device to ib_register_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 22, 2020 at 01:22:06PM -0300, Jason Gunthorpe wrote:
> On Tue, Sep 22, 2020 at 02:22:01PM +0000, Bernard Metzler wrote:
> > ...
> > 
> > >> >diff --git a/drivers/infiniband/sw/siw/siw_main.c
> > >> >b/drivers/infiniband/sw/siw/siw_main.c
> > >> >index d862bec84376..0362d57b4db8 100644
> > >> >+++ b/drivers/infiniband/sw/siw/siw_main.c
> > >> >@@ -69,7 +69,7 @@ static int siw_device_register(struct siw_device
> > >> >*sdev, const char *name)
> > >> >
> > >> > 	sdev->vendor_part_id = dev_id++;
> > >> >
> > >> >-	rv = ib_register_device(base_dev, name);
> > >> >+	rv = ib_register_device(base_dev, name, NULL);
> > >> > 	if (rv) {
> > >> > 		pr_warn("siw: device registration error %d\n", rv);
> > >> > 		return rv;
> > >> >@@ -386,6 +386,8 @@ static struct siw_device
> > >> >*siw_device_create(struct net_device *netdev)
> > >> > 	base_dev->dev.dma_parms = &sdev->dma_parms;
> > >> > 	sdev->dma_parms = (struct device_dma_parameters)
> > >> > 		{ .max_segment_size = SZ_2G };
> > >> >+	dma_coerce_mask_and_coherent(&base_dev->dev,
> > >> >+				     dma_get_required_mask(&base_dev->dev));
> > >>
> > >> Leon, can you please help me to understand this
> > >> additional logic? Do we need to setup the DMA device
> > >> for (software) RDMA devices which rely on dma_virt_ops
> > >> in the end, or better leave it untouched?
> > >
> > >The logic that driver is responsible to give right DMA device,
> > >so yes, you are setting here mask from dma_virt_ops, as RXE did.
> > >
> > Thanks Leon!
> > 
> > I wonder how this was working w/o that before!
> 
> I wonder if dma_virt_ops ignores the masking.. Still seems best to set
> it consistently when using dma_virt_ops.

dma_virt_ops doesn't look at the mask.  But in retrospective
dma_virt_ops has been a really bad idea.  I'd much rather move the
handling of non-physical devices back into the RDMA core in the long
run.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux