From patchwork Tue Aug 23 17:54:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 9296087 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FFFD60574 for ; Tue, 23 Aug 2016 17:55:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5461928AE9 for ; Tue, 23 Aug 2016 17:55:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48F5E28C51; Tue, 23 Aug 2016 17:55:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C664D28AE9 for ; Tue, 23 Aug 2016 17:55:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754591AbcHWRzK (ORCPT ); Tue, 23 Aug 2016 13:55:10 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:33969 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbcHWRy3 (ORCPT ); Tue, 23 Aug 2016 13:54:29 -0400 Received: by mail-it0-f67.google.com with SMTP id e63so8822549ith.1; Tue, 23 Aug 2016 10:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=8VD4K4Snh1a+ra+mcTLkcQHOuicypYudgbSxjPRqcVI=; b=rFweTwbnN1mXf4BZcIQKeFHXjV2PGzFCNiFUM9OotzRD8qI9zUAEHM+yxXbWvjsOF6 VLMWhG5V57a098QyIEQO1YpiOzzfyZYaobW2jcvlDh8mfGmrM9LgeGBUr8hau0YsbgQY uqVOTNPnO+fuRlBsIKYa2KPhGO268/03enRGj4GrmWHn+IpWRvVcK8jBkL0f4VRnHz3p LqmEbsS55MzRsMhkIUF1qvj0Iyn4qKZMmGX5G9m0XzqAc8L6HHNkhpjUXK29C8DGw3tS IF1gaZ2V1krAPk91JLuUoTKwFlcmKCZlwk7aqXNCvHGjVo/6aCq6Xi9GyHSmLNUPdDRY pYUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=8VD4K4Snh1a+ra+mcTLkcQHOuicypYudgbSxjPRqcVI=; b=hKE2GkcAvY9YZNv/MXfQ/0uLGtZpq5V67nFnUuarDVnexQIXvkdhErGf5p9ouU4xsU YOjgydZiPrWzr8yOFwNqdJJHQ2QKcl/BNVPRlZsX/SMlr2tfjgcb7QAu2j9iu2c6ISZs tas0BSIashSJv2VMNqdUHT8+B1Mhy0hCBGNJYLeDlWSSHn97xhb56zfRnKt5UsQ8Vxck cbd8xToPZ0hqGT44uCX3QDKBSEiLSBeT2Vtw3rIVGaObEcrjH3JIuaPhWjX1OlYhCeQd C4UUgEMovyBMzf+26iAyPnBhCeftIgeuh1kn4LvHGJvUmu559rCDr/6SfBRA+x1+PpmF 3hfg== X-Gm-Message-State: AEkoouso5/N0cSU6TNrDbl8byASlxf+uXW0ZNVn3JpJ6Vr8oO3PsJQ5KuO/ETt+aovwvsQ== X-Received: by 10.107.41.67 with SMTP id p64mr30004177iop.130.1471974847580; Tue, 23 Aug 2016 10:54:07 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:ec4:7aff:fe6c:1dce]) by smtp.gmail.com with ESMTPSA id i80sm1768848ita.5.2016.08.23.10.54.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Aug 2016 10:54:07 -0700 (PDT) Subject: [PATCH v2 15/22] rpcrdma: RDMA/CM private message data structure From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Tue, 23 Aug 2016 13:54:06 -0400 Message-ID: <20160823175406.13038.79913.stgit@manet.1015granger.net> In-Reply-To: <20160823174402.13038.84561.stgit@manet.1015granger.net> References: <20160823174402.13038.84561.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce data structure used by both client and server to exchange implementation details during RDMA/CM connection establishment. This is an experimental out-of-band exchange between Linux RPC-over-RDMA Version One implementations, replacing the deprecated CCP (see RFC 5666bis). The purpose of this extension is to enable prototyping of features that might be introduced in a subsequent version of RPC-over-RDMA. Suggested by Christoph Hellwig and Devesh Sharma. Signed-off-by: Chuck Lever Reviewed-by: Sagi Grimberg --- include/linux/sunrpc/rpc_rdma.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h index 3b1ff38..a7da6bf 100644 --- a/include/linux/sunrpc/rpc_rdma.h +++ b/include/linux/sunrpc/rpc_rdma.h @@ -41,6 +41,7 @@ #define _LINUX_SUNRPC_RPC_RDMA_H #include +#include #define RPCRDMA_VERSION 1 #define rpcrdma_version cpu_to_be32(RPCRDMA_VERSION) @@ -129,4 +130,38 @@ enum rpcrdma_proc { #define rdma_done cpu_to_be32(RDMA_DONE) #define rdma_error cpu_to_be32(RDMA_ERROR) +/* + * Private extension to RPC-over-RDMA Version One. + * Message passed during RDMA-CM connection set-up. + * + * Add new fields at the end, and don't permute existing + * fields. + */ +struct rpcrdma_connect_private { + __be32 cp_magic; + u8 cp_version; + u8 cp_flags; + u8 cp_send_size; + u8 cp_recv_size; +} __packed; + +#define rpcrdma_cmp_magic __cpu_to_be32(0xf6ab0e18) + +enum { + RPCRDMA_CMP_VERSION = 1, + RPCRDMA_CMP_F_SND_W_INV_OK = BIT(0), +}; + +static inline u8 +rpcrdma_encode_buffer_size(unsigned int size) +{ + return (size >> 10) - 1; +} + +static inline unsigned int +rpcrdma_decode_buffer_size(u8 val) +{ + return ((unsigned int)val + 1) << 10; +} + #endif /* _LINUX_SUNRPC_RPC_RDMA_H */