From patchwork Mon Jun 13 12:54:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102243 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1528960qgf; Mon, 13 Jun 2016 05:54:09 -0700 (PDT) X-Received: by 10.98.102.133 with SMTP id s5mr11841267pfj.75.1465822449776; Mon, 13 Jun 2016 05:54:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zk7si17785519pac.15.2016.06.13.05.54.09; Mon, 13 Jun 2016 05:54:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423317AbcFMMyH (ORCPT + 30 others); Mon, 13 Jun 2016 08:54:07 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:55263 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422747AbcFMMyE (ORCPT ); Mon, 13 Jun 2016 08:54:04 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LfikE-1bn7uP0gnq-00pPAj; Mon, 13 Jun 2016 14:53:43 +0200 From: Arnd Bergmann To: Leon Romanovsky Cc: netdev@vger.kernel.org, Arnd Bergmann , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , Amir Vadai , Kamal Heib , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] infiniband: rxe: avoid 64-bit division Date: Mon, 13 Jun 2016 14:54:53 +0200 Message-Id: <1465822509-4167617-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:optUkLshVitxiRsULd9cIn50UQI58FFYcsbon66mr1xrkeOLz0W 3Rd9n/pLy5VBVZcNLYSY26m5XbKrkB3pxRjWRV0HxlAbXpJ91m6s7ug+/hRTJdflMAMCRGU DNlPHnovdDiRM3bLxc9TFsv8n3yKNtOup21FBM9RbhFW0M21E/u3kEGkexwRGrXfPinYptO T/M24t52MULt45YfPipEw== X-UI-Out-Filterresults: notjunk:1; V01:K0:KcJmInCCJ0U=:RegmuPsHAFHdhM/Tj+FzJo 5v3cx6q7OII7UvGH14yjOVOaeoehUblANi5y7CfRUcLnshOVaIWzxS32M+AT3IJ6csYzJXpJc evbCgo2uJ+25W71FSH90qHprJ1U8MeTtgQLiq4vkHydD+sW9G7wAWinIlGo8IkQn648emacnr xUbudZz5aXh7TLJ7OUBU5TufPeOjTGoQaiWMeWVyLXgNgfBbvu6J8DXKNbkZhj7qVM+vPOy+a qEdgeYMZ4c/PcsFfDgOARh7CnA9m3ERhgw5zvX2V+UJfj3pkp3oiqTgqVO/+QEnKGtIXSQY2O M+qOiU14VxeA1cuYOBATS8IARPjya1UTHGMKQKNJTcYVN1O5nENt6LYe29h3Ey+RZeHxyU15o 4jfexkMBz2gZAl9MWqhJ33YYUY1XUBbcTz7NVmX5iMTswUnMsYS7n1PJzYluZYeyRjLF1WTxV l1hDKCNUWlo1+ZHCnbuzCLxWUeRe27IgsjcaPshX/G+kiDEuFVGQuGtKulCIC7qPcBa1nEtPp 0Isua5/QDdXsuTdwowKiTbi7PlVe3K+pgFUBBIxiWY4tFTs1138qUbh2mSvArIgaomZWh1DVc ga8kKt3nkRm3mrwMKy4TcHu4dehKntdrsMpeiH5c8XanJT6LAnj2pdsaEZZQWmo/F6pv2bY3R Yz2UcpC1mMCiRicYVOY+1plZrFjvOdmWLEeM5EVrHhFym7uNQq/PI60AUt8wnoKvJfdk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rxe driver fails to build on 32-bit because of a 64-bit division: In function `rxe_qp_from_attr': :(.text+0x53158): undefined reference to `__aeabi_uldivmod' We can easily avoid this division by converting the nanosecond value into jiffies directly rather than converting to microseconds first. Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/rxe/rxe_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/infiniband/hw/rxe/rxe_qp.c b/drivers/infiniband/hw/rxe/rxe_qp.c index aa11ac3032b2..4e7b0985aab8 100644 --- a/drivers/infiniband/hw/rxe/rxe_qp.c +++ b/drivers/infiniband/hw/rxe/rxe_qp.c @@ -664,7 +664,7 @@ int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask, qp->qp_timeout_jiffies = 0; } else { /* According to the spec, timeout = 4.096 * 2 ^ attr->timeout [us] */ - int j = usecs_to_jiffies((4096ULL << attr->timeout) / 1000); + int j = nsecs_to_jiffies(4096ULL << attr->timeout); qp->qp_timeout_jiffies = j ? j : 1; } From patchwork Mon Jun 13 12:54:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102242 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1529088qgf; Mon, 13 Jun 2016 05:54:26 -0700 (PDT) X-Received: by 10.66.142.199 with SMTP id ry7mr21822187pab.14.1465822466399; Mon, 13 Jun 2016 05:54:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nw12si17784438pab.179.2016.06.13.05.54.26; Mon, 13 Jun 2016 05:54:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423341AbcFMMyV (ORCPT + 30 others); Mon, 13 Jun 2016 08:54:21 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:51672 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422747AbcFMMyS (ORCPT ); Mon, 13 Jun 2016 08:54:18 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0Lr2TD-1bgqW52THH-00eeaq; Mon, 13 Jun 2016 14:53:58 +0200 From: Arnd Bergmann To: Leon Romanovsky Cc: netdev@vger.kernel.org, Arnd Bergmann , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , Amir Vadai , Haggai Eran , Kamal Heib , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] infiniband: rxe: add UDP_TUNNEL dependency Date: Mon, 13 Jun 2016 14:54:54 +0200 Message-Id: <1465822509-4167617-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1465822509-4167617-1-git-send-email-arnd@arndb.de> References: <1465822509-4167617-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:E4wN+QHtbBZvf0l2CoiqKvrYWWf7ff7XfSwSdtTICksj0WVP6x/ 5ruc7RsRu67Xvm0EjIQ8zhWXAQv/irWqigqwkrJKIY0hoa1b9kR+ibInefM2uc9b2R4FCvQ X0iXzagnOzWG1xUvKae8RAcb5J9S/P0pGs8Og+cZrcuqO4vVO5qekNUk/FsUWmNEnc/duiC 2q73YZrXACsnGIQmBex0w== X-UI-Out-Filterresults: notjunk:1; V01:K0:YKO4AT9zyGA=:nTykpgOSlabR3TNqEGrRrG oERJG1e0QAuLnm3+3KnvGx0ttWbDP0VZ1RTgyOfbPvSWeFN20Um1pAf6awJLsycbonnE/taTP YjiHbLhyz99OwfLYHiel2suffXP6Ez8pWoVHT9pLwTe8Exbnu24UTbRqPNwAeZCm4mKv+Llpz sxtPjfRkz7bIaNy3fwC1M2KIyBS/xUuKyTad7FuzQrZpKXOkdiCO0GiL1hoybqJtqujN2KsFH E2uEm3vKQh4a2clOjVVKPDTm4SWqgZ5QfkjyagP+xlys/0+26zYIHeGark9r/f9dv88Q/87FU l4M/HLRbCLz4AuvsXrkSbvH4JaesTBueZbCTOCGtn/UjKDL7g3XW1LnIQ/4Tsi2Byd6xSOEeY CVuiHOJd9UmCaSJv3+tfyfwBeCFYC8ECeFRBjC+ou22CN06Xim6Ie/y3Xt19P+ikDR6yb8ADN ZyA6gO1xyYbTegbwvpSG0dLSOz16yUZmp2O2Oq3G0S4aRC6gLZ1ikQUMdZsFXTVTz11t6Ol5s 1Ydnr4cbt+lNlsvPDg+m0FaBzlzTujZSIwZH+pEB/2hihNrk4E/YJkv/vT16xE85IwdeJGLj5 gebyYa84UmcvJu+c5+/bUIfwIglmnb8jxIJOgPvzjSAH+N8xfRaHFenu8MhJdGDGljkJW4Nym 07ghM9nSM/S8w3p0t+uKs2cHPChDVwneHqT9YJCagPi70WQLkK2xcoQoTalLZAm3TZHc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The newly added rxe driver links against the UDP tunneling code, which causes build errors when CONFIG_UDP_TUNNEL is disabled: ERROR: "setup_udp_tunnel_sock" [drivers/infiniband/hw/rxe/ib_rxe.ko] undefined! ERROR: "udp_tunnel_sock_release" [drivers/infiniband/hw/rxe/ib_rxe.ko] undefined! ERROR: "udp_sock_create4" [drivers/infiniband/hw/rxe/ib_rxe.ko] undefined! This adds a Kconfig dependency to prevent the invalid configuration. Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/rxe/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.7.0 diff --git a/drivers/infiniband/hw/rxe/Kconfig b/drivers/infiniband/hw/rxe/Kconfig index 649b7be11eb8..a199d0df31d0 100644 --- a/drivers/infiniband/hw/rxe/Kconfig +++ b/drivers/infiniband/hw/rxe/Kconfig @@ -1,6 +1,7 @@ config INFINIBAND_RXE tristate "Software RDMA over Ethernet (RoCE) driver" depends on INET && PCI && INFINIBAND + depends on NET_UDP_TUNNEL ---help--- This driver implements the InfiniBand RDMA transport over the Linux network stack. It enables a system with a From patchwork Mon Jun 13 12:54:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102241 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1529228qgf; Mon, 13 Jun 2016 05:54:47 -0700 (PDT) X-Received: by 10.66.216.202 with SMTP id os10mr21385454pac.91.1465822487073; Mon, 13 Jun 2016 05:54:47 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r88si24789285pfa.128.2016.06.13.05.54.46; Mon, 13 Jun 2016 05:54:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423364AbcFMMyf (ORCPT + 30 others); Mon, 13 Jun 2016 08:54:35 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:65161 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422747AbcFMMyd (ORCPT ); Mon, 13 Jun 2016 08:54:33 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LpOJJ-1bgI0v08Un-00fD5e; Mon, 13 Jun 2016 14:54:12 +0200 From: Arnd Bergmann To: Leon Romanovsky Cc: netdev@vger.kernel.org, Arnd Bergmann , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , Kamal Heib , Haggai Eran , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] infiniband: rxe: fix 32-bit build warnings Date: Mon, 13 Jun 2016 14:54:55 +0200 Message-Id: <1465822509-4167617-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1465822509-4167617-1-git-send-email-arnd@arndb.de> References: <1465822509-4167617-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:QnL3N889V5gbTxA+L5Ee1wxU6wfT4HovPb20oaJXAFiLpGEwmaA ZSRNpIIj/SO55ElD6jRqvUCN53sKZC0jrMUaH48r8QO0LHVvRfV70G13khwWvOmpEPvjL/q o7R7tRiK5UC+abdgI/FtXLS+XBTm/imYdNquJhT/x+Fup6I7JdnSybV3OJ+XA0Rp+P3D3C+ vYIWSYFvJz80Oazb/FkSA== X-UI-Out-Filterresults: notjunk:1; V01:K0:khzmv7se7WQ=:7VGoqF8H4Xeo+wZxumU3nv aaoknCxLhvGzi/nrNF1dtgL63rmnODLaIlcTL8STx6N5gh6DZfNOiC0JcVN52NnLgrdRgaCGp 4ePqt5ziLtE1qx758Q8ekOkfJMtWbN2zMGjpDtRXIwLHbBuT/z+USZP1t7HMPA+DXz+VSmvfs UgEKZhgTzW0esfyWHa6WzG+GEkotuHEaMX2+XbOGq6kD14xbc5RTLerb2J4ULO1pSjkb2Rn9a kDjL5cSEulqEYWKnd5a+T9O9HIv3TESowILianqXBC3fHiry3Wl44mXMxnXyxoeoh7zLD0QmJ KFk4M5MhFVlvnWqkxg0xnl7kH/SPoQMK5HEB+4ApUAQUhd21h5K0BiVzlNKB+llbMpjoCaGg8 PGjVL5Cect+Rsz5RnRYUzB9wN7SUVeotHJtyxoNfh/Yc8mdhVRtGkPNVRiRu9JmdN5gkRtQ0U b4eu3aI6QQbjkbwUFvTpFksDWILAJW9Z6Vdi91yw5YeaAuM7s/C3jOsw+/exXqF/fJgyF4cxg UQ7a9D4j2TuEqD6EV3oxGBX/jgHzIzOG0Q0LxgSvRcEe14OzhRcrPUTwCBpjzncm4My0hk3wo 6iBjE+4/M2TS9XbSH1qTMuzRVolCyNEWKWPfjtNQ9uGc/Y5f1RSG+3Up2wSPmnGwzuinvpBUy Rme4sbdkiKZPDRI7+WXSQJIwpAtn+VGewZdMewKU86JScNZMsEkxWJOmVz5iv5/pLU0Y= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new rxe infinband driver passes around pointers that have been converted to 64-bit integers. This is valid, but causes compile-time warnings on all 32-bit architectures: infiniband/hw/rxe/rxe_dma.c: In function 'rxe_dma_map_single': infiniband/hw/rxe/rxe_dma.c:49:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] return (u64)cpu_addr; ^ infiniband/hw/rxe/rxe_dma.c: In function 'rxe_dma_map_page': infiniband/hw/rxe/rxe_dma.c:73:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] infiniband/hw/rxe/rxe_dma.c: In function 'rxe_map_sg': infiniband/hw/rxe/rxe_dma.c:99:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] infiniband/hw/rxe/rxe_dma.c: In function 'rxe_dma_alloc_coherent': infiniband/hw/rxe/rxe_dma.c:143:17: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] This changes the cast to use 'uintptr_t', which can always be cast to and from pointer, and can be assigned to and from 64-bit integers. Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/rxe/rxe_dma.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/drivers/infiniband/hw/rxe/rxe_dma.c b/drivers/infiniband/hw/rxe/rxe_dma.c index f080bc5bda43..7634c1a81b2b 100644 --- a/drivers/infiniband/hw/rxe/rxe_dma.c +++ b/drivers/infiniband/hw/rxe/rxe_dma.c @@ -46,7 +46,7 @@ static u64 rxe_dma_map_single(struct ib_device *dev, enum dma_data_direction direction) { WARN_ON(!valid_dma_direction(direction)); - return (u64)cpu_addr; + return (uintptr_t)cpu_addr; } static void rxe_dma_unmap_single(struct ib_device *dev, @@ -70,7 +70,7 @@ static u64 rxe_dma_map_page(struct ib_device *dev, goto done; } - addr = (u64)page_address(page); + addr = (uintptr_t)page_address(page); if (addr) addr += offset; @@ -96,7 +96,7 @@ static int rxe_map_sg(struct ib_device *dev, struct scatterlist *sgl, WARN_ON(!valid_dma_direction(direction)); for_each_sg(sgl, sg, nents, i) { - addr = (u64)page_address(sg_page(sg)); + addr = (uintptr_t)page_address(sg_page(sg)); if (!addr) { ret = 0; break; @@ -140,7 +140,7 @@ static void *rxe_dma_alloc_coherent(struct ib_device *dev, size_t size, addr = page_address(p); if (dma_handle) - *dma_handle = (u64)addr; + *dma_handle = (uintptr_t)addr; return addr; }