From patchwork Sun Dec 23 17:14:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10741771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1267218A6 for ; Sun, 23 Dec 2018 17:15:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EACE528736 for ; Sun, 23 Dec 2018 17:15:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFA012873E; Sun, 23 Dec 2018 17:15:24 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY 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 81E6628736 for ; Sun, 23 Dec 2018 17:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725812AbeLWRPW (ORCPT ); Sun, 23 Dec 2018 12:15:22 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:41689 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725801AbeLWRPV (ORCPT ); Sun, 23 Dec 2018 12:15:21 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Dec 2018 19:21:38 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wBNHFEx9030330; Sun, 23 Dec 2018 19:15:14 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id wBNHFEks007172; Sun, 23 Dec 2018 19:15:14 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id wBNHFDho007171; Sun, 23 Dec 2018 19:15:13 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, michaelgur@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 4/6] verbs: Expose port_cap_mask2 in ibv_query_port Date: Sun, 23 Dec 2018 19:14:55 +0200 Message-Id: <1545585297-6677-5-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1545585297-6677-1-git-send-email-yishaih@mellanox.com> References: <1545585297-6677-1-git-send-email-yishaih@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Guralnik New port_cap_flags2 is derived from IB spec PortInfo CapabilityMask2. The field is added to ibv_port_attr and a new flag in port_cap_flags for port_cap_flags2 support is added. In addition, a print of port_cap_flags2 was added to devinfo. Signed-off-by: Michael Guralnik Signed-off-by: Yishai Hadas --- libibverbs/cmd_device.c | 1 + libibverbs/examples/devinfo.c | 1 + libibverbs/man/ibv_query_port.3 | 1 + libibverbs/verbs.h | 11 +++++++++++ 4 files changed, 14 insertions(+) diff --git a/libibverbs/cmd_device.c b/libibverbs/cmd_device.c index 803d33d..d806351 100644 --- a/libibverbs/cmd_device.c +++ b/libibverbs/cmd_device.c @@ -90,6 +90,7 @@ int ibv_cmd_query_port(struct ibv_context *context, uint8_t port_num, case SUCCESS: copy_query_port_resp_to_port_attr(port_attr, &resp_ex.legacy_resp); + port_attr->port_cap_flags2 = resp_ex.port_cap_flags2; break; default: return ret; diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c index dee74b8..5bbe936 100644 --- a/libibverbs/examples/devinfo.c +++ b/libibverbs/examples/devinfo.c @@ -584,6 +584,7 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port) if (verbose) { printf("\t\t\tmax_msg_sz:\t\t0x%x\n", port_attr.max_msg_sz); printf("\t\t\tport_cap_flags:\t\t0x%08x\n", port_attr.port_cap_flags); + printf("\t\t\tport_cap_flags2:\t0x%04x\n", port_attr.port_cap_flags2); printf("\t\t\tmax_vl_num:\t\t%s (%d)\n", vl_str(port_attr.max_vl_num), port_attr.max_vl_num); printf("\t\t\tbad_pkey_cntr:\t\t0x%x\n", port_attr.bad_pkey_cntr); diff --git a/libibverbs/man/ibv_query_port.3 b/libibverbs/man/ibv_query_port.3 index b1f490a..6d077a3 100644 --- a/libibverbs/man/ibv_query_port.3 +++ b/libibverbs/man/ibv_query_port.3 @@ -47,6 +47,7 @@ uint8_t active_speed; /* Currently active link speed */ uint8_t phys_state; /* Physical port state */ uint8_t link_layer; /* link layer protocol of the port */ uint8_t flags; /* Port flags */ +uint16_t port_cap_flags2;/* Port capabilities */ .in -8 }; .sp diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 4851c72..40a7280 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -346,6 +346,7 @@ enum ibv_port_cap_flags { IBV_PORT_SYS_IMAGE_GUID_SUP = 1 << 11, IBV_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12, IBV_PORT_EXTENDED_SPEEDS_SUP = 1 << 14, + IBV_PORT_CAP_MASK2_SUP = 1 << 15, IBV_PORT_CM_SUP = 1 << 16, IBV_PORT_SNMP_TUNNEL_SUP = 1 << 17, IBV_PORT_REINIT_SUP = 1 << 18, @@ -359,6 +360,15 @@ enum ibv_port_cap_flags { IBV_PORT_IP_BASED_GIDS = 1 << 26 }; +enum ibv_port_cap_flags2 { + IBV_PORT_SET_NODE_DESC_SUP = 1 << 0, + IBV_PORT_INFO_EXT_SUP = 1 << 1, + IBV_PORT_VIRT_SUP = 1 << 2, + IBV_PORT_SWITCH_PORT_STATE_TABLE_SUP = 1 << 3, + IBV_PORT_LINK_WIDTH_2X_SUP = 1 << 4, + IBV_PORT_LINK_SPEED_HDR_SUP = 1 << 5, +}; + struct ibv_port_attr { enum ibv_port_state state; enum ibv_mtu max_mtu; @@ -381,6 +391,7 @@ struct ibv_port_attr { uint8_t phys_state; uint8_t link_layer; uint8_t flags; + uint16_t port_cap_flags2; }; enum ibv_event_type {