Skip to content

Commit

Permalink
rds: avoid unenecessary cong_update in loop transport
Browse files Browse the repository at this point in the history
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: [email protected]
Reviewed-by: Sowmini Varadhan <[email protected]>
Signed-off-by: Santosh Shilimkar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
SantoshShilimkar authored and davem330 committed Jun 15, 2018
1 parent 7f6afc3 commit f1693c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/rds/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,5 @@ struct rds_transport rds_loop_transport = {
.inc_copy_to_user = rds_message_inc_copy_to_user,
.inc_free = rds_loop_inc_free,
.t_name = "loopback",
.t_type = RDS_TRANS_LOOP,
};
5 changes: 5 additions & 0 deletions net/rds/rds.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ struct rds_notifier {
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
*
Expand Down
5 changes: 5 additions & 0 deletions net/rds/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
else
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);

rdsdebug("rs %p (%pI4:%u) recv bytes %d buf %d "
Expand Down

0 comments on commit f1693c6

Please sign in to comment.