From patchwork Wed Oct 14 08:29:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haggai Eran X-Patchwork-Id: 7391341 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 E7181BEEA4 for ; Wed, 14 Oct 2015 08:30:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B7C7207C6 for ; Wed, 14 Oct 2015 08:30:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 403F920710 for ; Wed, 14 Oct 2015 08:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbbJNIaQ (ORCPT ); Wed, 14 Oct 2015 04:30:16 -0400 Received: from [193.47.165.129] ([193.47.165.129]:56017 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752133AbbJNIaM (ORCPT ); Wed, 14 Oct 2015 04:30:12 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from haggaie@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Oct 2015 10:29:44 +0200 Received: from arch003.mtl.labs.mlnx (arch003.mtl.labs.mlnx [10.137.35.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t9E8TitI013937; Wed, 14 Oct 2015 11:29:44 +0300 From: Haggai Eran To: Doug Ledford Cc: linux-rdma@vger.kernel.org, Haggai Eran , Jason Gunthorpe , Hal Rosenstock , Sean Hefty , Or Gerlitz , Eli Cohen , Mike Marciniszyn Subject: [PATCH 3/6] IB/core: Add capability bit to tell whether per-WR P_Key change in GSI is supported Date: Wed, 14 Oct 2015 11:29:45 +0300 Message-Id: <1444811388-22486-4-git-send-email-haggaie@mellanox.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1444811388-22486-1-git-send-email-haggaie@mellanox.com> References: <1444811388-22486-1-git-send-email-haggaie@mellanox.com> 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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The IB specs do not require per work-request control over the P_Key used in GMPs. Most drivers have implemented this feature, but some drivers such as ipath and mlx5 do not support it. Add a capability bit, and turn it on in drivers that lack support for per-WR P_Key. Cc: Mike Marciniszyn Cc: Eli Cohen Signed-off-by: Haggai Eran --- drivers/infiniband/hw/mlx5/main.c | 1 + drivers/staging/rdma/ipath/ipath_verbs.c | 1 + include/rdma/ib_verbs.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index f1ccd40beae9..2d35e0472215 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1429,6 +1429,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.free_fast_reg_page_list = mlx5_ib_free_fast_reg_page_list; dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status; dev->ib_dev.get_port_immutable = mlx5_port_immutable; + dev->ib_dev.gsi_pkey_index_in_qp = 1; mlx5_ib_internal_fill_odp_caps(dev); diff --git a/drivers/staging/rdma/ipath/ipath_verbs.c b/drivers/staging/rdma/ipath/ipath_verbs.c index ed2bbc2f7eae..2e13a82c1871 100644 --- a/drivers/staging/rdma/ipath/ipath_verbs.c +++ b/drivers/staging/rdma/ipath/ipath_verbs.c @@ -2202,6 +2202,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd) dev->mmap = ipath_mmap; dev->dma_ops = &ipath_dma_mapping_ops; dev->get_port_immutable = ipath_port_immutable; + dev->gsi_pkey_index_in_qp = 1; snprintf(dev->node_desc, sizeof(dev->node_desc), IPATH_IDSTR " %s", init_utsname()->nodename); diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 7845fae6f2df..dc5cd93b3386 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1792,6 +1792,8 @@ struct ib_device { __be64 node_guid; u32 local_dma_lkey; u16 is_switch:1; + /* The device reads the pkey_index from the QP in GSI (QP1) QPs. */ + u16 gsi_pkey_index_in_qp:1; u8 node_type; u8 phys_port_cnt;