Skip to content

Commit 16ad3f4

Browse files
Jon Maloydavem330
authored andcommitted
tipc: introduce variable window congestion control
We introduce a simple variable window congestion control for links. The algorithm is inspired by the Reno algorithm, covering both 'slow start', 'congestion avoidance', and 'fast recovery' modes. - We introduce hard lower and upper window limits per link, still different and configurable per bearer type. - We introduce a 'slow start theshold' variable, initially set to the maximum window size. - We let a link start at the minimum congestion window, i.e. in slow start mode, and then let is grow rapidly (+1 per rceived ACK) until it reaches the slow start threshold and enters congestion avoidance mode. - In congestion avoidance mode we increment the congestion window for each window-size number of acked packets, up to a possible maximum equal to the configured maximum window. - For each non-duplicate NACK received, we drop back to fast recovery mode, by setting the both the slow start threshold to and the congestion window to (current_congestion_window / 2). - If the timeout handler finds that the transmit queue has not moved since the previous timeout, it drops the link back to slow start and forces a probe containing the last sent sequence number to the sent to the peer, so that this can discover the stale situation. This change does in reality have effect only on unicast ethernet transport, as we have seen that there is no room whatsoever for increasing the window max size for the UDP bearer. For now, we also choose to keep the limits for the broadcast link unchanged and equal. This algorithm seems to give a 50-100% throughput improvement for messages larger than MTU. Suggested-by: Xin Long <[email protected]> Acked-by: Ying Xue <[email protected]> Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d3b0999 commit 16ad3f4

File tree

9 files changed

+160
-79
lines changed

9 files changed

+160
-79
lines changed

net/tipc/bcast.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,18 +562,18 @@ int tipc_bclink_reset_stats(struct net *net)
562562
return 0;
563563
}
564564

565-
static int tipc_bc_link_set_queue_limits(struct net *net, u32 limit)
565+
static int tipc_bc_link_set_queue_limits(struct net *net, u32 max_win)
566566
{
567567
struct tipc_link *l = tipc_bc_sndlink(net);
568568

569569
if (!l)
570570
return -ENOPROTOOPT;
571-
if (limit < BCLINK_WIN_MIN)
572-
limit = BCLINK_WIN_MIN;
573-
if (limit > TIPC_MAX_LINK_WIN)
571+
if (max_win < BCLINK_WIN_MIN)
572+
max_win = BCLINK_WIN_MIN;
573+
if (max_win > TIPC_MAX_LINK_WIN)
574574
return -EINVAL;
575575
tipc_bcast_lock(net);
576-
tipc_link_set_queue_limits(l, limit);
576+
tipc_link_set_queue_limits(l, BCLINK_WIN_MIN, max_win);
577577
tipc_bcast_unlock(net);
578578
return 0;
579579
}
@@ -683,6 +683,7 @@ int tipc_bcast_init(struct net *net)
683683
if (!tipc_link_bc_create(net, 0, 0,
684684
FB_MTU,
685685
BCLINK_WIN_DEFAULT,
686+
BCLINK_WIN_DEFAULT,
686687
0,
687688
&bb->inputq,
688689
NULL,

net/tipc/bearer.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ static int tipc_enable_bearer(struct net *net, const char *name,
311311

312312
b->identity = bearer_id;
313313
b->tolerance = m->tolerance;
314-
b->window = m->window;
314+
b->min_win = m->min_win;
315+
b->max_win = m->max_win;
315316
b->domain = disc_domain;
316317
b->net_plane = bearer_id + 'A';
317318
b->priority = prio;
@@ -796,7 +797,7 @@ static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg,
796797
goto prop_msg_full;
797798
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_TOL, bearer->tolerance))
798799
goto prop_msg_full;
799-
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->window))
800+
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, bearer->max_win))
800801
goto prop_msg_full;
801802
if (bearer->media->type_id == TIPC_MEDIA_TYPE_UDP)
802803
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, bearer->mtu))
@@ -1088,7 +1089,7 @@ int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
10881089
if (props[TIPC_NLA_PROP_PRIO])
10891090
b->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
10901091
if (props[TIPC_NLA_PROP_WIN])
1091-
b->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
1092+
b->max_win = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
10921093
if (props[TIPC_NLA_PROP_MTU]) {
10931094
if (b->media->type_id != TIPC_MEDIA_TYPE_UDP)
10941095
return -EINVAL;
@@ -1142,7 +1143,7 @@ static int __tipc_nl_add_media(struct tipc_nl_msg *msg,
11421143
goto prop_msg_full;
11431144
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_TOL, media->tolerance))
11441145
goto prop_msg_full;
1145-
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, media->window))
1146+
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_WIN, media->max_win))
11461147
goto prop_msg_full;
11471148
if (media->type_id == TIPC_MEDIA_TYPE_UDP)
11481149
if (nla_put_u32(msg->skb, TIPC_NLA_PROP_MTU, media->mtu))
@@ -1275,7 +1276,7 @@ int __tipc_nl_media_set(struct sk_buff *skb, struct genl_info *info)
12751276
if (props[TIPC_NLA_PROP_PRIO])
12761277
m->priority = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
12771278
if (props[TIPC_NLA_PROP_WIN])
1278-
m->window = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
1279+
m->max_win = nla_get_u32(props[TIPC_NLA_PROP_WIN]);
12791280
if (props[TIPC_NLA_PROP_MTU]) {
12801281
if (m->type_id != TIPC_MEDIA_TYPE_UDP)
12811282
return -EINVAL;

net/tipc/bearer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ struct tipc_media {
119119
char *raw);
120120
u32 priority;
121121
u32 tolerance;
122-
u32 window;
122+
u32 min_win;
123+
u32 max_win;
123124
u32 mtu;
124125
u32 type_id;
125126
u32 hwaddr_len;
@@ -158,7 +159,8 @@ struct tipc_bearer {
158159
struct packet_type pt;
159160
struct rcu_head rcu;
160161
u32 priority;
161-
u32 window;
162+
u32 min_win;
163+
u32 max_win;
162164
u32 tolerance;
163165
u32 domain;
164166
u32 identity;

net/tipc/eth_media.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ struct tipc_media eth_media_info = {
9292
.raw2addr = tipc_eth_raw2addr,
9393
.priority = TIPC_DEF_LINK_PRI,
9494
.tolerance = TIPC_DEF_LINK_TOL,
95-
.window = TIPC_DEF_LINK_WIN,
95+
.min_win = TIPC_DEF_LINK_WIN,
96+
.max_win = TIPC_MAX_LINK_WIN,
9697
.type_id = TIPC_MEDIA_TYPE_ETH,
9798
.hwaddr_len = ETH_ALEN,
9899
.name = "eth"

net/tipc/ib_media.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include "core.h"
4343
#include "bearer.h"
4444

45+
#define TIPC_MAX_IB_LINK_WIN 500
46+
4547
/* convert InfiniBand address (media address format) media address to string */
4648
static int tipc_ib_addr2str(struct tipc_media_addr *a, char *str_buf,
4749
int str_size)
@@ -94,7 +96,8 @@ struct tipc_media ib_media_info = {
9496
.raw2addr = tipc_ib_raw2addr,
9597
.priority = TIPC_DEF_LINK_PRI,
9698
.tolerance = TIPC_DEF_LINK_TOL,
97-
.window = TIPC_DEF_LINK_WIN,
99+
.min_win = TIPC_DEF_LINK_WIN,
100+
.max_win = TIPC_MAX_IB_LINK_WIN,
98101
.type_id = TIPC_MEDIA_TYPE_IB,
99102
.hwaddr_len = INFINIBAND_ALEN,
100103
.name = "ib"

0 commit comments

Comments
 (0)