Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75F9FC43441 for ; Tue, 20 Nov 2018 03:25:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C51E2080C for ; Tue, 20 Nov 2018 03:25:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C51E2080C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=talpey.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730544AbeKTNwg (ORCPT ); Tue, 20 Nov 2018 08:52:36 -0500 Received: from p3plsmtpa11-10.prod.phx3.secureserver.net ([68.178.252.111]:38146 "EHLO p3plsmtpa11-10.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeKTNwf (ORCPT ); Tue, 20 Nov 2018 08:52:35 -0500 Received: from [192.168.0.55] ([24.218.182.144]) by :SMTPAUTH: with ESMTPSA id OwfRgjeqWI3uvOwfRgMVeg; Mon, 19 Nov 2018 20:25:38 -0700 Subject: Re: [PATCH v1 4/4] xprtrdma: Plant XID in on-the-wire RDMA offset (FRWR) To: Jason Gunthorpe Cc: "Mora, Jorge" , Chuck Lever , Olga Kornievskaia , linux-rdma , Linux NFS Mailing List References: <6592845E-0136-4D42-8426-3E2A0BB5FFE7@oracle.com> <4A94F1A9-96A4-4A2F-8617-AF0E2380D0C1@oracle.com> <9BD3F7C9-96BF-4555-A901-5E82E2CF9E28@oracle.com> <4EE34B64-0BEB-439A-B2A2-D77673D4CF70@oracle.com> <5EA42399-05C2-40D3-A5CA-7B40971AEC33@netapp.com> <20181119224615.GM4890@ziepe.ca> <20181120030916.GQ4890@ziepe.ca> From: Tom Talpey Message-ID: <8fd325fa-290a-6381-80d8-e6ac20acffe8@talpey.com> Date: Mon, 19 Nov 2018 22:25:37 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181120030916.GQ4890@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfB2XBmNgTs19lKv3c4x0zhKQPDa+x5j3KyJMk/lqSNdnyw9hrSNbTv0a7S71719ZBNUSB3oiU+4663BfFWwTHoid7pCbIa4SD0xvBV61rp0L0iq0dm7e wAimQwmucfKwHsPOkXLnR0RNwd2NUjWw2SvY8iWmZEevV2oPcdTbEDb3OuRN6DUIfekZzt9t7kNiT+hbpG2EjkRO5QGayGVreYXF/Jwz0T2dQZ57EbTKBnHd l/exiUk8AXRt08yaIj0ghATKGVH6Pcn2IcVXVoX/8gbsdhYXrzyxhi/TFuDzFHpAUG3L1Uqz9eLh2H55ODcvaEACM7I1PozwTbAmOc+dlEQ= Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 11/19/2018 10:09 PM, Jason Gunthorpe wrote: > On Mon, Nov 19, 2018 at 09:45:24PM -0500, Tom Talpey wrote: >> On 11/19/2018 5:46 PM, Jason Gunthorpe wrote: >>> On Mon, Nov 19, 2018 at 09:42:56PM +0000, Mora, Jorge wrote: >>>> Hello Chuck, >>>> >>>> I am confused, is it the whole purpose of RDMA is to place the data >>>> directly into the memory location given by the virtual address or >>>> offset? What you are saying is that this offset is not the actual >>>> memory address and so the driver must map this offset to the actual >>>> address? >>> >>> All RDMA on the wire addresses are 'virtual' and always go through >>> translation hardware to reach a physical memory address. Even if you >>> have a virtual address that matches your physical address there will >>> still be translation hardware to enforce security. >>> >>> The direct placement refers to not copying data, not to using physical >>> memory addresses throughout the protocol design. >>> >>> So it is better to use a virtual address that doesn't disclose any >>> information about the host's configuration to the network, such as >>> physical locations of kernel memory. >> >> Agreed. And, this is a very subtle but very powerful aspect of FRWR >> registration, that the high-order bits of the "virtual address" can >> basically be any value of the requestor's (client's) choice. >> >> Note, the low-order bits, up to the maximum offset used by the upper >> layer (e.g. a few MB for NFS), must be reserved in order to allow RDMA >> segments to iterate over the range of bytes in the region. That's only >> 24 or so bits out of the available 64, here however. > > Why does it depend on protocol? Because the maximum payload being RDMA's is an upper layer matter. The idea here is to provide a certain number of "invariant" bits in the offset / virtual address. Chuck proposes reserving just 32 bits, leaving 32 bits of range, quite comfy. > So long as the adaptor can compute VA + Offset = Physical the upper > bits can be changed. Absolutely, but if the offset walks into the high-order invariant bits, they won't be invariant any longer. It would still work, but it would defeat the wireshark trick that Chuck wants to play. > For many adaptors that means PAGE_SIZE or huge > page size level alignment.. I'm not sure I understand this. The FRWR hides the native page size, by providing the page frames in the local work request. Their size isn't known to the protocol. Tom.