]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rds: port the code to uek2
authorDotan Barak <dotanb@dev.mellanox.co.il>
Tue, 3 Jul 2012 10:13:22 +0000 (13:13 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 20:12:31 +0000 (13:12 -0700)
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
15 files changed:
net/rds/af_rds.c
net/rds/cong.c
net/rds/connection.c
net/rds/ib.c
net/rds/ib_cm.c
net/rds/ib_send.c
net/rds/ib_sysctl.c
net/rds/iw_sysctl.c
net/rds/rdma_transport.c
net/rds/rds.h
net/rds/recv.c
net/rds/send.c
net/rds/sysctl.c
net/rds/tcp_listen.c
net/rds/threads.c

index 6909969bbcd48587c30d2394097dbfcd53009352..ddbf568da6d4a6738e272904f9b4b90319f871d4 100644 (file)
@@ -39,7 +39,7 @@
 #include <net/sock.h>
 
 #include "rds.h"
-
+#include "tcp.h"
 /* UNUSED for backwards compat only */
 static unsigned int rds_ib_retry_count = 0xdead;
 module_param(rds_ib_retry_count, int, 0444);
@@ -166,7 +166,7 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
        unsigned int mask = 0;
        unsigned long flags;
 
-       poll_wait(file, sk->sk_sleep, wait);
+       poll_wait(file, sk_sleep(sk), wait);
 
        if (rs->rs_seen_congestion)
                poll_wait(file, &rds_poll_waitq, wait);
@@ -489,7 +489,7 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
        return 0;
 }
 
-static int rds_create(struct net *net, struct socket *sock, int protocol)
+static int rds_create(struct net *net, struct socket *sock, int protocol, int kern)
 {
        struct sock *sk;
 
index 34607ac4da53001bb4f0c8cab1f36e6622b5e996..0d5456c44a9bd2fc50525046f7661857b055bd7e 100644 (file)
@@ -284,7 +284,7 @@ void rds_cong_set_bit(struct rds_cong_map *map, __be16 port)
        i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
        off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
 
-       generic___set_le_bit(off, (void *)map->m_page_addrs[i]);
+       __set_bit_le(off, (void *)map->m_page_addrs[i]);
 }
 
 void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
@@ -298,7 +298,7 @@ void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
        i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
        off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
 
-       generic___clear_le_bit(off, (void *)map->m_page_addrs[i]);
+       __set_bit_le(off, (void *)map->m_page_addrs[i]);
 }
 
 static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
@@ -309,7 +309,7 @@ static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
        i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
        off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
 
-       return generic_test_le_bit(off, (void *)map->m_page_addrs[i]);
+       return test_bit_le(off, (void *)map->m_page_addrs[i]);
 }
 
 void rds_cong_add_socket(struct rds_sock *rs)
index a97080e17444354a65c1b9755a1f55802f3c8eaa..d5d2deb9218041706a7405cad073f74b578799c1 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "rds.h"
 #include "loop.h"
+#include "tcp.h"
 
 #define RDS_CONNECTION_HASH_BITS 12
 #define RDS_CONNECTION_HASH_ENTRIES (1 << RDS_CONNECTION_HASH_BITS)
index 72a1ad75ec128b53cb00c76fd8eda3f9c4aebc14..8af05de21c18f7ac2a1f21c5027e810af9a96094 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "rds.h"
 #include "ib.h"
+#include "tcp.h"
 #include <linux/time.h>
 
 unsigned int rds_ib_fmr_1m_pool_size = RDS_FMR_1M_POOL_SIZE;
index 69773f894ce8af909365fcaed2534a43bdc60143..bdc64c48b8410fcd3bc936cf1f9e76c5de763657 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "rds.h"
 #include "ib.h"
+#include "tcp.h"
 
 static char *rds_ib_event_type_strings[] = {
 #define RDS_IB_EVENT_STRING(foo)[IB_EVENT_##foo] = __stringify(foo)
index a1a5688091066bafc6a42e6a0eae238f7f27db81..52e497cad5f977b6b7c8d8bb28a117077f30066e 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "rds.h"
 #include "ib.h"
-
+#include "tcp.h"
 /*
  * Convert IB-specific error message to RDS error message and call core
  * completion handler.
index 36f4b62369d0dfadff713b3b9a1f1a3224bd3884..2cb2aa1439b8a91d11c9b4da3dbdf23d4db4af99 100644 (file)
@@ -64,7 +64,6 @@ unsigned int rds_ib_sysctl_flow_control = 0;
 
 ctl_table rds_ib_sysctl_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_send_wr",
                .data           = &rds_ib_sysctl_max_send_wr,
                .maxlen         = sizeof(unsigned long),
@@ -74,7 +73,6 @@ ctl_table rds_ib_sysctl_table[] = {
                .extra2         = &rds_ib_sysctl_max_wr_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_recv_wr",
                .data           = &rds_ib_sysctl_max_recv_wr,
                .maxlen         = sizeof(unsigned long),
@@ -84,7 +82,6 @@ ctl_table rds_ib_sysctl_table[] = {
                .extra2         = &rds_ib_sysctl_max_wr_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_unsignaled_wr",
                .data           = &rds_ib_sysctl_max_unsig_wrs,
                .maxlen         = sizeof(unsigned long),
@@ -94,7 +91,6 @@ ctl_table rds_ib_sysctl_table[] = {
                .extra2         = &rds_ib_sysctl_max_unsig_wr_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_recv_allocation",
                .data           = &rds_ib_sysctl_max_recv_allocation,
                .maxlen         = sizeof(unsigned long),
@@ -102,20 +98,19 @@ ctl_table rds_ib_sysctl_table[] = {
                .proc_handler   = &proc_doulongvec_minmax,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "flow_control",
                .data           = &rds_ib_sysctl_flow_control,
                .maxlen         = sizeof(rds_ib_sysctl_flow_control),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-       { .ctl_name = 0}
+       { }
 };
 
 static struct ctl_path rds_ib_sysctl_path[] = {
-       { .procname = "net", .ctl_name = CTL_NET, },
-       { .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
-       { .procname = "ib", .ctl_name = CTL_UNNUMBERED, },
+       { .procname = "net", },
+       { .procname = "rds", },
+       { .procname = "ib",  },
        { }
 };
 
index 04f583a05f1d687598e681cab9fcc4e1a9a12a73..c5ed1c37a7bb1b55254742e93745db987d574eea 100644 (file)
@@ -57,7 +57,6 @@ unsigned int rds_iw_sysctl_flow_control = 1;
 
 ctl_table rds_iw_sysctl_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_send_wr",
                .data           = &rds_iw_sysctl_max_send_wr,
                .maxlen         = sizeof(unsigned long),
@@ -67,7 +66,6 @@ ctl_table rds_iw_sysctl_table[] = {
                .extra2         = &rds_iw_sysctl_max_wr_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_recv_wr",
                .data           = &rds_iw_sysctl_max_recv_wr,
                .maxlen         = sizeof(unsigned long),
@@ -77,7 +75,6 @@ ctl_table rds_iw_sysctl_table[] = {
                .extra2         = &rds_iw_sysctl_max_wr_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_unsignaled_wr",
                .data           = &rds_iw_sysctl_max_unsig_wrs,
                .maxlen         = sizeof(unsigned long),
@@ -87,7 +84,6 @@ ctl_table rds_iw_sysctl_table[] = {
                .extra2         = &rds_iw_sysctl_max_unsig_wr_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_unsignaled_bytes",
                .data           = &rds_iw_sysctl_max_unsig_bytes,
                .maxlen         = sizeof(unsigned long),
@@ -97,7 +93,6 @@ ctl_table rds_iw_sysctl_table[] = {
                .extra2         = &rds_iw_sysctl_max_unsig_bytes_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_recv_allocation",
                .data           = &rds_iw_sysctl_max_recv_allocation,
                .maxlen         = sizeof(unsigned long),
@@ -105,20 +100,19 @@ ctl_table rds_iw_sysctl_table[] = {
                .proc_handler   = &proc_doulongvec_minmax,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "flow_control",
                .data           = &rds_iw_sysctl_flow_control,
                .maxlen         = sizeof(rds_iw_sysctl_flow_control),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-       { .ctl_name = 0}
+       { }
 };
 
 static struct ctl_path rds_iw_sysctl_path[] = {
-       { .procname = "net", .ctl_name = CTL_NET, },
-       { .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
-       { .procname = "iw", .ctl_name = CTL_UNNUMBERED, },
+       { .procname = "net", },
+       { .procname = "rds", },
+       { .procname = "iw",  },
        { }
 };
 
index 8808f35756e98460d7af82bf9a54bee25678df29..b070a9cab195fb0eb05bbfc7431729dc888fd8b7 100644 (file)
@@ -35,6 +35,8 @@
 #include "rdma_transport.h"
 #include "ib.h"
 #include "net/arp.h"
+#include "tcp.h"
+
 #include <net/sock.h>
 #include <net/inet_common.h>
 
index 51834ff83af87a0b31c687686f6f02df73abecc1..b3ec12a769a49cd86f269f3aa226154b5e6fe949 100644 (file)
@@ -606,7 +606,7 @@ void rds_sock_put(struct rds_sock *rs);
 void rds_wake_sk_sleep(struct rds_sock *rs);
 static inline void __rds_wake_sk_sleep(struct sock *sk)
 {
-       wait_queue_head_t *waitq = sk->sk_sleep;
+       wait_queue_head_t *waitq = sk_sleep(sk);
 
        if (!sock_flag(sk, SOCK_DEAD) && waitq)
                wake_up(waitq);
index 90d9f75fc0f2f11cde38ecd30b710a5270ac5d9c..e4e7cdd466f722ed5204cf0c371b8fa1bf196c3c 100644 (file)
@@ -443,7 +443,7 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
                                break;
                        }
 
-                       timeo = wait_event_interruptible_timeout(*sk->sk_sleep,
+                       timeo = wait_event_interruptible_timeout(*sk_sleep(sk),
                                                (!list_empty(&rs->rs_notify_queue)
                                                || rs->rs_cong_notify
                                                || rds_next_incoming(rs, &inc)),
index 9334b0a935278035d8e93d25351f2487087999a1..156b686574c0d8485aca85980ce597cc6484e8dd 100644 (file)
@@ -1267,7 +1267,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
                        goto out;
                }
 
-               timeo = wait_event_interruptible_timeout(*sk->sk_sleep,
+               timeo = wait_event_interruptible_timeout(*sk_sleep(sk),
                                        rds_send_queue_rm(rs, conn, rm,
                                                          rs->rs_bound_port,
                                                          dport,
index 8607f88a8483720e0686615827681b7cba79fc72..0505bda27a45dc2633d895df3b5b60d3bda352bb 100644 (file)
@@ -58,7 +58,6 @@ static int rds_sysctl_sol_rds = SOL_RDS;
 
 static ctl_table rds_sysctl_rds_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "reconnect_min_delay_ms",
                .data           = &rds_sysctl_reconnect_min_jiffies,
                .maxlen         = sizeof(unsigned long),
@@ -68,7 +67,6 @@ static ctl_table rds_sysctl_rds_table[] = {
                .extra2         = &rds_sysctl_reconnect_max_jiffies,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "reconnect_max_delay_ms",
                .data           = &rds_sysctl_reconnect_max_jiffies,
                .maxlen         = sizeof(unsigned long),
@@ -78,7 +76,6 @@ static ctl_table rds_sysctl_rds_table[] = {
                .extra2         = &rds_sysctl_reconnect_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "pf_rds",
                .data           = &rds_sysctl_pf_rds,
                .maxlen         = sizeof(int),
@@ -86,7 +83,6 @@ static ctl_table rds_sysctl_rds_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sol_rds",
                .data           = &rds_sysctl_sol_rds,
                .maxlen         = sizeof(int),
@@ -94,7 +90,6 @@ static ctl_table rds_sysctl_rds_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_unacked_packets",
                .data           = &rds_sysctl_max_unacked_packets,
                .maxlen         = sizeof(unsigned long),
@@ -102,7 +97,6 @@ static ctl_table rds_sysctl_rds_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max_unacked_bytes",
                .data           = &rds_sysctl_max_unacked_bytes,
                .maxlen         = sizeof(unsigned long),
@@ -110,19 +104,18 @@ static ctl_table rds_sysctl_rds_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "ping_enable",
                .data           = &rds_sysctl_ping_enable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-       { .ctl_name = 0}
+       { }
 };
 
 static struct ctl_path rds_sysctl_path[] = {
-       { .procname = "net", .ctl_name = CTL_NET, },
-       { .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
+       { .procname = "net", },
+       { .procname = "rds", },
        { }
 };
 
index 9a2ae298581a0886ce55b29060b47f7e0a34af43..b61efbd1bf75809e391f2d800714fb5122037a93 100644 (file)
@@ -67,10 +67,10 @@ static int rds_tcp_accept_one(struct socket *sock)
        inet = inet_sk(new_sock->sk);
 
        rdsdebug("accepted tcp %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n",
-                 NIPQUAD(inet->saddr), ntohs(inet->sport),
-                 NIPQUAD(inet->daddr), ntohs(inet->dport));
+                 NIPQUAD(inet->inet_saddr), ntohs(inet->inet_sport),
+                 NIPQUAD(inet->inet_daddr), ntohs(inet->inet_dport));
 
-       conn = rds_conn_create(inet->saddr, inet->daddr, &rds_tcp_transport,
+       conn = rds_conn_create(inet->inet_saddr, inet->inet_daddr, &rds_tcp_transport,
                               0, GFP_KERNEL);
        if (IS_ERR(conn)) {
                ret = PTR_ERR(conn);
index e32a34099f2601632f64305dd86e4be372ca4c0b..975364addcdc0e06635fe076ffd73c9db3a30d59 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/random.h>
 
 #include "rds.h"
-
+#include "tcp.h"
 static unsigned int rds_conn_hb_timeout = 0;
 module_param(rds_conn_hb_timeout, int, 0444);
 MODULE_PARM_DESC(rds_conn_hb_timeout, " Connection heartbeat timeout");