From patchwork Wed Sep 21 14:41:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9343671 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 AEDB3607D4 for ; Wed, 21 Sep 2016 14:42:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 974E22A742 for ; Wed, 21 Sep 2016 14:42:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BF592A744; Wed, 21 Sep 2016 14:42:06 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 8E77B2A748 for ; Wed, 21 Sep 2016 14:42:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755735AbcIUOmD (ORCPT ); Wed, 21 Sep 2016 10:42:03 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34513 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbcIUOmC (ORCPT ); Wed, 21 Sep 2016 10:42:02 -0400 Received: by mail-wm0-f67.google.com with SMTP id l132so8954530wmf.1 for ; Wed, 21 Sep 2016 07:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=HgxCPu8SWjMtFz16y+ETlsCByLCBIv/gtSFynHPFB8w=; b=lwxi/LLk3iMNQW5IPN0C2Stg7oDi15kaxnzJSZKDY0811875kDlQzm1VUT74U9CI1T L6W1nRw0ON42bzdcOFF2yLApKHIVFpgsHg3oYFG0fgxWTLF5v9qdBtiKYac7JxLXHE04 O+hJPR3P+B2ZGcfvbTXhzeKko9lltB2OUmsK4lvfZsQ95CumjK3jJJWbZLvidP2LkrtY 1KMGgXVZYlg9nhcWo6zV0/bT7Q5tQe1WJu5Q+eyXsc2pc2dL7TnC6W+qfvoxPdU4x7vP CNDNPFDkWdim22Gvhh4M0QRJ4Ew4A4KF2d0BQHlJBxEpPysPW+N5J55rjVgbrHHyZa1h 9Cbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=HgxCPu8SWjMtFz16y+ETlsCByLCBIv/gtSFynHPFB8w=; b=XFeM6R0zS4B8nxc3tlR0Hr2obeMT1BmSEZpDlAqU1YXy7YWk+gBZ198fe92gJCe7+f Ppj8q9Ca60R1w1ob5PLdstvgB8e+gFEYD/FU/OaEWLVm9kRxsMdWml1YwLsLTKLYBYoA z1ZjmVNMn3vqRVnuX0C+s4sVyA2jELYfN9lNOIE0GSbW0Ct/IW4/HHgDk+xUOiFKIk5E qj/w08pGbBQZu8ICaELe1et726fKXDgB1YEuJSS3LCLazdElGr6mFMOjUeBvynMa3/QD S2qJE4J7wZlHR1irpXmhdfv/+JuNMeBMbq0QAUP5ArSQQWdpm8rAh3LabLGd6/vhz6tF VlIw== X-Gm-Message-State: AE9vXwNSs42f5sLDA4c3YYGMALbQk3L18JBWBNcjp6QIk8J3UVpUYSFkPUgjQKopZLN63g== X-Received: by 10.28.41.6 with SMTP id p6mr3699791wmp.18.1474468920595; Wed, 21 Sep 2016 07:42:00 -0700 (PDT) Received: from [192.168.1.183] (c-50-177-105-67.hsd1.ma.comcast.net. [50.177.105.67]) by smtp.googlemail.com with ESMTPSA id z12sm10665496wmz.11.2016.09.21.07.41.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Sep 2016 07:41:59 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [RFC] IB/mad: Eliminate redundant SM class version defines for OPA Message-ID: <4810d736-b0c3-bf73-70c1-975b4af850a3@dev.mellanox.co.il> Date: Wed, 21 Sep 2016 10:41:57 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 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 and rename class version define to SM rather than SMP or SMI Signed-off-by: Hal Rosenstock Reviewed-by: Ira Weiny --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 2d49228..17ba07d 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -769,7 +769,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, * If we are at the start of the LID routed part, don't update the * hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec. */ - if (opa && smp->class_version == OPA_SMP_CLASS_VERSION) { + if (opa && smp->class_version == OPA_SM_CLASS_VERSION) { u32 opa_drslid; if ((opa_get_smp_direction(opa_smp) @@ -2167,7 +2167,7 @@ handle_smi(struct ib_mad_port_private *port_priv, struct ib_mad_hdr *mad_hdr = (struct ib_mad_hdr *)recv->mad; if (opa && mad_hdr->base_version == OPA_MGMT_BASE_VERSION && - mad_hdr->class_version == OPA_SMI_CLASS_VERSION) + mad_hdr->class_version == OPA_SM_CLASS_VERSION) return handle_opa_smi(port_priv, qp_info, wc, port_num, recv, response); diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c index 7ffc14f..484ed60 100644 --- a/drivers/infiniband/hw/hfi1/mad.c +++ b/drivers/infiniband/hw/hfi1/mad.c @@ -128,7 +128,7 @@ static void send_trap(struct hfi1_ibport *ibp, void *data, unsigned len) smp = send_buf->mad; smp->base_version = OPA_MGMT_BASE_VERSION; smp->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED; - smp->class_version = OPA_SMI_CLASS_VERSION; + smp->class_version = OPA_SM_CLASS_VERSION; smp->method = IB_MGMT_METHOD_TRAP; ibp->rvp.tid++; smp->tid = cpu_to_be64(ibp->rvp.tid); @@ -343,7 +343,7 @@ static int __subn_get_opa_nodeinfo(struct opa_smp *smp, u32 am, u8 *data, ni->port_guid = cpu_to_be64(dd->pport[pidx].guid); ni->base_version = OPA_MGMT_BASE_VERSION; - ni->class_version = OPA_SMI_CLASS_VERSION; + ni->class_version = OPA_SM_CLASS_VERSION; ni->node_type = 1; /* channel adapter */ ni->num_ports = ibdev->phys_port_cnt; /* This is already in network order */ @@ -379,7 +379,7 @@ static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev, nip->port_guid = cpu_to_be64(dd->pport[pidx].guid); nip->base_version = OPA_MGMT_BASE_VERSION; - nip->class_version = OPA_SMI_CLASS_VERSION; + nip->class_version = OPA_SM_CLASS_VERSION; nip->node_type = 1; /* channel adapter */ nip->num_ports = ibdev->phys_port_cnt; /* This is already in network order */ @@ -2309,7 +2309,7 @@ static int pma_get_opa_classportinfo(struct opa_pma_mad *pmp, pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD; p->base_version = OPA_MGMT_BASE_VERSION; - p->class_version = OPA_SMI_CLASS_VERSION; + p->class_version = OPA_SM_CLASS_VERSION; /* * Expected response time is 4.096 usec. * 2^18 == 1.073741824 sec. */ @@ -4029,7 +4029,7 @@ static int process_subn_opa(struct ib_device *ibdev, int mad_flags, am = be32_to_cpu(smp->attr_mod); attr_id = smp->attr_id; - if (smp->class_version != OPA_SMI_CLASS_VERSION) { + if (smp->class_version != OPA_SM_CLASS_VERSION) { smp->status |= IB_SMP_UNSUP_VERSION; ret = reply((struct ib_mad_hdr *)smp); return ret; @@ -4239,7 +4239,7 @@ static int process_perf_opa(struct ib_device *ibdev, u8 port, *out_mad = *in_mad; - if (pmp->mad_hdr.class_version != OPA_SMI_CLASS_VERSION) { + if (pmp->mad_hdr.class_version != OPA_SM_CLASS_VERSION) { pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION; return reply((struct ib_mad_hdr *)pmp); } diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index c8a773f..981214b 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h @@ -46,7 +46,7 @@ #define IB_MGMT_BASE_VERSION 1 #define OPA_MGMT_BASE_VERSION 0x80 -#define OPA_SMP_CLASS_VERSION 0x80 +#define OPA_SM_CLASS_VERSION 0x80 /* Management classes */ #define IB_MGMT_CLASS_SUBN_LID_ROUTED 0x01 diff --git a/include/rdma/opa_smi.h b/include/rdma/opa_smi.h index 4a529ef..f789611 100644 --- a/include/rdma/opa_smi.h +++ b/include/rdma/opa_smi.h @@ -44,8 +44,6 @@ #define OPA_MAX_SLS 32 #define OPA_MAX_SCS 32 -#define OPA_SMI_CLASS_VERSION 0x80 - #define OPA_LID_PERMISSIVE cpu_to_be32(0xFFFFFFFF) struct opa_smp {