.. | .. |
---|
84 | 84 | const struct in6_addr *laddr, |
---|
85 | 85 | const struct in6_addr *faddr, |
---|
86 | 86 | struct rds_transport *trans, |
---|
87 | | - int dev_if) |
---|
| 87 | + u8 tos, int dev_if) |
---|
88 | 88 | { |
---|
89 | 89 | struct rds_connection *conn, *ret = NULL; |
---|
90 | 90 | |
---|
.. | .. |
---|
92 | 92 | if (ipv6_addr_equal(&conn->c_faddr, faddr) && |
---|
93 | 93 | ipv6_addr_equal(&conn->c_laddr, laddr) && |
---|
94 | 94 | conn->c_trans == trans && |
---|
| 95 | + conn->c_tos == tos && |
---|
95 | 96 | net == rds_conn_net(conn) && |
---|
96 | 97 | conn->c_dev_if == dev_if) { |
---|
97 | 98 | ret = conn; |
---|
.. | .. |
---|
139 | 140 | atomic_set(&cp->cp_state, RDS_CONN_DOWN); |
---|
140 | 141 | cp->cp_send_gen = 0; |
---|
141 | 142 | cp->cp_reconnect_jiffies = 0; |
---|
| 143 | + cp->cp_conn->c_proposed_version = RDS_PROTOCOL_VERSION; |
---|
142 | 144 | INIT_DELAYED_WORK(&cp->cp_send_w, rds_send_worker); |
---|
143 | 145 | INIT_DELAYED_WORK(&cp->cp_recv_w, rds_recv_worker); |
---|
144 | 146 | INIT_DELAYED_WORK(&cp->cp_conn_w, rds_connect_worker); |
---|
.. | .. |
---|
159 | 161 | const struct in6_addr *laddr, |
---|
160 | 162 | const struct in6_addr *faddr, |
---|
161 | 163 | struct rds_transport *trans, |
---|
162 | | - gfp_t gfp, |
---|
| 164 | + gfp_t gfp, u8 tos, |
---|
163 | 165 | int is_outgoing, |
---|
164 | 166 | int dev_if) |
---|
165 | 167 | { |
---|
.. | .. |
---|
171 | 173 | int npaths = (trans->t_mp_capable ? RDS_MPATH_WORKERS : 1); |
---|
172 | 174 | |
---|
173 | 175 | rcu_read_lock(); |
---|
174 | | - conn = rds_conn_lookup(net, head, laddr, faddr, trans, dev_if); |
---|
| 176 | + conn = rds_conn_lookup(net, head, laddr, faddr, trans, tos, dev_if); |
---|
175 | 177 | if (conn && |
---|
176 | 178 | conn->c_loopback && |
---|
177 | 179 | conn->c_trans != &rds_loop_transport && |
---|
.. | .. |
---|
205 | 207 | conn->c_isv6 = !ipv6_addr_v4mapped(laddr); |
---|
206 | 208 | conn->c_faddr = *faddr; |
---|
207 | 209 | conn->c_dev_if = dev_if; |
---|
| 210 | + conn->c_tos = tos; |
---|
208 | 211 | |
---|
209 | 212 | #if IS_ENABLED(CONFIG_IPV6) |
---|
210 | 213 | /* If the local address is link local, set c_bound_if to be the |
---|
.. | .. |
---|
309 | 312 | struct rds_connection *found; |
---|
310 | 313 | |
---|
311 | 314 | found = rds_conn_lookup(net, head, laddr, faddr, trans, |
---|
312 | | - dev_if); |
---|
| 315 | + tos, dev_if); |
---|
313 | 316 | if (found) { |
---|
314 | 317 | struct rds_conn_path *cp; |
---|
315 | 318 | int i; |
---|
.. | .. |
---|
344 | 347 | struct rds_connection *rds_conn_create(struct net *net, |
---|
345 | 348 | const struct in6_addr *laddr, |
---|
346 | 349 | const struct in6_addr *faddr, |
---|
347 | | - struct rds_transport *trans, gfp_t gfp, |
---|
348 | | - int dev_if) |
---|
| 350 | + struct rds_transport *trans, u8 tos, |
---|
| 351 | + gfp_t gfp, int dev_if) |
---|
349 | 352 | { |
---|
350 | | - return __rds_conn_create(net, laddr, faddr, trans, gfp, 0, dev_if); |
---|
| 353 | + return __rds_conn_create(net, laddr, faddr, trans, gfp, tos, 0, dev_if); |
---|
351 | 354 | } |
---|
352 | 355 | EXPORT_SYMBOL_GPL(rds_conn_create); |
---|
353 | 356 | |
---|
.. | .. |
---|
355 | 358 | const struct in6_addr *laddr, |
---|
356 | 359 | const struct in6_addr *faddr, |
---|
357 | 360 | struct rds_transport *trans, |
---|
358 | | - gfp_t gfp, int dev_if) |
---|
| 361 | + u8 tos, gfp_t gfp, int dev_if) |
---|
359 | 362 | { |
---|
360 | | - return __rds_conn_create(net, laddr, faddr, trans, gfp, 1, dev_if); |
---|
| 363 | + return __rds_conn_create(net, laddr, faddr, trans, gfp, tos, 1, dev_if); |
---|
361 | 364 | } |
---|
362 | 365 | EXPORT_SYMBOL_GPL(rds_conn_create_outgoing); |
---|
363 | 366 | |
---|
.. | .. |
---|
745 | 748 | cinfo->next_rx_seq = cp->cp_next_rx_seq; |
---|
746 | 749 | cinfo->laddr = conn->c_laddr.s6_addr32[3]; |
---|
747 | 750 | cinfo->faddr = conn->c_faddr.s6_addr32[3]; |
---|
| 751 | + cinfo->tos = conn->c_tos; |
---|
748 | 752 | strncpy(cinfo->transport, conn->c_trans->t_name, |
---|
749 | 753 | sizeof(cinfo->transport)); |
---|
750 | 754 | cinfo->flags = 0; |
---|
.. | .. |
---|
913 | 917 | } |
---|
914 | 918 | EXPORT_SYMBOL_GPL(rds_conn_path_connect_if_down); |
---|
915 | 919 | |
---|
| 920 | +/* Check connectivity of all paths |
---|
| 921 | + */ |
---|
| 922 | +void rds_check_all_paths(struct rds_connection *conn) |
---|
| 923 | +{ |
---|
| 924 | + int i = 0; |
---|
| 925 | + |
---|
| 926 | + do { |
---|
| 927 | + rds_conn_path_connect_if_down(&conn->c_path[i]); |
---|
| 928 | + } while (++i < conn->c_npaths); |
---|
| 929 | +} |
---|
| 930 | + |
---|
916 | 931 | void rds_conn_connect_if_down(struct rds_connection *conn) |
---|
917 | 932 | { |
---|
918 | 933 | WARN_ON(conn->c_trans->t_mp_capable); |
---|