diff options
author | Ka-Cheong Poon <ka-cheong.poon@oracle.com> | 2018-07-31 01:48:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-01 12:32:35 -0400 |
commit | e65d4d96334e3ff4fe0064612a93a51c63de08de (patch) | |
tree | 3bbc43d81b1e59665ceae7f412c70be52c29d89c /net/rds/ib_cm.c | |
parent | f394ad28feffbeebab77c8bf9a203bd49b957c9a (diff) |
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/ib_cm.c')
-rw-r--r-- | net/rds/ib_cm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 0d654d99fe41..bfbb31f0c7fd 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
@@ -678,6 +678,7 @@ static u32 rds_ib_protocol_compatible(struct rdma_cm_event *event, bool isv6) | |||
678 | return version; | 678 | return version; |
679 | } | 679 | } |
680 | 680 | ||
681 | #if IS_ENABLED(CONFIG_IPV6) | ||
681 | /* Given an IPv6 address, find the net_device which hosts that address and | 682 | /* Given an IPv6 address, find the net_device which hosts that address and |
682 | * return its index. This is used by the rds_ib_cm_handle_connect() code to | 683 | * return its index. This is used by the rds_ib_cm_handle_connect() code to |
683 | * find the interface index of where an incoming request comes from when | 684 | * find the interface index of where an incoming request comes from when |
@@ -704,6 +705,7 @@ static u32 __rds_find_ifindex(struct net *net, const struct in6_addr *addr) | |||
704 | 705 | ||
705 | return idx; | 706 | return idx; |
706 | } | 707 | } |
708 | #endif | ||
707 | 709 | ||
708 | int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, | 710 | int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, |
709 | struct rdma_cm_event *event, bool isv6) | 711 | struct rdma_cm_event *event, bool isv6) |
@@ -732,6 +734,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, | |||
732 | 734 | ||
733 | dp = event->param.conn.private_data; | 735 | dp = event->param.conn.private_data; |
734 | if (isv6) { | 736 | if (isv6) { |
737 | #if IS_ENABLED(CONFIG_IPV6) | ||
735 | dp_cmn = &dp->ricp_v6.dp_cmn; | 738 | dp_cmn = &dp->ricp_v6.dp_cmn; |
736 | saddr6 = &dp->ricp_v6.dp_saddr; | 739 | saddr6 = &dp->ricp_v6.dp_saddr; |
737 | daddr6 = &dp->ricp_v6.dp_daddr; | 740 | daddr6 = &dp->ricp_v6.dp_daddr; |
@@ -756,6 +759,10 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, | |||
756 | goto out; | 759 | goto out; |
757 | } | 760 | } |
758 | } | 761 | } |
762 | #else | ||
763 | err = -EOPNOTSUPP; | ||
764 | goto out; | ||
765 | #endif | ||
759 | } else { | 766 | } else { |
760 | dp_cmn = &dp->ricp_v4.dp_cmn; | 767 | dp_cmn = &dp->ricp_v4.dp_cmn; |
761 | ipv6_addr_set_v4mapped(dp->ricp_v4.dp_saddr, &s_mapped_addr); | 768 | ipv6_addr_set_v4mapped(dp->ricp_v4.dp_saddr, &s_mapped_addr); |
@@ -893,9 +900,11 @@ int rds_ib_conn_path_connect(struct rds_conn_path *cp) | |||
893 | 900 | ||
894 | /* XXX I wonder what affect the port space has */ | 901 | /* XXX I wonder what affect the port space has */ |
895 | /* delegate cm event handler to rdma_transport */ | 902 | /* delegate cm event handler to rdma_transport */ |
903 | #if IS_ENABLED(CONFIG_IPV6) | ||
896 | if (conn->c_isv6) | 904 | if (conn->c_isv6) |
897 | handler = rds6_rdma_cm_event_handler; | 905 | handler = rds6_rdma_cm_event_handler; |
898 | else | 906 | else |
907 | #endif | ||
899 | handler = rds_rdma_cm_event_handler; | 908 | handler = rds_rdma_cm_event_handler; |
900 | ic->i_cm_id = rdma_create_id(&init_net, handler, conn, | 909 | ic->i_cm_id = rdma_create_id(&init_net, handler, conn, |
901 | RDMA_PS_TCP, IB_QPT_RC); | 910 | RDMA_PS_TCP, IB_QPT_RC); |