Commit f1693c63 authored by Santosh Shilimkar's avatar Santosh Shilimkar Committed by David S. Miller

rds: avoid unenecessary cong_update in loop transport

Loop transport which is self loopback, remote port congestion
update isn't relevant. Infact the xmit path already ignores it.
Receive path needs to do the same.

Reported-by: syzbot+4c20b3866171ce8441d2@syzkaller.appspotmail.com
Reviewed-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7f6afc33
...@@ -193,4 +193,5 @@ struct rds_transport rds_loop_transport = { ...@@ -193,4 +193,5 @@ struct rds_transport rds_loop_transport = {
.inc_copy_to_user = rds_message_inc_copy_to_user, .inc_copy_to_user = rds_message_inc_copy_to_user,
.inc_free = rds_loop_inc_free, .inc_free = rds_loop_inc_free,
.t_name = "loopback", .t_name = "loopback",
.t_type = RDS_TRANS_LOOP,
}; };
...@@ -479,6 +479,11 @@ struct rds_notifier { ...@@ -479,6 +479,11 @@ struct rds_notifier {
int n_status; int n_status;
}; };
/* Available as part of RDS core, so doesn't need to participate
* in get_preferred transport etc
*/
#define RDS_TRANS_LOOP 3
/** /**
* struct rds_transport - transport specific behavioural hooks * struct rds_transport - transport specific behavioural hooks
* *
......
...@@ -103,6 +103,11 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk, ...@@ -103,6 +103,11 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk,
rds_stats_add(s_recv_bytes_added_to_socket, delta); rds_stats_add(s_recv_bytes_added_to_socket, delta);
else else
rds_stats_add(s_recv_bytes_removed_from_socket, -delta); rds_stats_add(s_recv_bytes_removed_from_socket, -delta);
/* loop transport doesn't send/recv congestion updates */
if (rs->rs_transport->t_type == RDS_TRANS_LOOP)
return;
now_congested = rs->rs_rcv_bytes > rds_sk_rcvbuf(rs); now_congested = rs->rs_rcv_bytes > rds_sk_rcvbuf(rs);
rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d " rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d "
......
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