aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/tipc/link.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'net/tipc/link.h')
-rw-r--r--net/tipc/link.h62
1 files changed, 23 insertions, 39 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 2e5385c47d30..74fbecab1ea0 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -2,7 +2,7 @@
2 * net/tipc/link.h: Include file for TIPC link code 2 * net/tipc/link.h: Include file for TIPC link code
3 * 3 *
4 * Copyright (c) 1995-2006, Ericsson AB 4 * Copyright (c) 1995-2006, Ericsson AB
5 * Copyright (c) 2004-2005, Wind River Systems 5 * Copyright (c) 2004-2005, 2010-2011, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -37,9 +37,8 @@
37#ifndef _TIPC_LINK_H 37#ifndef _TIPC_LINK_H
38#define _TIPC_LINK_H 38#define _TIPC_LINK_H
39 39
40#include "dbg.h" 40#include "log.h"
41#include "msg.h" 41#include "msg.h"
42#include "bearer.h"
43#include "node.h" 42#include "node.h"
44 43
45#define PUSH_FAILED 1 44#define PUSH_FAILED 1
@@ -108,7 +107,6 @@
108 * @long_msg_seq_no: next identifier to use for outbound fragmented messages 107 * @long_msg_seq_no: next identifier to use for outbound fragmented messages
109 * @defragm_buf: list of partially reassembled inbound message fragments 108 * @defragm_buf: list of partially reassembled inbound message fragments
110 * @stats: collects statistics regarding link activity 109 * @stats: collects statistics regarding link activity
111 * @print_buf: print buffer used to log link activity
112 */ 110 */
113 111
114struct link { 112struct link {
@@ -124,7 +122,7 @@ struct link {
124 u32 checkpoint; 122 u32 checkpoint;
125 u32 peer_session; 123 u32 peer_session;
126 u32 peer_bearer_id; 124 u32 peer_bearer_id;
127 struct bearer *b_ptr; 125 struct tipc_bearer *b_ptr;
128 u32 tolerance; 126 u32 tolerance;
129 u32 continuity_interval; 127 u32 continuity_interval;
130 u32 abort_limit; 128 u32 abort_limit;
@@ -198,30 +196,19 @@ struct link {
198 u32 bearer_congs; 196 u32 bearer_congs;
199 u32 deferred_recv; 197 u32 deferred_recv;
200 u32 duplicates; 198 u32 duplicates;
201 199 u32 max_queue_sz; /* send queue size high water mark */
202 /* for statistical profiling of send queue size */ 200 u32 accu_queue_sz; /* used for send queue size profiling */
203 201 u32 queue_sz_counts; /* used for send queue size profiling */
204 u32 max_queue_sz; 202 u32 msg_length_counts; /* used for message length profiling */
205 u32 accu_queue_sz; 203 u32 msg_lengths_total; /* used for message length profiling */
206 u32 queue_sz_counts; 204 u32 msg_length_profile[7]; /* used for msg. length profiling */
207
208 /* for statistical profiling of message lengths */
209
210 u32 msg_length_counts;
211 u32 msg_lengths_total;
212 u32 msg_length_profile[7];
213#if 0
214 u32 sent_tunneled;
215 u32 recv_tunneled;
216#endif
217 } stats; 205 } stats;
218
219 struct print_buf print_buf;
220}; 206};
221 207
222struct port; 208struct tipc_port;
223 209
224struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, 210struct link *tipc_link_create(struct tipc_node *n_ptr,
211 struct tipc_bearer *b_ptr,
225 const struct tipc_media_addr *media_addr); 212 const struct tipc_media_addr *media_addr);
226void tipc_link_delete(struct link *l_ptr); 213void tipc_link_delete(struct link *l_ptr);
227void tipc_link_changeover(struct link *l_ptr); 214void tipc_link_changeover(struct link *l_ptr);
@@ -229,7 +216,6 @@ void tipc_link_send_duplicate(struct link *l_ptr, struct link *dest);
229void tipc_link_reset_fragments(struct link *l_ptr); 216void tipc_link_reset_fragments(struct link *l_ptr);
230int tipc_link_is_up(struct link *l_ptr); 217int tipc_link_is_up(struct link *l_ptr);
231int tipc_link_is_active(struct link *l_ptr); 218int tipc_link_is_active(struct link *l_ptr);
232void tipc_link_start(struct link *l_ptr);
233u32 tipc_link_push_packet(struct link *l_ptr); 219u32 tipc_link_push_packet(struct link *l_ptr);
234void tipc_link_stop(struct link *l_ptr); 220void tipc_link_stop(struct link *l_ptr);
235struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd); 221struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd);
@@ -238,14 +224,12 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_
238void tipc_link_reset(struct link *l_ptr); 224void tipc_link_reset(struct link *l_ptr);
239int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector); 225int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector);
240int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf); 226int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf);
241u32 tipc_link_get_max_pkt(u32 dest,u32 selector); 227u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
242int tipc_link_send_sections_fast(struct port* sender, 228int tipc_link_send_sections_fast(struct tipc_port *sender,
243 struct iovec const *msg_sect, 229 struct iovec const *msg_sect,
244 const u32 num_sect, 230 const u32 num_sect,
231 unsigned int total_len,
245 u32 destnode); 232 u32 destnode);
246int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
247void tipc_link_tunnel(struct link *l_ptr, struct tipc_msg *tnl_hdr,
248 struct tipc_msg *msg, u32 selector);
249void tipc_link_recv_bundle(struct sk_buff *buf); 233void tipc_link_recv_bundle(struct sk_buff *buf);
250int tipc_link_recv_fragment(struct sk_buff **pending, 234int tipc_link_recv_fragment(struct sk_buff **pending,
251 struct sk_buff **fb, 235 struct sk_buff **fb,
@@ -279,12 +263,12 @@ static inline int between(u32 lower, u32 upper, u32 n)
279 263
280static inline int less_eq(u32 left, u32 right) 264static inline int less_eq(u32 left, u32 right)
281{ 265{
282 return (mod(right - left) < 32768u); 266 return mod(right - left) < 32768u;
283} 267}
284 268
285static inline int less(u32 left, u32 right) 269static inline int less(u32 left, u32 right)
286{ 270{
287 return (less_eq(left, right) && (mod(right) != mod(left))); 271 return less_eq(left, right) && (mod(right) != mod(left));
288} 272}
289 273
290static inline u32 lesser(u32 left, u32 right) 274static inline u32 lesser(u32 left, u32 right)
@@ -299,32 +283,32 @@ static inline u32 lesser(u32 left, u32 right)
299 283
300static inline int link_working_working(struct link *l_ptr) 284static inline int link_working_working(struct link *l_ptr)
301{ 285{
302 return (l_ptr->state == WORKING_WORKING); 286 return l_ptr->state == WORKING_WORKING;
303} 287}
304 288
305static inline int link_working_unknown(struct link *l_ptr) 289static inline int link_working_unknown(struct link *l_ptr)
306{ 290{
307 return (l_ptr->state == WORKING_UNKNOWN); 291 return l_ptr->state == WORKING_UNKNOWN;
308} 292}
309 293
310static inline int link_reset_unknown(struct link *l_ptr) 294static inline int link_reset_unknown(struct link *l_ptr)
311{ 295{
312 return (l_ptr->state == RESET_UNKNOWN); 296 return l_ptr->state == RESET_UNKNOWN;
313} 297}
314 298
315static inline int link_reset_reset(struct link *l_ptr) 299static inline int link_reset_reset(struct link *l_ptr)
316{ 300{
317 return (l_ptr->state == RESET_RESET); 301 return l_ptr->state == RESET_RESET;
318} 302}
319 303
320static inline int link_blocked(struct link *l_ptr) 304static inline int link_blocked(struct link *l_ptr)
321{ 305{
322 return (l_ptr->exp_msg_count || l_ptr->blocked); 306 return l_ptr->exp_msg_count || l_ptr->blocked;
323} 307}
324 308
325static inline int link_congested(struct link *l_ptr) 309static inline int link_congested(struct link *l_ptr)
326{ 310{
327 return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]); 311 return l_ptr->out_queue_size >= l_ptr->queue_limit[0];
328} 312}
329 313
330#endif 314#endif