From patchwork Tue Feb 5 15:48:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 2098181 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A97EB3FDF1 for ; Tue, 5 Feb 2013 15:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755223Ab3BEPt0 (ORCPT ); Tue, 5 Feb 2013 10:49:26 -0500 Received: from eu1sys200aog115.obsmtp.com ([207.126.144.139]:48892 "HELO eu1sys200aog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754731Ab3BEPtZ (ORCPT ); Tue, 5 Feb 2013 10:49:25 -0500 Received: from mtlsws123.lab.mtl.com ([82.166.227.17]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUREp9Ye8IOLs9X+25WIuN1cU9psqBxqF@postini.com; Tue, 05 Feb 2013 15:49:25 UTC Received: from r-vnc04.mtr.labs.mlnx (r-vnc04.mtr.labs.mlnx [10.208.0.116]) by mtlsws123.lab.mtl.com (8.13.8/8.13.8) with ESMTP id r15Fn4qU030305; Tue, 5 Feb 2013 17:49:06 +0200 From: Or Gerlitz To: roland@kernel.org, sean.hefty@intel.com Cc: linux-rdma@vger.kernel.org, erezsh@mellanox.com, Shlomo Pongratz , Or Gerlitz Subject: [PATCH V2 for-next 1/6] IB/ipoib: Fix ipoib_neigh hashing to use the correct daddr octets Date: Tue, 5 Feb 2013 17:48:52 +0200 Message-Id: <1360079337-8173-2-git-send-email-ogerlitz@mellanox.com> X-Mailer: git-send-email 1.7.8.2 In-Reply-To: <1360079337-8173-1-git-send-email-ogerlitz@mellanox.com> References: <1360079337-8173-1-git-send-email-ogerlitz@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Shlomo Pongratz The hash function introduced in commit b63b70d877 "IPoIB: Use a private hash table for path lookup in xmit path" was designd to use the 3 octets of the IPoIB HW address that holds the remote QPN. However, this currently isn't the case under little endian machines as the code there uses the flags part (octet[0]) and not the last octet of the QPN (octet[3]), fix that. The fix caused a checkpatch warning on line over 80 characters, to solve that changed the name of the temp variable that holds the daddr. Signed-off-by: Shlomo Pongratz Signed-off-by: Or Gerlitz --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 6fdc9e7..e459fa7 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -844,10 +844,10 @@ static u32 ipoib_addr_hash(struct ipoib_neigh_hash *htbl, u8 *daddr) * different subnets. */ /* qpn octets[1:4) & port GUID octets[12:20) */ - u32 *daddr_32 = (u32 *) daddr; + u32 *d32 = (u32 *)daddr; u32 hv; - hv = jhash_3words(daddr_32[3], daddr_32[4], 0xFFFFFF & daddr_32[0], 0); + hv = jhash_3words(d32[3], d32[4], cpu_to_be32(0xFFFFFF) & d32[0], 0); return hv & htbl->mask; }