Commit 06d82c9191261942ce7873ce4a8735fd2a15e662
Committed by
David S. Miller
1 parent
0e0609bbd2
Exists in
master
and in
4 other branches
[TIPC]: Minor cleanup of message header code
This patch eliminates some unused or duplicate message header symbols, and fixes up the comments and/or location of a few other symbols. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 4 changed files with 27 additions and 29 deletions Side-by-side Diff
net/tipc/link.c
... | ... | @@ -2832,15 +2832,15 @@ |
2832 | 2832 | void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) |
2833 | 2833 | { |
2834 | 2834 | /* Data messages from this node, inclusive FIRST_FRAGM */ |
2835 | - l_ptr->queue_limit[DATA_LOW] = window; | |
2836 | - l_ptr->queue_limit[DATA_MEDIUM] = (window / 3) * 4; | |
2837 | - l_ptr->queue_limit[DATA_HIGH] = (window / 3) * 5; | |
2838 | - l_ptr->queue_limit[DATA_CRITICAL] = (window / 3) * 6; | |
2835 | + l_ptr->queue_limit[TIPC_LOW_IMPORTANCE] = window; | |
2836 | + l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE] = (window / 3) * 4; | |
2837 | + l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE] = (window / 3) * 5; | |
2838 | + l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE] = (window / 3) * 6; | |
2839 | 2839 | /* Transiting data messages,inclusive FIRST_FRAGM */ |
2840 | - l_ptr->queue_limit[DATA_LOW + 4] = 300; | |
2841 | - l_ptr->queue_limit[DATA_MEDIUM + 4] = 600; | |
2842 | - l_ptr->queue_limit[DATA_HIGH + 4] = 900; | |
2843 | - l_ptr->queue_limit[DATA_CRITICAL + 4] = 1200; | |
2840 | + l_ptr->queue_limit[TIPC_LOW_IMPORTANCE + 4] = 300; | |
2841 | + l_ptr->queue_limit[TIPC_MEDIUM_IMPORTANCE + 4] = 600; | |
2842 | + l_ptr->queue_limit[TIPC_HIGH_IMPORTANCE + 4] = 900; | |
2843 | + l_ptr->queue_limit[TIPC_CRITICAL_IMPORTANCE + 4] = 1200; | |
2844 | 2844 | l_ptr->queue_limit[CONN_MANAGER] = 1200; |
2845 | 2845 | l_ptr->queue_limit[ROUTE_DISTRIBUTOR] = 1200; |
2846 | 2846 | l_ptr->queue_limit[CHANGEOVER_PROTOCOL] = 2500; |
net/tipc/msg.c
... | ... | @@ -73,10 +73,10 @@ |
73 | 73 | tipc_printf(buf, "NO(%u/%u):",msg_long_msgno(msg), |
74 | 74 | msg_fragm_no(msg)); |
75 | 75 | break; |
76 | - case DATA_LOW: | |
77 | - case DATA_MEDIUM: | |
78 | - case DATA_HIGH: | |
79 | - case DATA_CRITICAL: | |
76 | + case TIPC_LOW_IMPORTANCE: | |
77 | + case TIPC_MEDIUM_IMPORTANCE: | |
78 | + case TIPC_HIGH_IMPORTANCE: | |
79 | + case TIPC_CRITICAL_IMPORTANCE: | |
80 | 80 | tipc_printf(buf, "DAT%u:", msg_user(msg)); |
81 | 81 | if (msg_short(msg)) { |
82 | 82 | tipc_printf(buf, "CON:"); |
... | ... | @@ -229,10 +229,10 @@ |
229 | 229 | switch (usr) { |
230 | 230 | case CONN_MANAGER: |
231 | 231 | case NAME_DISTRIBUTOR: |
232 | - case DATA_LOW: | |
233 | - case DATA_MEDIUM: | |
234 | - case DATA_HIGH: | |
235 | - case DATA_CRITICAL: | |
232 | + case TIPC_LOW_IMPORTANCE: | |
233 | + case TIPC_MEDIUM_IMPORTANCE: | |
234 | + case TIPC_HIGH_IMPORTANCE: | |
235 | + case TIPC_CRITICAL_IMPORTANCE: | |
236 | 236 | if (msg_short(msg)) |
237 | 237 | break; /* No error */ |
238 | 238 | switch (msg_errcode(msg)) { |
net/tipc/msg.h
... | ... | @@ -40,18 +40,16 @@ |
40 | 40 | #include "core.h" |
41 | 41 | |
42 | 42 | #define TIPC_VERSION 2 |
43 | -#define DATA_LOW TIPC_LOW_IMPORTANCE | |
44 | -#define DATA_MEDIUM TIPC_MEDIUM_IMPORTANCE | |
45 | -#define DATA_HIGH TIPC_HIGH_IMPORTANCE | |
46 | -#define DATA_CRITICAL TIPC_CRITICAL_IMPORTANCE | |
47 | -#define SHORT_H_SIZE 24 /* Connected,in cluster */ | |
43 | + | |
44 | +#define SHORT_H_SIZE 24 /* Connected, in-cluster messages */ | |
48 | 45 | #define DIR_MSG_H_SIZE 32 /* Directly addressed messages */ |
49 | -#define CONN_MSG_H_SIZE 36 /* Routed connected msgs*/ | |
50 | -#define LONG_H_SIZE 40 /* Named Messages */ | |
46 | +#define LONG_H_SIZE 40 /* Named messages */ | |
51 | 47 | #define MCAST_H_SIZE 44 /* Multicast messages */ |
52 | -#define MAX_H_SIZE 60 /* Inclusive full options */ | |
48 | +#define INT_H_SIZE 40 /* Internal messages */ | |
49 | +#define MIN_H_SIZE 24 /* Smallest legal TIPC header size */ | |
50 | +#define MAX_H_SIZE 60 /* Largest possible TIPC header size */ | |
51 | + | |
53 | 52 | #define MAX_MSG_SIZE (MAX_H_SIZE + TIPC_MAX_USER_MSG_SIZE) |
54 | -#define LINK_CONFIG 13 | |
55 | 53 | |
56 | 54 | |
57 | 55 | /* |
... | ... | @@ -97,7 +95,7 @@ |
97 | 95 | |
98 | 96 | static inline u32 msg_isdata(struct tipc_msg *m) |
99 | 97 | { |
100 | - return (msg_user(m) <= DATA_CRITICAL); | |
98 | + return (msg_user(m) <= TIPC_CRITICAL_IMPORTANCE); | |
101 | 99 | } |
102 | 100 | |
103 | 101 | static inline void msg_set_user(struct tipc_msg *m, u32 n) |
... | ... | @@ -365,7 +363,6 @@ |
365 | 363 | #define NAME_DISTRIBUTOR 11 |
366 | 364 | #define MSG_FRAGMENTER 12 |
367 | 365 | #define LINK_CONFIG 13 |
368 | -#define INT_H_SIZE 40 | |
369 | 366 | #define DSC_H_SIZE 40 |
370 | 367 | |
371 | 368 | /* |
net/tipc/port.c
... | ... | @@ -242,7 +242,8 @@ |
242 | 242 | p_ptr->publ.max_pkt = MAX_PKT_DEFAULT; |
243 | 243 | p_ptr->publ.ref = ref; |
244 | 244 | msg = &p_ptr->publ.phdr; |
245 | - msg_init(msg, DATA_LOW, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, 0); | |
245 | + msg_init(msg, TIPC_LOW_IMPORTANCE, TIPC_NAMED_MSG, TIPC_OK, LONG_H_SIZE, | |
246 | + 0); | |
246 | 247 | msg_set_orignode(msg, tipc_own_addr); |
247 | 248 | msg_set_prevnode(msg, tipc_own_addr); |
248 | 249 | msg_set_origport(msg, ref); |
... | ... | @@ -625,7 +626,7 @@ |
625 | 626 | msg_orignode(msg), |
626 | 627 | msg_destport(msg), |
627 | 628 | tipc_own_addr, |
628 | - DATA_HIGH, | |
629 | + TIPC_HIGH_IMPORTANCE, | |
629 | 630 | TIPC_CONN_MSG, |
630 | 631 | err, |
631 | 632 | 0, |