Skip to content

Commit f1693c6

Browse files
SantoshShilimkardavem330
authored andcommitted
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: [email protected] Reviewed-by: Sowmini Varadhan <[email protected]> Signed-off-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7f6afc3 commit f1693c6

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

net/rds/loop.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,5 @@ struct rds_transport rds_loop_transport = {
193193
.inc_copy_to_user = rds_message_inc_copy_to_user,
194194
.inc_free = rds_loop_inc_free,
195195
.t_name = "loopback",
196+
.t_type = RDS_TRANS_LOOP,
196197
};

net/rds/rds.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ struct rds_notifier {
479479
int n_status;
480480
};
481481

482+
/* Available as part of RDS core, so doesn't need to participate
483+
* in get_preferred transport etc
484+
*/
485+
#define RDS_TRANS_LOOP 3
486+
482487
/**
483488
* struct rds_transport - transport specific behavioural hooks
484489
*

net/rds/recv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk,
103103
rds_stats_add(s_recv_bytes_added_to_socket, delta);
104104
else
105105
rds_stats_add(s_recv_bytes_removed_from_socket, -delta);
106+
107+
/* loop transport doesn't send/recv congestion updates */
108+
if (rs->rs_transport->t_type == RDS_TRANS_LOOP)
109+
return;
110+
106111
now_congested = rs->rs_rcv_bytes > rds_sk_rcvbuf(rs);
107112

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

0 commit comments

Comments
 (0)