From: Bart Van Assche <bvanassche@acm.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
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>,
stable@vger.kernel.org
Subject: [PATCH 1/4] RDMA/core: Fix ib_dma_max_seg_size()
Date: Sun, 20 Oct 2019 19:10:27 -0700 [thread overview]
Message-ID: <20191021021030.1037-2-bvanassche@acm.org> (raw)
In-Reply-To: <20191021021030.1037-1-bvanassche@acm.org>
If dev->dma_device->params == NULL then the maximum DMA segment size is
64 KB. See also the dma_get_max_seg_size() implementation. This patch
fixes the following kernel warning:
DMA-API: infiniband rxe0: mapping sg segment longer than device claims to support [len=126976] [max=65536]
WARNING: CPU: 4 PID: 4848 at kernel/dma/debug.c:1220 debug_dma_map_sg+0x3d9/0x450
RIP: 0010:debug_dma_map_sg+0x3d9/0x450
Call Trace:
srp_queuecommand+0x626/0x18d0 [ib_srp]
scsi_queue_rq+0xd02/0x13e0 [scsi_mod]
__blk_mq_try_issue_directly+0x2b3/0x3f0
blk_mq_request_issue_directly+0xac/0xf0
blk_insert_cloned_request+0xdf/0x170
dm_mq_queue_rq+0x43d/0x830 [dm_mod]
__blk_mq_try_issue_directly+0x2b3/0x3f0
blk_mq_request_issue_directly+0xac/0xf0
blk_mq_try_issue_list_directly+0xb8/0x170
blk_mq_sched_insert_requests+0x23c/0x3b0
blk_mq_flush_plug_list+0x529/0x730
blk_flush_plug_list+0x21f/0x260
blk_mq_make_request+0x56b/0xf20
generic_make_request+0x196/0x660
submit_bio+0xae/0x290
blkdev_direct_IO+0x822/0x900
generic_file_direct_write+0x110/0x200
__generic_file_write_iter+0x124/0x2a0
blkdev_write_iter+0x168/0x270
aio_write+0x1c4/0x310
io_submit_one+0x971/0x1390
__x64_sys_io_submit+0x12a/0x390
do_syscall_64+0x6f/0x2e0
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Cc: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org>
Fixes: 0b5cb3300ae5 ("RDMA/srp: Increase max_segment_size")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
include/rdma/ib_verbs.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 6a47ba85c54c..e6c167d03aae 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4043,9 +4043,7 @@ static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
*/
static inline unsigned int ib_dma_max_seg_size(struct ib_device *dev)
{
- struct device_dma_parameters *p = dev->dma_device->dma_parms;
-
- return p ? p->max_segment_size : UINT_MAX;
+ return dma_get_max_seg_size(dev->dma_device);
}
/**
--
2.23.0
next prev parent reply other threads:[~2019-10-21 2:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 2:10 [PATCH 0/4] Fixes related to the DMA max_segment_size parameter Bart Van Assche
2019-10-21 2:10 ` Bart Van Assche [this message]
2019-10-21 14:09 ` [PATCH 1/4] RDMA/core: Fix ib_dma_max_seg_size() Jason Gunthorpe
2019-10-21 15:03 ` Bart Van Assche
2019-10-21 15:27 ` Jason Gunthorpe
2019-10-21 15:56 ` Bart Van Assche
2019-10-21 2:10 ` [PATCH 2/4] RDMA/core: Set DMA parameters correctly Bart Van Assche
2019-10-21 14:10 ` Jason Gunthorpe
2019-10-21 16:26 ` Bart Van Assche
2019-10-21 17:44 ` Saleem, Shiraz
2019-10-21 18:10 ` Bart Van Assche
2019-10-21 20:32 ` Saleem, Shiraz
2019-10-22 14:40 ` Jason Gunthorpe
2019-10-22 22:11 ` Bart Van Assche
2019-10-21 2:10 ` [PATCH 3/4] rdma_rxe: Increase DMA max_segment_size parameter Bart Van Assche
2019-10-21 2:10 ` [PATCH 4/4] siw: " Bart Van Assche
2019-10-21 9:36 ` Bernard Metzler
2019-10-21 13:53 ` Bart Van Assche
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=20191021021030.1037-2-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=dledford@redhat.com \
--cc=hch@lst.de \
--cc=jgg@ziepe.ca \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=stable@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