From patchwork Mon Oct 21 02:10:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11201195 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 732B4112B for ; Mon, 21 Oct 2019 02:10:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5813721A4A for ; Mon, 21 Oct 2019 02:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbfJUCKm (ORCPT ); Sun, 20 Oct 2019 22:10:42 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40809 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbfJUCKm (ORCPT ); Sun, 20 Oct 2019 22:10:42 -0400 Received: by mail-pf1-f194.google.com with SMTP id x127so7392760pfb.7; Sun, 20 Oct 2019 19:10:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WnTwwddRwV3Gk4zAeLNg4kBvv2BFqr0tFq4aENC8TdM=; b=TmcsO+1j/0DDcOR+3oZOQQ4OtTEvLOLNriXIFh/yEhuf/1AWdkMfh9rnW3F34jJ9sy goToGaF0tqNptTxCRMcif98Jk7jh/Ta0/vIFYGvHlej3nWnPMesKp8Svhdx0u0zKUYo1 9Dicon7zd+C6gwzxySbSR1NEGfU+lc+Qi+sLNFSQvqZokuHgrhW8pkuhZRAxtjo5XGZ5 lL69pbatS6MNeD8adyRidf7+nOpdcX9jnBd8A27zMwKnyYQY1IAA3c8jzkrt6ugOZAUv rMbpzRv2RA2F9I6vidjvZCphj0ASCoAeWKBSOm0i5kiF422aXvZd/DBdOVxReuJYhwSB w2nw== X-Gm-Message-State: APjAAAVuv98su8yhgSrjUfVoU9ZZzdbT7rXgmoZlSyMpM904OtUdjPL9 MCz0+kIPMrBKxQ8FrB5x5+s= X-Google-Smtp-Source: APXvYqwGu8wsBc31BJrBJq36+znOYAHTlH1TGspRRuUmiDVK2gub7nCrFE6X32975nPfNcLTkR6/1A== X-Received: by 2002:a17:90a:9406:: with SMTP id r6mr26771553pjo.0.1571623841620; Sun, 20 Oct 2019 19:10:41 -0700 (PDT) Received: from localhost.net ([2601:647:4000:ce:256c:d417:b24b:327f]) by smtp.gmail.com with ESMTPSA id k23sm12559333pgi.49.2019.10.20.19.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 19:10:40 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Christoph Hellwig , 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 Message-Id: <20191021021030.1037-2-bvanassche@acm.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021021030.1037-1-bvanassche@acm.org> References: <20191021021030.1037-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.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 Cc: Fixes: 0b5cb3300ae5 ("RDMA/srp: Increase max_segment_size") Signed-off-by: Bart Van Assche --- 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); } /** From patchwork Mon Oct 21 02:10:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11201197 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2362112B for ; Mon, 21 Oct 2019 02:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB756218BA for ; Mon, 21 Oct 2019 02:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbfJUCKo (ORCPT ); Sun, 20 Oct 2019 22:10:44 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44954 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbfJUCKn (ORCPT ); Sun, 20 Oct 2019 22:10:43 -0400 Received: by mail-pg1-f194.google.com with SMTP id e10so6754933pgd.11 for ; Sun, 20 Oct 2019 19:10:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jbm+cxLRc7RAp9D4tOJOlQI8lunApAqNH2Ug36mxlE8=; b=Y3BraBUX5mD66eCYqcrUoWKkM5HonQ5wnpTdlZMDHTiK2IsiSgzLKGoHtjkILoyvE+ +4JkawtZ+b9i27ZVaTTJC/j2st3Q2gpsQVjMWMQz2klXWKiTKHIncYhR6hA3IrbaZJl/ 7OfJ3WBFOaIilv58x9JutKhYdvPvwYLBrqwKPOGOOyGJYFlpPF8hBPxKxV/WFS7fqJan O+VixeeMn+jZBpEkqic3NFfhaaaIqVttsEpQV6AMY/QxepJNDHPjRAXcGOlTb6zl6CVL iNv17lCOOo7MI6TPrlALVaqGohS2RgAmWpBW8FShzH8yYlZ+BH5U9LTTkoEqI3PzYXSU aCqg== X-Gm-Message-State: APjAAAWwD6O7lVhk7dv1Cgc/m1Yt9N2Hb5+GWHlkfpZ281Eg1ZIFtlcE HRuHnIfj9JPiEHJbwyvLWTc= X-Google-Smtp-Source: APXvYqy+GoeylrtxnzQJC1ieL2Q7ozkN97Au/HuslVjBOeXU1155iceLzH29vx8zYxhNjZbA2ZiDJA== X-Received: by 2002:aa7:9525:: with SMTP id c5mr19790283pfp.22.1571623843089; Sun, 20 Oct 2019 19:10:43 -0700 (PDT) Received: from localhost.net ([2601:647:4000:ce:256c:d417:b24b:327f]) by smtp.gmail.com with ESMTPSA id k23sm12559333pgi.49.2019.10.20.19.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 19:10:42 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , "Michael J . Ruhl" , Ira Weiny , Adit Ranadive , Shiraz Saleem , Gal Pressman , Selvin Xavier Subject: [PATCH 2/4] RDMA/core: Set DMA parameters correctly Date: Sun, 20 Oct 2019 19:10:28 -0700 Message-Id: <20191021021030.1037-3-bvanassche@acm.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021021030.1037-1-bvanassche@acm.org> References: <20191021021030.1037-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The effect of the dma_set_max_seg_size() call in setup_dma_device() is as follows: - If device->dev.dma_parms is NULL, that call has no effect at all. - If device->dev.dma_parms is not NULL, since that pointer points at the DMA parameters of the parent device, modify the DMA limits of the parent device. Both actions are wrong. Instead of changing the DMA parameters of the parent device, use the DMA parameters of the parent device if these parameters are available. Compile-tested only. Cc: Michael J. Ruhl Cc: Ira Weiny Cc: Adit Ranadive Cc: Shiraz Saleem Cc: Gal Pressman Cc: Selvin Xavier Fixes: d10bcf947a3e ("RDMA/umem: Combine contiguous PAGE_SIZE regions in SGEs") Signed-off-by: Bart Van Assche Signed-off-by: Bart Van Assche --- drivers/infiniband/core/device.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 536310fb6510..b33d684a2a99 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -1199,9 +1199,18 @@ static void setup_dma_device(struct ib_device *device) WARN_ON_ONCE(!parent); device->dma_device = parent; } - /* Setup default max segment size for all IB devices */ - dma_set_max_seg_size(device->dma_device, SZ_2G); + if (!device->dev.dma_parms) { + if (parent) { + /* + * The caller did not provide DMA parameters. Use the + * DMA parameters of the parent device. + */ + device->dev.dma_parms = parent->dma_parms; + } else { + WARN_ON_ONCE(true); + } + } } /* From patchwork Mon Oct 21 02:10:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11201203 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1EB6C112B for ; Mon, 21 Oct 2019 02:10:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06C5C218BA for ; Mon, 21 Oct 2019 02:10:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbfJUCKy (ORCPT ); Sun, 20 Oct 2019 22:10:54 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34137 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbfJUCKq (ORCPT ); Sun, 20 Oct 2019 22:10:46 -0400 Received: by mail-pf1-f195.google.com with SMTP id b128so7411098pfa.1 for ; Sun, 20 Oct 2019 19:10:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SnLq77cUzeET9qFjSSafFg8rd0sMDKKDrKhz/JXtqJs=; b=ICv1K2YNCfesD2FqCMuU60pItseTs/hoJTVryRBvyQlOICLrJnj8KUDLKzshKITywy ZMyWQG9k95tCtmWIFXGflOKja2OPfKL9Pajvc4quXF9h+uI/vCa7oAFfU7zqVgl1XFyv kL850lgAqypOrbJBz6tSa7Jbw+/IsDmMuq3RGffxUf5snVnxTnN1wiJpKMgBvfCiybRy V4BF815CprCDYyXGcUs0dNzwXfzxe2L5/SvktJkArWuEek/azBBwOf7+R8YpjT2kSXj+ K8j41sLEvIOyZ6yksB2QJNkufvoA+hh/Dtz73AIGbrNSKaTvFfBgIKZzRq1fHBcZGP1I I7DA== X-Gm-Message-State: APjAAAUnHLwcaU9mRK9tyLaMPjsFn0fH87YUprbyMWhjofyi9FUl/4H7 q/e/XdqAua0ypueNAvfZlSo= X-Google-Smtp-Source: APXvYqy6PRYPXwatSD2dL+IQtbDk+t9CXT6nil/m1BS63Cjp1NDrUznqtqXvehkVlWTRgopW4pikZQ== X-Received: by 2002:a17:90a:17ad:: with SMTP id q42mr26119570pja.100.1571623844271; Sun, 20 Oct 2019 19:10:44 -0700 (PDT) Received: from localhost.net ([2601:647:4000:ce:256c:d417:b24b:327f]) by smtp.gmail.com with ESMTPSA id k23sm12559333pgi.49.2019.10.20.19.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 19:10:43 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Christoph Hellwig Subject: [PATCH 3/4] rdma_rxe: Increase DMA max_segment_size parameter Date: Sun, 20 Oct 2019 19:10:29 -0700 Message-Id: <20191021021030.1037-4-bvanassche@acm.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021021030.1037-1-bvanassche@acm.org> References: <20191021021030.1037-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Increase the DMA max_segment_size parameter from 64 KB to UINT_MAX. Cc: Christoph Hellwig Signed-off-by: Bart Van Assche --- drivers/infiniband/sw/rxe/rxe_verbs.c | 3 +++ drivers/infiniband/sw/rxe/rxe_verbs.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index fa47bdcc7f54..2ec085b53907 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -1175,6 +1175,9 @@ int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name) addrconf_addr_eui48((unsigned char *)&dev->node_guid, rxe->ndev->dev_addr); dev->dev.dma_ops = &dma_virt_ops; + dev->dev.dma_parms = &rxe->dma_parms; + rxe->dma_parms = (struct device_dma_parameters) + { .max_segment_size = UINT_MAX }; dma_coerce_mask_and_coherent(&dev->dev, dma_get_required_mask(&dev->dev)); diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h index 5c4b2239129c..95834206c80c 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.h +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h @@ -384,6 +384,7 @@ struct rxe_port { struct rxe_dev { struct ib_device ib_dev; struct ib_device_attr attr; + struct device_dma_parameters dma_parms; int max_ucontext; int max_inline_data; struct mutex usdev_lock; From patchwork Mon Oct 21 02:10:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11201201 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D3F7139A for ; Mon, 21 Oct 2019 02:10:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86749218BA for ; Mon, 21 Oct 2019 02:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfJUCKq (ORCPT ); Sun, 20 Oct 2019 22:10:46 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42421 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbfJUCKq (ORCPT ); Sun, 20 Oct 2019 22:10:46 -0400 Received: by mail-pg1-f193.google.com with SMTP id f14so6752410pgi.9 for ; Sun, 20 Oct 2019 19:10:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vTcerqeLx7y8275r+z3eE5hpmq6x0OzokQL0fWcQlL0=; b=SfmwlF0C5OztLH/3cgW3AnKAUC1+bN2g1ElFpEdv8ddVACx3XVXnNI2m8VY1mqqBne 3d4/PKQJSky5gymJD4ySMowFwhzuBzXLiJsWFG0ZMqCjFJtW5wXz5a/kdmn7FNbba7T8 R8M6c8pfLW1iSsO+HuGfK6iEStNSJC+rlmDrak8HckX3EqJVc/H5SqIiNhI+tc/n5mzB flVyEpdohg0JpJCylPbFJigUubVFrrxKKFhme8/8BOEpYeD2RXI1og3W6s3uq4CDLEdX GhLqohk70D1J4pB1u9Wz6zC4MOdIcF/nYPwviVoa1kqaTuqPCWY0bUJAisCuwfToL1yq oakw== X-Gm-Message-State: APjAAAVYriG8qKnVDgvG57L5sXgaGB2YA9Gmj43H0LBPr+M4/VnIQvQb BgCFj5yRohgK44msFJ5Sm74= X-Google-Smtp-Source: APXvYqyM3Yo5vGVQytmZfJCX47BxpA+wlf02Uy9KrRYOZgttQBWa4phzFKLFd7tRwcAfdH9w42SpCQ== X-Received: by 2002:a17:90a:ba83:: with SMTP id t3mr25114993pjr.139.1571623845456; Sun, 20 Oct 2019 19:10:45 -0700 (PDT) Received: from localhost.net ([2601:647:4000:ce:256c:d417:b24b:327f]) by smtp.gmail.com with ESMTPSA id k23sm12559333pgi.49.2019.10.20.19.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 19:10:44 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Bernard Metzler Subject: [PATCH 4/4] siw: Increase DMA max_segment_size parameter Date: Sun, 20 Oct 2019 19:10:30 -0700 Message-Id: <20191021021030.1037-5-bvanassche@acm.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021021030.1037-1-bvanassche@acm.org> References: <20191021021030.1037-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Increase the DMA max_segment_size parameter from 64 KB to UINT_MAX. Cc: Christoph Hellwig Cc: Bernard Metzler Signed-off-by: Bart Van Assche --- 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);