diff mbox series

[4/4] siw: Increase DMA max_segment_size parameter

Message ID 20191021021030.1037-5-bvanassche@acm.org (mailing list archive)
State Superseded
Headers show
Series Fixes related to the DMA max_segment_size parameter | expand

Commit Message

Bart Van Assche Oct. 21, 2019, 2:10 a.m. UTC
Increase the DMA max_segment_size parameter from 64 KB to UINT_MAX.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/sw/siw/siw.h      | 1 +
 drivers/infiniband/sw/siw/siw_main.c | 3 +++
 2 files changed, 4 insertions(+)

Comments

Bernard Metzler Oct. 21, 2019, 9:36 a.m. UTC | #1
-----"Bart Van Assche" <bvanassche@acm.org> wrote: -----

>To: "Jason Gunthorpe" <jgg@ziepe.ca>
>From: "Bart Van Assche" <bvanassche@acm.org>
>Date: 10/21/2019 04:10AM
>Cc: "Leon Romanovsky" <leonro@mellanox.com>, "Doug Ledford"
><dledford@redhat.com>, linux-rdma@vger.kernel.org, "Bart Van Assche"
><bvanassche@acm.org>, "Christoph Hellwig" <hch@lst.de>, "Bernard
>Metzler" <bmt@zurich.ibm.com>
>Subject: [EXTERNAL] [PATCH 4/4] siw: Increase DMA max_segment_size
>parameter
>
>Increase the DMA max_segment_size parameter from 64 KB to UINT_MAX.
>

Hi Bart,
Why don't we make device_dma_parameters siw_dma_params 
just a const in siw_main.c? Having it per siw_device suggests
more flexibility than we actually need and support? Probably
true as well for rxe driver. This is all driver specific.

Independent of this current patch, probably even true for
siw_device.attrs. We do not have those capabilities siw
device specific, but just siw driver specific.

Best regards,
Bernard.
>Cc: Christoph Hellwig <hch@lst.de>
>Cc: Bernard Metzler <bmt@zurich.ibm.com>
>Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>---
> drivers/infiniband/sw/siw/siw.h      | 1 +
> drivers/infiniband/sw/siw/siw_main.c | 3 +++
> 2 files changed, 4 insertions(+)
>
>diff --git a/drivers/infiniband/sw/siw/siw.h
>b/drivers/infiniband/sw/siw/siw.h
>index dba4535494ab..1ea3ed249e7b 100644
>--- a/drivers/infiniband/sw/siw/siw.h
>+++ b/drivers/infiniband/sw/siw/siw.h
>@@ -70,6 +70,7 @@ struct siw_pd {
> 
> struct siw_device {
> 	struct ib_device base_dev;
>+	struct device_dma_parameters dma_parms;
> 	struct net_device *netdev;
> 	struct siw_dev_cap attrs;
> 
>diff --git a/drivers/infiniband/sw/siw/siw_main.c
>b/drivers/infiniband/sw/siw/siw_main.c
>index d1a1b7aa7d83..041496376047 100644
>--- a/drivers/infiniband/sw/siw/siw_main.c
>+++ b/drivers/infiniband/sw/siw/siw_main.c
>@@ -402,6 +402,9 @@ static struct siw_device
>*siw_device_create(struct net_device *netdev)
> 	base_dev->phys_port_cnt = 1;
> 	base_dev->dev.parent = parent;
> 	base_dev->dev.dma_ops = &dma_virt_ops;
>+	base_dev->dev.dma_parms = &sdev->dma_parms;
>+	sdev->dma_parms = (struct device_dma_parameters)
>+		{ .max_segment_size = UINT_MAX };
> 	base_dev->num_comp_vectors = num_possible_cpus();
> 
> 	ib_set_device_ops(base_dev, &siw_device_ops);
>-- 
>2.23.0
>
>
Bart Van Assche Oct. 21, 2019, 1:53 p.m. UTC | #2
On 10/21/19 2:36 AM, Bernard Metzler wrote:
> Why don't we make device_dma_parameters siw_dma_params 
> just a const in siw_main.c? Having it per siw_device suggests
> more flexibility than we actually need and support? Probably
> true as well for rxe driver. This is all driver specific.
> 
> Independent of this current patch, probably even true for
> siw_device.attrs. We do not have those capabilities siw
> device specific, but just siw driver specific.

Hi Bernard,

The dma_parms pointer in struct device has not been declared const.
Assigning a pointer to a const structure to the dma_parms member of
struct device would trigger a compiler warning. I think everyone wants
to keep the RDMA code free from compiler warnings.

Thanks,

Bart.
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/siw/siw.h b/drivers/infiniband/sw/siw/siw.h
index dba4535494ab..1ea3ed249e7b 100644
--- a/drivers/infiniband/sw/siw/siw.h
+++ b/drivers/infiniband/sw/siw/siw.h
@@ -70,6 +70,7 @@  struct siw_pd {
 
 struct siw_device {
 	struct ib_device base_dev;
+	struct device_dma_parameters dma_parms;
 	struct net_device *netdev;
 	struct siw_dev_cap attrs;
 
diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c
index d1a1b7aa7d83..041496376047 100644
--- a/drivers/infiniband/sw/siw/siw_main.c
+++ b/drivers/infiniband/sw/siw/siw_main.c
@@ -402,6 +402,9 @@  static struct siw_device *siw_device_create(struct net_device *netdev)
 	base_dev->phys_port_cnt = 1;
 	base_dev->dev.parent = parent;
 	base_dev->dev.dma_ops = &dma_virt_ops;
+	base_dev->dev.dma_parms = &sdev->dma_parms;
+	sdev->dma_parms = (struct device_dma_parameters)
+		{ .max_segment_size = UINT_MAX };
 	base_dev->num_comp_vectors = num_possible_cpus();
 
 	ib_set_device_ops(base_dev, &siw_device_ops);