Received: by 10.223.185.116 with SMTP id b49csp7683110wrg; Thu, 1 Mar 2018 09:18:46 -0800 (PST) X-Google-Smtp-Source: AG47ELvp6nRMO3cLlwynrdaxf4AQa5OeANX2UWAZgCPOHWOQvYHv0JuCZ3qTIALXp1p27emLIA+A X-Received: by 10.99.133.193 with SMTP id u184mr2059278pgd.401.1519924726027; Thu, 01 Mar 2018 09:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519924725; cv=none; d=google.com; s=arc-20160816; b=iQKU2j9sj2HlntOZ6xq5ROl2yDJr6ENpnyfJ0kuBdQVXrYDBUi8uQrFF+/8H65eAys 2xUPi+gLBo3wwCPumNtFNXvOAfkHt5Z0Tyo/22FlXTKtWCQQKoxw5QsEQCq+akUcC3ET XzRbzdlVACn1Sevbarir6E2zsnS3eM9WhHTA9DAmjelsP1VO46UUaDKmRgS5Uxt2dH1D 9LizYcoWpW2SQWQgBYhWVa0Ac4Z4+phCwXLJIATplv78/csmgw8IQToe0Et0FICy2Qns p7XsFgwVCTumzT+ADj7tcfjZQtjADmC1GD2BeKFbYgGookO6fhC8Dg0kGr9t2jkHrfRY zgOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=n0HlmxbU0GQbVgObI65CkZQSdbfPsm+uyzqSMt/NJzI=; b=iK7bBxcqcvmUdLHlJR+YAzz8D2rzpQwjvPSohYLk7CMYZA4/AUK+E4U24TBjER3dFO Et+HPM3bA7pMxuIp7sG5A6GDAT4zBJpyKVcZ2fMhDAqiLlLV5pRpkZBLCxaI2GVNo+Rk QVcb81+FnzjB6IiQhCxeMd433BgcKfFwGkBX2dac1/5XA9DC4BfrikhWAj/eJ7ZOTPdb VTvYSQOveAwpfwQPgIyksOIDO0HKx6NsUL8ggnYPhbCptyVvJ5I++fp/sIr+E+0MMOoU Oq7HkG27+ncM3sIhfQqB8H3bj2owNODbdVsMub3iq8k5wGX7VFoYOw+DaUg3k1tRf/2R OUBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c16-v6si56464pls.801.2018.03.01.09.18.30; Thu, 01 Mar 2018 09:18:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033401AbeCARQy (ORCPT + 99 others); Thu, 1 Mar 2018 12:16:54 -0500 Received: from ale.deltatee.com ([207.54.116.67]:36610 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032942AbeCARQw (ORCPT ); Thu, 1 Mar 2018 12:16:52 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1erRop-00077f-C4; Thu, 01 Mar 2018 10:16:36 -0700 To: Sagi Grimberg , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org Cc: Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson References: <20180228234006.21093-1-logang@deltatee.com> <20180228234006.21093-7-logang@deltatee.com> <72e90cc2-c05a-3ed8-42c7-e4d7a0d535d8@grimberg.me> From: Logan Gunthorpe Message-ID: <3527faf1-3f3a-88d0-caa8-d94d75437d73@deltatee.com> Date: Thu, 1 Mar 2018 10:16:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <72e90cc2-c05a-3ed8-42c7-e4d7a0d535d8@grimberg.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, keith.busch@intel.com, axboe@kernel.dk, hch@lst.de, sbates@raithlin.com, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, sagi@grimberg.me X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v2 06/10] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Sagi, Thanks for the review! On 01/03/18 03:32 AM, Sagi Grimberg wrote: >>   int rdma_rw_ctx_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 >> port_num, >>           struct scatterlist *sg, u32 sg_cnt, u32 sg_offset, >> -        u64 remote_addr, u32 rkey, enum dma_data_direction dir) >> +        u64 remote_addr, u32 rkey, enum dma_data_direction dir, >> +        unsigned int flags) >>   { >>       struct ib_device *dev = qp->pd->device; >>       int ret; >> -    ret = ib_dma_map_sg(dev, sg, sg_cnt, dir); >> +    if (flags & RDMA_RW_CTX_FLAG_PCI_P2PDMA) >> +        ret = pci_p2pdma_map_sg(dev->dma_device, sg, sg_cnt, dir); >> +    else >> +        ret = ib_dma_map_sg(dev, sg, sg_cnt, dir); >> + > > Why not use is_pci_p2pdma_page(sg) instead of a flag? It would be so > much cleaner... Yes, that sounds like a good idea. We can make that change for v3. Logan