summaryrefslogtreecommitdiffstats
path: root/net/tipc/link.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-03-25 12:07:24 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-25 14:05:56 -0400
commit1f66d161ab3d8b518903fa6c3f9c1f48d6919e74 (patch)
tree31275d3b6836126fc76c944b65693d83458dcb93 /net/tipc/link.h
parentb06b107a4c190299e9e3f8dbcccfc7fe9e10c8cb (diff)
tipc: introduce starvation free send algorithm
Currently, we only use a single counter; the length of the backlog queue, to determine whether a message should be accepted to the queue or not. Each time a message is being sent, the queue length is compared to a threshold value for the message's importance priority. If the queue length is beyond this threshold, the message is rejected. This algorithm implies a risk of starvation of low importance senders during very high load, because it may take a long time before the backlog queue has decreased enough to accept a lower level message. We now eliminate this risk by introducing a counter for each importance priority. When a message is sent, we check only the queue level for that particular message's priority. If that is ok, the message can be added to the backlog, irrespective of the queue level for other priorities. This way, each level is guaranteed a certain portion of the total bandwidth, and any risk of starvation is eliminated. Reviewed-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.h')
-rw-r--r--net/tipc/link.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h
index eec3ecf2d450..99543a46095a 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -118,7 +118,7 @@ struct tipc_stats {
118 * @pmsg: convenience pointer to "proto_msg" field 118 * @pmsg: convenience pointer to "proto_msg" field
119 * @priority: current link priority 119 * @priority: current link priority
120 * @net_plane: current link network plane ('A' through 'H') 120 * @net_plane: current link network plane ('A' through 'H')
121 * @queue_limit: outbound message queue congestion thresholds (indexed by user) 121 * @backlog_limit: backlog queue congestion thresholds (indexed by importance)
122 * @exp_msg_count: # of tunnelled messages expected during link changeover 122 * @exp_msg_count: # of tunnelled messages expected during link changeover
123 * @reset_checkpoint: seq # of last acknowledged message at time of link reset 123 * @reset_checkpoint: seq # of last acknowledged message at time of link reset
124 * @max_pkt: current maximum packet size for this link 124 * @max_pkt: current maximum packet size for this link
@@ -166,7 +166,6 @@ struct tipc_link {
166 struct tipc_msg *pmsg; 166 struct tipc_msg *pmsg;
167 u32 priority; 167 u32 priority;
168 char net_plane; 168 char net_plane;
169 u32 queue_limit[15]; /* queue_limit[0]==window limit */
170 169
171 /* Changeover */ 170 /* Changeover */
172 u32 exp_msg_count; 171 u32 exp_msg_count;
@@ -180,6 +179,10 @@ struct tipc_link {
180 /* Sending */ 179 /* Sending */
181 struct sk_buff_head transmq; 180 struct sk_buff_head transmq;
182 struct sk_buff_head backlogq; 181 struct sk_buff_head backlogq;
182 struct {
183 u16 len;
184 u16 limit;
185 } backlog[5];
183 u32 next_out_no; 186 u32 next_out_no;
184 u32 window; 187 u32 window;
185 u32 last_retransmitted; 188 u32 last_retransmitted;