From patchwork Wed Dec 11 18:36:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3327571 X-Patchwork-Delegate: hal@mellanox.com 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 542259F37A for ; Wed, 11 Dec 2013 18:36:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66CFF20119 for ; Wed, 11 Dec 2013 18:36:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F393D200EB for ; Wed, 11 Dec 2013 18:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751230Ab3LKSg0 (ORCPT ); Wed, 11 Dec 2013 13:36:26 -0500 Received: from mail-wg0-f47.google.com ([74.125.82.47]:37861 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076Ab3LKSg0 (ORCPT ); Wed, 11 Dec 2013 13:36:26 -0500 Received: by mail-wg0-f47.google.com with SMTP id n12so6893245wgh.14 for ; Wed, 11 Dec 2013 10:36:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=UWjdONTYPrh6fSRR/KVTBJEr9+dggX6LIyc+udKIE2k=; b=l8hUzvXGIyXpWax2IyslZc9bQmk3Jn+OIQJ8Iy8o4KwXpEEfmPYQ9pBTImyXIdCFp9 LNuP7/xnXwaJXyoUPvXk1tCPQWVHSQG7ez+ckH5n88C98QWYDn0Dhpc2ybZ1wNAJmw9K cgbnHUZ56N15zU2JbRffLZkMgpdgHeUYmnKtxOhYaqIafjuXWA+uyas2WOHoOj9Ie3bX 34iVi7+uesZIe95+Yxiwl8/LsTlkgJ19u2o5DU/jDZ5FYwCBObZn2sorBRJnpLsTKPpR JbdRae+3SiYH/CFDd0q4aDbYlgbCbpGVO6SeP5vjHTCLq7UQHIkNArG6q9d0U6HPzUqV EX4w== X-Gm-Message-State: ALoCoQlWktTTUiP9XCTes403CF+zzFvzImRB0+bV9RWCwdvvIiUBCmpPkLWhlhsPGWrYfywTAkWg X-Received: by 10.194.236.199 with SMTP id uw7mr2793795wjc.63.1386786984730; Wed, 11 Dec 2013 10:36:24 -0800 (PST) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id cx3sm18022226wib.0.2013.12.11.10.36.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 10:36:24 -0800 (PST) Message-ID: <52A8B0A4.9040402@dev.mellanox.co.il> Date: Wed, 11 Dec 2013 13:36:20 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Vladimir Koushnir Subject: [PATCH opensm] osm_sa_path_record.c: path_sl may return SL different from requested SL Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Vladimir Koushnir Signed-off-by: Vladimir Koushnir Signed-off-by: Hal Rosenstock Acked-by: Jim Schutt --- opensm/osm_sa_path_record.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c index d2ff93b..8384ece 100644 --- a/opensm/osm_sa_path_record.c +++ b/opensm/osm_sa_path_record.c @@ -839,10 +839,28 @@ static ib_api_status_t pr_rcv_get_path_parms(IN osm_sa_t * sa, * send the currently computed SL value as a hint and let the routing * engine override it. */ - if (p_re && p_re->path_sl) + if (p_re && p_re->path_sl) { + uint8_t pr_sl; + pr_sl = sl; + sl = p_re->path_sl(p_re->context, sl, cl_hton16(src_lid_ho), cl_hton16(dest_lid_ho)); + if ((comp_mask & IB_PR_COMPMASK_SL) && (sl != pr_sl)) { + OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F2A: " + "Requested SL (%u) doesn't match SL calculated" + "by routing engine (%u) " + "[%s port %d <-> %s port %d]\n", + pr_sl, + sl, + p_src_alias_guid->p_base_port->p_node->print_desc, + p_src_alias_guid->p_base_port->p_physp->port_num, + p_dest_alias_guid->p_base_port->p_node->print_desc, + p_dest_alias_guid->p_base_port->p_physp->port_num); + status = IB_NOT_FOUND; + goto Exit; + } + } /* reset pkey when raw traffic */ if (comp_mask & IB_PR_COMPMASK_RAWTRAFFIC && cl_ntoh32(p_pr->hop_flow_raw) & (1 << 31))