From patchwork Tue Sep 5 14:59:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9939181 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 1114E60350 for ; Tue, 5 Sep 2017 15:00:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1CD8289D9 for ; Tue, 5 Sep 2017 15:00:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6469289D8; Tue, 5 Sep 2017 15:00: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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 79ABD289A5 for ; Tue, 5 Sep 2017 15:00:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbdIEPAF (ORCPT ); Tue, 5 Sep 2017 11:00:05 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:56229 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbdIEPAE (ORCPT ); Tue, 5 Sep 2017 11:00:04 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0M8dKp-1dbgLY3lkB-00wEqx; Tue, 05 Sep 2017 16:59:40 +0200 From: Arnd Bergmann To: Ram Amrani , Michal Kalderon , Ariel Elior , Doug Ledford , Sean Hefty , Hal Rosenstock Cc: Arnd Bergmann , "David S. Miller" , "Mintz, Yuval" , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] RDMA/qedr: fix build error without ipv6 Date: Tue, 5 Sep 2017 16:59:20 +0200 Message-Id: <20170905145935.1578698-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:AiKro75VoeZkZzS0OZaGxTH1NWv6DphF5rDBd0XvZrpe7fjwjoI NqMDQ0hOGGJKovIhrM4NXEpG43fUVFobx8hXGm7CO0++IYniqgJsuAoB5Bme3CH9jYodqZC qFJvE3Y9nnNT+1NNxxuEHaacXpTpoDnYN0IkgGg08Gip42Yz9NaGG9PrTGDRSRxSX6YX4d9 QRKFqUtJrloTofVqUmmxQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:xeu6cQfjTU0=:Yon4JeA4S3mVFczDaZjT0y Ag0uSrYqusbXjmQ0W2q+eQQU0sgCQHKRkuqrJRuvNtDBYgRF+w0svJii9yntfkHJsv5izVq0T 9axKeLyUS0NVCyIBkG7c4JDphatjxI8YGhnaUYZWACGEpHJNxho3i5I+qULY3GNRyHspQaeUf iEIFvaUXNhAF2GlzRmEscEktV9LCYlOdq0rBFmXI6HbBNglVLgg9TiMh6lmfZoP6iDi01jDdf yt8X3BpDzGIShOBHyLm2Yp/iN/DM1VHcRqPEzpK+9vSsq4DctEWPTh4kAWoHMqu2d/7W8hYbl GNNoKRnbG7i58HjvXGCzve3ix8wO4IvlWR+6nzLQ9QGMXXIYSYJ1D4z1wowea1lJEstqrtvCi JO9+H9l2JLqubwIxhks6KmUlsVUQttzB2FjOxjpJFy17hUiUA7gWwbYx8OghTiAnPiSdv2Lqw qM/SoC2ymrTpUHUEA9KHS/ZaW9o0Ncp2TROMNnhTCR76uCtD03y9dlMgb9P2WWLJfpla/nhIZ QxlzYodnFl9lu748dSfh+fsKw3DKrY5DyrVugguvJKwQpmyPVe0BgGDRQrKYuxJSiCfNFImLl +6DbUNz9h/hR4mU5hj0AtZoBNhsDWxUh0FG8G4IcHgCxEq8vRBAhcYKcEqd+cTo8kiUdKiXBN DFXa02Suw9gQ/yNmiJbQKsIn4CY9EeuN3Sy4FBoLP4K/F4eGHmjjtBFUfRnwGueJzbLAIW7gE RkN7tQNPbOTj+DvrFU4WZM7ogD6E1xCzmab5yQ== 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 When CONFIG_IPV6 disabled, we run into a link error: drivers/infiniband/hw/qedr/qedr_iw_cm.o: In function `qedr_addr6_resolve.isra.3': qedr_iw_cm.c:(.text+0x4e0): undefined reference to `ip6_route_output_flags' The ipv6 handling code is obviously not needed here, so this adds a compile-time check for the Kconfig symbol in all three places in the code that decide between ipv4 and ipv6. We don't have to worry about a link error wtih QEDR=y/IPV6=m, as that configuration is already prohibited by CONFIG_INFINIBAND depending on "m || IPV6 != m". Fixes: e411e0587e0d ("RDMA/qedr: Add iWARP connection management functions") Signed-off-by: Arnd Bergmann Acked-by: Michal Kalderon --- drivers/infiniband/hw/qedr/qedr_iw_cm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c index fe9b2b6149b0..2950d3f6ecb8 100644 --- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c +++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c @@ -98,7 +98,8 @@ qedr_iw_mpa_request(void *context, struct qed_iwarp_cm_event_params *params) event.event = IW_CM_EVENT_CONNECT_REQUEST; event.status = params->status; - if (params->cm_info->ip_version == QED_TCP_IPV4) + if (!IS_ENABLED(CONFIG_IPV6) || + params->cm_info->ip_version == QED_TCP_IPV4) qedr_fill_sockaddr4(params->cm_info, &event); else qedr_fill_sockaddr6(params->cm_info, &event); @@ -522,7 +523,8 @@ int qedr_iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) memset(cm_info->local_ip, 0, sizeof(cm_info->local_ip)); memset(cm_info->remote_ip, 0, sizeof(cm_info->remote_ip)); - if (cm_id->remote_addr.ss_family == AF_INET) { + if (!IS_ENABLED(CONFIG_IPV6) || + cm_id->remote_addr.ss_family == AF_INET) { cm_info->ip_version = QED_TCP_IPV4; cm_info->remote_ip[0] = ntohl(raddr->sin_addr.s_addr); @@ -616,7 +618,8 @@ int qedr_iw_create_listen(struct iw_cm_id *cm_id, int backlog) iparams.event_cb = qedr_iw_event_handler; iparams.max_backlog = backlog; - if (cm_id->local_addr.ss_family == AF_INET) { + if (!IS_ENABLED(CONFIG_IPV6) || + cm_id->local_addr.ss_family == AF_INET) { iparams.ip_version = QED_TCP_IPV4; memset(iparams.ip_addr, 0, sizeof(iparams.ip_addr));