From patchwork Wed Mar 15 22:12:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9626801 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 50DB860522 for ; Wed, 15 Mar 2017 22:12:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 429212823D for ; Wed, 15 Mar 2017 22:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 374BF2838E; Wed, 15 Mar 2017 22:12:21 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 E183028356 for ; Wed, 15 Mar 2017 22:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbdCOWMT (ORCPT ); Wed, 15 Mar 2017 18:12:19 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:58072 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752871AbdCOWMS (ORCPT ); Wed, 15 Mar 2017 18:12:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=7aQ5o3mJA++KYVFIFN1mnycl9Yt5GCCy6PMndyN51WQ=; b=xQB7LtDtudZAL18CSGqGUTuYab+/gT5Y1FWKVmq4/zrE0gnn0O89We3HC/glXngUhPZMRJJ1GQJoEeO2HP9hn4eiB6OBy80B21GUFD5rcRCj8CmrE1Bbjlr/fdHwTUFW1/GBj3SzPQvsB1uXksHWTalAm1F2sb5FU44hiKfFR6w=; Received: from [10.0.0.156] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1coH9S-0004qS-VH; Wed, 15 Mar 2017 16:12:14 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Sean Hefty Subject: [PATCH rdma-core 5/6] rsocket: Fix byte swapping when constructing path records Date: Wed, 15 Mar 2017 16:12:06 -0600 Message-Id: <1489615927-12117-6-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489615927-12117-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1489615927-12117-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 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 These swaps were missed or in the wrong place Found by sparse. Signed-off-by: Jason Gunthorpe --- librdmacm/rsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/librdmacm/rsocket.c b/librdmacm/rsocket.c index a0bc604845c118..4fbe7aaa938610 100644 --- a/librdmacm/rsocket.c +++ b/librdmacm/rsocket.c @@ -3551,11 +3551,11 @@ static void rs_convert_sa_path(struct ibv_sa_path_rec *sa_path, path_data->path.dlid = sa_path->dlid; path_data->path.slid = sa_path->slid; fl_hop = be32toh(sa_path->flow_label) << 8; - path_data->path.flowlabel_hoplimit = htobe32(fl_hop) | sa_path->hop_limit; + path_data->path.flowlabel_hoplimit = htobe32(fl_hop | sa_path->hop_limit); path_data->path.tclass = sa_path->traffic_class; path_data->path.reversible_numpath = sa_path->reversible << 7 | 1; path_data->path.pkey = sa_path->pkey; - path_data->path.qosclass_sl = sa_path->sl; + path_data->path.qosclass_sl = htobe16(sa_path->sl); path_data->path.mtu = sa_path->mtu | 2 << 6; /* exactly */ path_data->path.rate = sa_path->rate | 2 << 6; path_data->path.packetlifetime = sa_path->packet_life_time | 2 << 6;