From patchwork Thu Dec 24 14:39:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 7918391 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F03B3BEEE5 for ; Thu, 24 Dec 2015 14:44:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCE1B20386 for ; Thu, 24 Dec 2015 14:44:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD5E520035 for ; Thu, 24 Dec 2015 14:44:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754589AbbLXOos (ORCPT ); Thu, 24 Dec 2015 09:44:48 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:37892 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754503AbbLXOor (ORCPT ); Thu, 24 Dec 2015 09:44:47 -0500 Received: from p4ff2eea3.dip0.t-ipconnect.de ([79.242.238.163] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1aC78I-00016F-Io; Thu, 24 Dec 2015 14:44:47 +0000 From: Christoph Hellwig To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH 6/6] IB/uapi: expose device capability flags Date: Thu, 24 Dec 2015 15:39:27 +0100 Message-Id: <1450967967-12479-7-git-send-email-hch@lst.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450967967-12479-1-git-send-email-hch@lst.de> References: <1450967967-12479-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, UPPERCASE_50_75 autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Expose the device capability flags which can be queried through uverbs in the uapi headers. Signed-off-by: Christoph Hellwig --- include/rdma/ib_verbs.h | 94 +++++++++++++++----------------------------- include/uapi/rdma/ib_verbs.h | 66 +++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 62 deletions(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 48bfcf5..b8d4113 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -151,68 +151,38 @@ enum rdma_link_layer { }; enum ib_device_cap_flags { - IB_DEVICE_RESIZE_MAX_WR = (1 << 0), - IB_DEVICE_BAD_PKEY_CNTR = (1 << 1), - IB_DEVICE_BAD_QKEY_CNTR = (1 << 2), - IB_DEVICE_RAW_MULTI = (1 << 3), - IB_DEVICE_AUTO_PATH_MIG = (1 << 4), - IB_DEVICE_CHANGE_PHY_PORT = (1 << 5), - IB_DEVICE_UD_AV_PORT_ENFORCE = (1 << 6), - IB_DEVICE_CURR_QP_STATE_MOD = (1 << 7), - IB_DEVICE_SHUTDOWN_PORT = (1 << 8), - IB_DEVICE_INIT_TYPE = (1 << 9), - IB_DEVICE_PORT_ACTIVE_EVENT = (1 << 10), - IB_DEVICE_SYS_IMAGE_GUID = (1 << 11), - IB_DEVICE_RC_RNR_NAK_GEN = (1 << 12), - IB_DEVICE_SRQ_RESIZE = (1 << 13), - IB_DEVICE_N_NOTIFY_CQ = (1 << 14), - - /* - * This device supports a per-device lkey or stag that can be - * used without performing a memory registration for the local - * memory. Note that ULPs should never check this flag, but - * instead of use the local_dma_lkey flag in the ib_pd structure, - * which will always contain a usable lkey. - */ - IB_DEVICE_LOCAL_DMA_LKEY = (1 << 15), - IB_DEVICE_RESERVED /* old SEND_W_INV */ = (1 << 16), - IB_DEVICE_MEM_WINDOW = (1 << 17), - /* - * Devices should set IB_DEVICE_UD_IP_SUM if they support - * insertion of UDP and TCP checksum on outgoing UD IPoIB - * messages and can verify the validity of checksum for - * incoming messages. Setting this flag implies that the - * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode. - */ - IB_DEVICE_UD_IP_CSUM = (1 << 18), - IB_DEVICE_UD_TSO = (1 << 19), - IB_DEVICE_XRC = (1 << 20), - - /* - * This device supports the IB "base memory management extension", - * which includes support for fast registrations (IB_WR_REG_MR, - * IB_WR_LOCAL_INV and IB_WR_SEND_WITH_INV verbs). This flag should - * also be set by any iWarp device which must support FRs to comply - * to the iWarp verbs spec. iWarp devices also support the - * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the - * stag. - */ - IB_DEVICE_MEM_MGT_EXTENSIONS = (1 << 21), - IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1 << 22), - IB_DEVICE_MEM_WINDOW_TYPE_2A = (1 << 23), - IB_DEVICE_MEM_WINDOW_TYPE_2B = (1 << 24), - IB_DEVICE_RC_IP_CSUM = (1 << 25), - IB_DEVICE_RAW_IP_CSUM = (1 << 26), - /* - * Devices should set IB_DEVICE_CROSS_CHANNEL if they - * support execution of WQEs that involve synchronization - * of I/O operations with single completion queue managed - * by hardware. - */ - IB_DEVICE_CROSS_CHANNEL = (1 << 27), - IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), - IB_DEVICE_SIGNATURE_HANDOVER = (1 << 30), - IB_DEVICE_ON_DEMAND_PAGING = (1 << 31), + IB_DEVICE_RESIZE_MAX_WR = IB_UVERBS_DEVICE_RESIZE_MAX_WR, + IB_DEVICE_BAD_PKEY_CNTR = IB_UVERBS_DEVICE_BAD_PKEY_CNTR, + IB_DEVICE_BAD_QKEY_CNTR = IB_UVERBS_DEVICE_BAD_QKEY_CNTR, + IB_DEVICE_RAW_MULTI = IB_UVERBS_DEVICE_RAW_MULTI, + IB_DEVICE_AUTO_PATH_MIG = IB_UVERBS_DEVICE_AUTO_PATH_MIG, + IB_DEVICE_CHANGE_PHY_PORT = IB_UVERBS_DEVICE_CHANGE_PHY_PORT, + IB_DEVICE_UD_AV_PORT_ENFORCE = IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE, + IB_DEVICE_CURR_QP_STATE_MOD = IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE, + IB_DEVICE_SHUTDOWN_PORT = IB_UVERBS_DEVICE_SHUTDOWN_PORT, + IB_DEVICE_INIT_TYPE = IB_UVERBS_DEVICE_INIT_TYPE, + IB_DEVICE_PORT_ACTIVE_EVENT = IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT, + IB_DEVICE_SYS_IMAGE_GUID = IB_UVERBS_DEVICE_SYS_IMAGE_GUID, + IB_DEVICE_RC_RNR_NAK_GEN = IB_UVERBS_DEVICE_RC_RNR_NAK_GEN, + IB_DEVICE_SRQ_RESIZE = IB_UVERBS_DEVICE_SRQ_RESIZE, + IB_DEVICE_N_NOTIFY_CQ = IB_UVERBS_DEVICE_N_NOTIFY_CQ, + IB_DEVICE_LOCAL_DMA_LKEY = IB_UVERBS_DEVICE_LOCAL_DMA_LKEY, + IB_DEVICE_MEM_WINDOW = IB_UVERBS_DEVICE_MEM_WINDOW, + IB_DEVICE_UD_IP_CSUM = IB_UVERBS_DEVICE_UD_IP_CSUM, + IB_DEVICE_UD_TSO = IB_UVERBS_DEVICE_UD_TSO, + IB_DEVICE_XRC = IB_UVERBS_DEVICE_XRC, + IB_DEVICE_MEM_MGT_EXTENSIONS = IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS, + IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = + IB_UVERBS_DEVICE_BLOCK_MULTICAST_LOOPBACK, + IB_DEVICE_MEM_WINDOW_TYPE_2A = IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A, + IB_DEVICE_MEM_WINDOW_TYPE_2B = IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B, + IB_DEVICE_RC_IP_CSUM = IB_UVERBS_DEVICE_RC_IP_CSUM, + IB_DEVICE_RAW_IP_CSUM = IB_UVERBS_DEVICE_RAW_IP_CSUM, + IB_DEVICE_CROSS_CHANNEL = IB_UVERBS_DEVICE_CROSS_CHANNEL, + IB_DEVICE_MANAGED_FLOW_STEERING = + IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING, + IB_DEVICE_SIGNATURE_HANDOVER = IB_UVERBS_DEVICE_SIGNATURE_HANDOVER, + IB_DEVICE_ON_DEMAND_PAGING = IB_UVERBS_DEVICE_ON_DEMAND_PAGING, }; enum ib_signature_prot_cap { diff --git a/include/uapi/rdma/ib_verbs.h b/include/uapi/rdma/ib_verbs.h index fbadb29..8bba4c4 100644 --- a/include/uapi/rdma/ib_verbs.h +++ b/include/uapi/rdma/ib_verbs.h @@ -7,6 +7,72 @@ * having to pull that into the kernel-internal internal ib_verbs.h */ +enum ib_uverbs_device_cap_flags { + IB_UVERBS_DEVICE_RESIZE_MAX_WR = (1 << 0), + IB_UVERBS_DEVICE_BAD_PKEY_CNTR = (1 << 1), + IB_UVERBS_DEVICE_BAD_QKEY_CNTR = (1 << 2), + IB_UVERBS_DEVICE_RAW_MULTI = (1 << 3), + IB_UVERBS_DEVICE_AUTO_PATH_MIG = (1 << 4), + IB_UVERBS_DEVICE_CHANGE_PHY_PORT = (1 << 5), + IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = (1 << 6), + IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = (1 << 7), + IB_UVERBS_DEVICE_SHUTDOWN_PORT = (1 << 8), + IB_UVERBS_DEVICE_INIT_TYPE = (1 << 9), + IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = (1 << 10), + IB_UVERBS_DEVICE_SYS_IMAGE_GUID = (1 << 11), + IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = (1 << 12), + IB_UVERBS_DEVICE_SRQ_RESIZE = (1 << 13), + IB_UVERBS_DEVICE_N_NOTIFY_CQ = (1 << 14), + + /* + * This device supports a per-device lkey or stag that can be + * used without performing a memory registration for the local + * memory. Note that ULPs should never check this flag, but + * instead of use the local_dma_lkey flag in the ib_pd structure, + * which will always contain a usable lkey. + */ + IB_UVERBS_DEVICE_LOCAL_DMA_LKEY = (1 << 15), + IB_UVERBS_DEVICE_MEM_WINDOW = (1 << 17), + + /* + * Devices should set IB_UVERBS_DEVICE_UD_IP_SUM if they support + * insertion of UDP and TCP checksum on outgoing UD IPoIB + * messages and can verify the validity of checksum for + * incoming messages. Setting this flag implies that the + * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode. + */ + IB_UVERBS_DEVICE_UD_IP_CSUM = (1 << 18), + IB_UVERBS_DEVICE_UD_TSO = (1 << 19), + IB_UVERBS_DEVICE_XRC = (1 << 20), + + /* + * This device supports the IB "base memory management extension", + * which includes support for fast registrations (IB_WR_REG_MR, + * IB_WR_LOCAL_INV and IB_WR_SEND_WITH_INV verbs). This flag should + * also be set by any iWarp device which must support FRs to comply + * to the iWarp verbs spec. iWarp devices also support the + * IB_WR_RDMA_READ_WITH_INV verb for RDMA READs that invalidate the + * stag. + */ + IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = (1 << 21), + IB_UVERBS_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1 << 22), + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = (1 << 23), + IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = (1 << 24), + IB_UVERBS_DEVICE_RC_IP_CSUM = (1 << 25), + IB_UVERBS_DEVICE_RAW_IP_CSUM = (1 << 26), + + /* + * Devices should set IB_UVERBS_DEVICE_CROSS_CHANNEL if they + * support execution of WQEs that involve synchronization + * of I/O operations with single completion queue managed + * by hardware. + */ + IB_UVERBS_DEVICE_CROSS_CHANNEL = (1 << 27), + IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), + IB_UVERBS_DEVICE_SIGNATURE_HANDOVER = (1 << 30), + IB_UVERBS_DEVICE_ON_DEMAND_PAGING = (1 << 31), +}; + enum ib_uverbs_wr_opcode { IB_UVERBS_WR_RDMA_WRITE = 0, IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,