rds: tcp: remove cp_outgoing
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Thu, 15 Jun 2017 18:28:53 +0000 (11:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 16:45:14 +0000 (12:45 -0400)
After commit 1a0e100fb2c9 ("RDS: TCP: Force every connection to be
initiated by numerically smaller IP address") we no longer need
the logic associated with cp_outgoing, so clean up usage of this
field.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Tested-by: Imanti Mendez <imanti.mendez@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/connection.c
net/rds/rds.h
net/rds/tcp_connect.c
net/rds/tcp_listen.c

index 6a5ebdea7d2e9eb3b624a01a8a87ef601e3b2f13..382443b060cbff7f864f307130331a103f21d2ec 100644 (file)
@@ -124,11 +124,6 @@ static void __rds_conn_path_init(struct rds_connection *conn,
        cp->cp_conn = conn;
        atomic_set(&cp->cp_state, RDS_CONN_DOWN);
        cp->cp_send_gen = 0;
-       /* cp_outgoing is per-path. So we can only set it here
-        * for the single-path transports.
-        */
-       if (!conn->c_trans->t_mp_capable)
-               cp->cp_outgoing = (is_outgoing ? 1 : 0);
        cp->cp_reconnect_jiffies = 0;
        INIT_DELAYED_WORK(&cp->cp_send_w, rds_send_worker);
        INIT_DELAYED_WORK(&cp->cp_recv_w, rds_recv_worker);
index 82d38ccf5e8bcf99eefd20934744cbeb7410406b..aa183d6adbcc381d164d280a815d7b1b0983b2cb 100644 (file)
@@ -125,8 +125,6 @@ struct rds_conn_path {
 
        unsigned int            cp_unacked_packets;
        unsigned int            cp_unacked_bytes;
-       unsigned int            cp_outgoing:1,
-                               cp_pad_to_32:31;
        unsigned int            cp_index;
 };
 
index d6839d96d539c250159e034208c7b7e875182bed..97db86101ac5fcbd295001c6f0d7be116bdbeb56 100644 (file)
@@ -135,7 +135,6 @@ int rds_tcp_conn_path_connect(struct rds_conn_path *cp)
        ret = sock->ops->connect(sock, (struct sockaddr *)&dest, sizeof(dest),
                                 O_NONBLOCK);
 
-       cp->cp_outgoing = 1;
        rdsdebug("connect to address %pI4 returned %d\n", &conn->c_faddr, ret);
        if (ret == -EINPROGRESS)
                ret = 0;
index 507678853e6cb3bb769711d22d75f5099228faab..238ff5c9a75b92816c9f3dc25331d87834c0077f 100644 (file)
@@ -171,21 +171,10 @@ int rds_tcp_accept_one(struct socket *sock)
        if (conn_state != RDS_CONN_CONNECTING && conn_state != RDS_CONN_ERROR)
                goto rst_nsk;
        if (rs_tcp->t_sock) {
-               /* Need to resolve a duelling SYN between peers.
-                * We have an outstanding SYN to this peer, which may
-                * potentially have transitioned to the RDS_CONN_UP state,
-                * so we must quiesce any send threads before resetting
-                * c_transport_data.
-                */
-               if (ntohl(inet->inet_saddr) < ntohl(inet->inet_daddr) ||
-                   !cp->cp_outgoing) {
-                       goto rst_nsk;
-               } else {
-                       rds_tcp_reset_callbacks(new_sock, cp);
-                       cp->cp_outgoing = 0;
-                       /* rds_connect_path_complete() marks RDS_CONN_UP */
-                       rds_connect_path_complete(cp, RDS_CONN_RESETTING);
-               }
+               /* Duelling SYN has been handled in rds_tcp_accept_one() */
+               rds_tcp_reset_callbacks(new_sock, cp);
+               /* rds_connect_path_complete() marks RDS_CONN_UP */
+               rds_connect_path_complete(cp, RDS_CONN_RESETTING);
        } else {
                rds_tcp_set_callbacks(new_sock, cp);
                rds_connect_path_complete(cp, RDS_CONN_CONNECTING);