Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbdIEPAJ (ORCPT ); Tue, 5 Sep 2017 11:00:09 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2276 Lines: 55 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 --- 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)); -- 2.9.0