From patchwork Mon May 4 06:14:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 6323301 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A9ECA9F1C2 for ; Mon, 4 May 2015 06:15:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE0E2202EB for ; Mon, 4 May 2015 06:15:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5677201C0 for ; Mon, 4 May 2015 06:15:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751084AbbEDGPM (ORCPT ); Mon, 4 May 2015 02:15:12 -0400 Received: from mga11.intel.com ([192.55.52.93]:50086 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752003AbbEDGPM (ORCPT ); Mon, 4 May 2015 02:15:12 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 03 May 2015 23:15:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,364,1427785200"; d="scan'208";a="488919935" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by FMSMGA003.fm.intel.com with ESMTP; 03 May 2015 23:15:11 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id t446FAnc000420; Mon, 4 May 2015 02:15:10 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t446FAWG000417; Mon, 4 May 2015 02:15:10 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: iweiny set sender to ira.weiny@intel.com using -f From: ira.weiny@intel.com To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Ira Weiny Subject: [RFC PATCH 5/5] IB/core: Add cap_opa_mad helper using RDMA_CORE_CAP_OPA_MAD flag Date: Mon, 4 May 2015 02:14:59 -0400 Message-Id: <1430720099-32512-6-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1430720099-32512-1-git-send-email-ira.weiny@intel.com> References: <1430720099-32512-1-git-send-email-ira.weiny@intel.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=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 From: Ira Weiny OPA MADs share a common header with IBTA MADs but with a different base version and an extended length. These MADs increase the performance of management traffic on OPA devices. Sharing a common header with IBTA MADs allows us to share most of the MAD processing code when dealing with OPA MADs in addition to supporting some IBTA MADs on OPA devices. Signed-off-by: Ira Weiny --- Changes from the OPA series v4: Use new cap_opa_mad and RDMA_CORE_CAP_OPA_MAD flag include/rdma/ib_verbs.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 01bdf12..31f1ff9 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -363,6 +363,7 @@ union rdma_protocol_stats { #define RDMA_CORE_CAP_IB_CM 0x0000000000000004ULL #define RDMA_CORE_CAP_IW_CM 0x0000000000000008ULL #define RDMA_CORE_CAP_IB_SA 0x0000000000000010ULL +#define RDMA_CORE_CAP_OPA_MAD 0x0000000000000020ULL /* Address format 0x0000FFFF00000000 */ #define RDMA_CORE_CAP_AF_IB 0x0000000100000000ULL @@ -1812,6 +1813,21 @@ static inline int cap_ib_mad(struct ib_device *device, u8 port_num) } /** + * cap_opa_mad - Check if the port of device supports OPA defined + * Management Datagrams. + * + * @device: Device to be checked + * @port_num: Port number of the device + * + * Return 0 when port of the device does not support OPA + * Management Datagrams. + */ +static inline int cap_opa_mad(struct ib_device *device, u8 port_num) +{ + return !!(device->core_cap_flags[port_num] & RDMA_CORE_CAP_OPA_MAD); +} + +/** * cap_ib_smi - Check if the port of device has the capability Infiniband * Subnet Management Interface. *