From patchwork Thu Jul 20 17:01:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9855381 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 F38F4600F5 for ; Thu, 20 Jul 2017 17:01:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E26B1285C4 for ; Thu, 20 Jul 2017 17:01:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D78D1286EB; Thu, 20 Jul 2017 17:01:19 +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 7AD3E285C4 for ; Thu, 20 Jul 2017 17:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965454AbdGTRBR (ORCPT ); Thu, 20 Jul 2017 13:01:17 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:57416 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965443AbdGTRBM (ORCPT ); Thu, 20 Jul 2017 13:01:12 -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:To:From; bh=esqkW/hDRpekF7nw0oAUUgYVxbyqIKdt1JOgkjodtfE=; b=ar7BjXo0EFwIdBGicABmyguM1t/Wet6J827pD+6fqz57JE5hDHyxOkYRridIDXKbrnthFvljJIW3Bp2pQmwpTSjJuS5ibc/BhPQoVWHoGGCN4oSWMXjPUeHdmaqReoDiBAgDTnn6Ac5hAZLhdo/iBiRq/8Tny7xKU7gde0zhXIM=; 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 1dYEp3-0000gv-AR; Thu, 20 Jul 2017 11:01:09 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org, Leon Romanovsky Subject: [PATCH v2 rdma-core 8/8] vmw_pvrdma: Add sparse annotations Date: Thu, 20 Jul 2017 11:01:04 -0600 Message-Id: <1500570064-11712-9-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500570064-11712-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1500570064-11712-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 Signed-off-by: Jason Gunthorpe Tested-by: Adit Ranadive Acked-by: Adit Ranadive --- CMakeLists.txt | 2 +- providers/vmw_pvrdma/pvrdma.h | 6 +++--- providers/vmw_pvrdma/verbs.c | 7 +------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2d6618ebd4601..1e9b1a363b7436 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -422,7 +422,7 @@ add_subdirectory(providers/mthca) add_subdirectory(providers/nes) # NO SPARSE add_subdirectory(providers/ocrdma) add_subdirectory(providers/qedr) -add_subdirectory(providers/vmw_pvrdma) # NO SPARSE +add_subdirectory(providers/vmw_pvrdma) endif() add_subdirectory(providers/hfi1verbs) diff --git a/providers/vmw_pvrdma/pvrdma.h b/providers/vmw_pvrdma/pvrdma.h index d4acefcedde154..7840e11ee7266c 100644 --- a/providers/vmw_pvrdma/pvrdma.h +++ b/providers/vmw_pvrdma/pvrdma.h @@ -152,7 +152,7 @@ struct pvrdma_qp { struct pvrdma_buf sbuf; int max_inline_data; int buf_size; - uint32_t sq_signal_bits; + __be32 sq_signal_bits; int sq_spare_wqes; struct pvrdma_wq sq; struct pvrdma_wq rq; @@ -210,12 +210,12 @@ static inline struct pvrdma_ah *to_vah(struct ibv_ah *ibah) static inline void pvrdma_write_uar_qp(void *uar, unsigned value) { - *(uint32_t *)(uar + PVRDMA_UAR_QP_OFFSET) = htole32(value); + *(__le32 *)(uar + PVRDMA_UAR_QP_OFFSET) = htole32(value); } static inline void pvrdma_write_uar_cq(void *uar, unsigned value) { - *(uint32_t *)(uar + PVRDMA_UAR_CQ_OFFSET) = htole32(value); + *(__le32 *)(uar + PVRDMA_UAR_CQ_OFFSET) = htole32(value); } static inline int ibv_send_flags_to_pvrdma(int flags) diff --git a/providers/vmw_pvrdma/verbs.c b/providers/vmw_pvrdma/verbs.c index 0a07748da513aa..1bb1634863a6e9 100644 --- a/providers/vmw_pvrdma/verbs.c +++ b/providers/vmw_pvrdma/verbs.c @@ -154,12 +154,7 @@ static int is_multicast_gid(const union ibv_gid *gid) static int is_link_local_gid(const union ibv_gid *gid) { - uint32_t *hi = (uint32_t *)(gid->raw); - uint32_t *lo = (uint32_t *)(gid->raw + 4); - if (hi[0] == htobe32(0xfe800000) && lo[0] == 0) - return 1; - - return 0; + return gid->global.subnet_prefix == htobe64(0xfe80000000000000ULL); } static int is_ipv6_addr_v4mapped(const struct in6_addr *a)