summaryrefslogtreecommitdiffstats
path: root/net/rds/rdma_transport.c
diff options
context:
space:
mode:
authorKa-Cheong Poon <ka-cheong.poon@oracle.com>2018-07-31 07:48:42 +0200
committerDavid S. Miller <davem@davemloft.net>2018-08-01 18:32:35 +0200
commite65d4d96334e3ff4fe0064612a93a51c63de08de (patch)
tree3bbc43d81b1e59665ceae7f412c70be52c29d89c /net/rds/rdma_transport.c
parentrds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead (diff)
downloadlinux-e65d4d96334e3ff4fe0064612a93a51c63de08de.tar.xz
linux-e65d4d96334e3ff4fe0064612a93a51c63de08de.zip
rds: Remove IPv6 dependency
This patch removes the IPv6 dependency from RDS. Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/rdma_transport.c')
-rw-r--r--net/rds/rdma_transport.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index ad78929036ef..6b0f57c83a2a 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -39,7 +39,9 @@
/* Global IPv4 and IPv6 RDS RDMA listener cm_id */
static struct rdma_cm_id *rds_rdma_listen_id;
+#if IS_ENABLED(CONFIG_IPV6)
static struct rdma_cm_id *rds6_rdma_listen_id;
+#endif
static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
struct rdma_cm_event *event,
@@ -155,11 +157,13 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
return rds_rdma_cm_event_handler_cmn(cm_id, event, false);
}
+#if IS_ENABLED(CONFIG_IPV6)
int rds6_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
struct rdma_cm_event *event)
{
return rds_rdma_cm_event_handler_cmn(cm_id, event, true);
}
+#endif
static int rds_rdma_listen_init_common(rdma_cm_event_handler handler,
struct sockaddr *sa,
@@ -214,7 +218,9 @@ out:
static int rds_rdma_listen_init(void)
{
int ret;
+#if IS_ENABLED(CONFIG_IPV6)
struct sockaddr_in6 sin6;
+#endif
struct sockaddr_in sin;
sin.sin_family = PF_INET;
@@ -226,6 +232,7 @@ static int rds_rdma_listen_init(void)
if (ret != 0)
return ret;
+#if IS_ENABLED(CONFIG_IPV6)
sin6.sin6_family = PF_INET6;
sin6.sin6_addr = in6addr_any;
sin6.sin6_port = htons(RDS_CM_PORT);
@@ -237,6 +244,7 @@ static int rds_rdma_listen_init(void)
/* Keep going even when IPv6 is not enabled in the system. */
if (ret != 0)
rdsdebug("Cannot set up IPv6 RDMA listener\n");
+#endif
return 0;
}
@@ -247,11 +255,13 @@ static void rds_rdma_listen_stop(void)
rdma_destroy_id(rds_rdma_listen_id);
rds_rdma_listen_id = NULL;
}
+#if IS_ENABLED(CONFIG_IPV6)
if (rds6_rdma_listen_id) {
rdsdebug("cm %p\n", rds6_rdma_listen_id);
rdma_destroy_id(rds6_rdma_listen_id);
rds6_rdma_listen_id = NULL;
}
+#endif
}
static int rds_rdma_init(void)