Skip to content

Commit bd491d2

Browse files
arndbdledford
authored andcommitted
RDMA/qedr: fix build error without ipv6
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: e411e05 ("RDMA/qedr: Add iWARP connection management functions") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Michal Kalderon <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 89fd257 commit bd491d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/infiniband/hw/qedr/qedr_iw_cm.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ qedr_iw_mpa_request(void *context, struct qed_iwarp_cm_event_params *params)
9898
event.event = IW_CM_EVENT_CONNECT_REQUEST;
9999
event.status = params->status;
100100

101-
if (params->cm_info->ip_version == QED_TCP_IPV4)
101+
if (!IS_ENABLED(CONFIG_IPV6) ||
102+
params->cm_info->ip_version == QED_TCP_IPV4)
102103
qedr_fill_sockaddr4(params->cm_info, &event);
103104
else
104105
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)
522523
memset(cm_info->local_ip, 0, sizeof(cm_info->local_ip));
523524
memset(cm_info->remote_ip, 0, sizeof(cm_info->remote_ip));
524525

525-
if (cm_id->remote_addr.ss_family == AF_INET) {
526+
if (!IS_ENABLED(CONFIG_IPV6) ||
527+
cm_id->remote_addr.ss_family == AF_INET) {
526528
cm_info->ip_version = QED_TCP_IPV4;
527529

528530
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)
616618
iparams.event_cb = qedr_iw_event_handler;
617619
iparams.max_backlog = backlog;
618620

619-
if (cm_id->local_addr.ss_family == AF_INET) {
621+
if (!IS_ENABLED(CONFIG_IPV6) ||
622+
cm_id->local_addr.ss_family == AF_INET) {
620623
iparams.ip_version = QED_TCP_IPV4;
621624
memset(iparams.ip_addr, 0, sizeof(iparams.ip_addr));
622625

0 commit comments

Comments
 (0)