Commit 45997e9e authored by Sowmini Varadhan's avatar Sowmini Varadhan Committed by David S. Miller

RDS: Make rds_send_pong() take a rds_conn_path argument

This commit allows rds_send_pong() callers to send back
the rds pong message on some path other than c_path[0] by
passing in a struct rds_conn_path * argument.  It also
removes the last dependency on the #defines in rds_single.h
from send.c
Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 01ff34ed
...@@ -790,7 +790,7 @@ void rds_send_drop_acked(struct rds_connection *conn, u64 ack, ...@@ -790,7 +790,7 @@ void rds_send_drop_acked(struct rds_connection *conn, u64 ack,
is_acked_func is_acked); is_acked_func is_acked);
void rds_send_path_drop_acked(struct rds_conn_path *cp, u64 ack, void rds_send_path_drop_acked(struct rds_conn_path *cp, u64 ack,
is_acked_func is_acked); is_acked_func is_acked);
int rds_send_pong(struct rds_connection *conn, __be16 dport); int rds_send_pong(struct rds_conn_path *cp, __be16 dport);
/* rdma.c */ /* rdma.c */
void rds_rdma_unuse(struct rds_sock *rs, u32 r_key, int force); void rds_rdma_unuse(struct rds_sock *rs, u32 r_key, int force);
......
...@@ -227,7 +227,7 @@ void rds_recv_incoming(struct rds_connection *conn, __be32 saddr, __be32 daddr, ...@@ -227,7 +227,7 @@ void rds_recv_incoming(struct rds_connection *conn, __be32 saddr, __be32 daddr,
if (rds_sysctl_ping_enable && inc->i_hdr.h_dport == 0) { if (rds_sysctl_ping_enable && inc->i_hdr.h_dport == 0) {
rds_stats_inc(s_recv_ping); rds_stats_inc(s_recv_ping);
rds_send_pong(conn, inc->i_hdr.h_sport); rds_send_pong(cp, inc->i_hdr.h_sport);
goto out; goto out;
} }
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/sizes.h> #include <linux/sizes.h>
#include "rds_single_path.h"
#include "rds.h" #include "rds.h"
/* When transmitting messages in rds_send_xmit, we need to emerge from /* When transmitting messages in rds_send_xmit, we need to emerge from
...@@ -1153,7 +1152,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) ...@@ -1153,7 +1152,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
* Reply to a ping packet. * Reply to a ping packet.
*/ */
int int
rds_send_pong(struct rds_connection *conn, __be16 dport) rds_send_pong(struct rds_conn_path *cp, __be16 dport)
{ {
struct rds_message *rm; struct rds_message *rm;
unsigned long flags; unsigned long flags;
...@@ -1165,31 +1164,32 @@ rds_send_pong(struct rds_connection *conn, __be16 dport) ...@@ -1165,31 +1164,32 @@ rds_send_pong(struct rds_connection *conn, __be16 dport)
goto out; goto out;
} }
rm->m_daddr = conn->c_faddr; rm->m_daddr = cp->cp_conn->c_faddr;
rm->data.op_active = 1; rm->data.op_active = 1;
rds_conn_connect_if_down(conn); rds_conn_connect_if_down(cp->cp_conn);
ret = rds_cong_wait(conn->c_fcong, dport, 1, NULL); ret = rds_cong_wait(cp->cp_conn->c_fcong, dport, 1, NULL);
if (ret) if (ret)
goto out; goto out;
spin_lock_irqsave(&conn->c_lock, flags); spin_lock_irqsave(&cp->cp_lock, flags);
list_add_tail(&rm->m_conn_item, &conn->c_send_queue); list_add_tail(&rm->m_conn_item, &cp->cp_send_queue);
set_bit(RDS_MSG_ON_CONN, &rm->m_flags); set_bit(RDS_MSG_ON_CONN, &rm->m_flags);
rds_message_addref(rm); rds_message_addref(rm);
rm->m_inc.i_conn = conn; rm->m_inc.i_conn = cp->cp_conn;
rm->m_inc.i_conn_path = cp;
rds_message_populate_header(&rm->m_inc.i_hdr, 0, dport, rds_message_populate_header(&rm->m_inc.i_hdr, 0, dport,
conn->c_next_tx_seq); cp->cp_next_tx_seq);
conn->c_next_tx_seq++; cp->cp_next_tx_seq++;
spin_unlock_irqrestore(&conn->c_lock, flags); spin_unlock_irqrestore(&cp->cp_lock, flags);
rds_stats_inc(s_send_queued); rds_stats_inc(s_send_queued);
rds_stats_inc(s_send_pong); rds_stats_inc(s_send_pong);
/* schedule the send work on rds_wq */ /* schedule the send work on rds_wq */
queue_delayed_work(rds_wq, &conn->c_send_w, 1); queue_delayed_work(rds_wq, &cp->cp_send_w, 1);
rds_message_put(rm); rds_message_put(rm);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment