aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2010-05-11 10:30:10 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-13 02:02:24 -0400
commit15e979da7c9ddddd55d2eb81e962dbb2aac51ad1 (patch)
treee5fc0c13f78ce97bdab75474e4d410e019f146f7 /net
parent8e1c298c01d4596fa2837913e531a93a791a7bec (diff)
tipc: remove abstraction for link_max_pkt
This is just a straight return of a field; there is no value in the abstraction of hiding it behind a function. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/link.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index c95038f42652..441b26a57850 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -232,11 +232,6 @@ static int link_congested(struct link *l_ptr)
232 return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]); 232 return (l_ptr->out_queue_size >= l_ptr->queue_limit[0]);
233} 233}
234 234
235static u32 link_max_pkt(struct link *l_ptr)
236{
237 return l_ptr->max_pkt;
238}
239
240static void link_init_max_pkt(struct link *l_ptr) 235static void link_init_max_pkt(struct link *l_ptr)
241{ 236{
242 u32 max_pkt; 237 u32 max_pkt;
@@ -562,7 +557,7 @@ static int link_schedule_port(struct link *l_ptr, u32 origport, u32 sz)
562 if (!list_empty(&p_ptr->wait_list)) 557 if (!list_empty(&p_ptr->wait_list))
563 goto exit; 558 goto exit;
564 p_ptr->publ.congested = 1; 559 p_ptr->publ.congested = 1;
565 p_ptr->waiting_pkts = 1 + ((sz - 1) / link_max_pkt(l_ptr)); 560 p_ptr->waiting_pkts = 1 + ((sz - 1) / l_ptr->max_pkt);
566 list_add_tail(&p_ptr->wait_list, &l_ptr->waiting_ports); 561 list_add_tail(&p_ptr->wait_list, &l_ptr->waiting_ports);
567 l_ptr->stats.link_congs++; 562 l_ptr->stats.link_congs++;
568exit: 563exit:
@@ -1015,7 +1010,7 @@ static int link_bundle_buf(struct link *l_ptr,
1015 return 0; 1010 return 0;
1016 if (skb_tailroom(bundler) < (pad + size)) 1011 if (skb_tailroom(bundler) < (pad + size))
1017 return 0; 1012 return 0;
1018 if (link_max_pkt(l_ptr) < (to_pos + size)) 1013 if (l_ptr->max_pkt < (to_pos + size))
1019 return 0; 1014 return 0;
1020 1015
1021 skb_put(bundler, pad + size); 1016 skb_put(bundler, pad + size);
@@ -1062,7 +1057,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
1062 u32 queue_size = l_ptr->out_queue_size; 1057 u32 queue_size = l_ptr->out_queue_size;
1063 u32 imp = msg_tot_importance(msg); 1058 u32 imp = msg_tot_importance(msg);
1064 u32 queue_limit = l_ptr->queue_limit[imp]; 1059 u32 queue_limit = l_ptr->queue_limit[imp];
1065 u32 max_packet = link_max_pkt(l_ptr); 1060 u32 max_packet = l_ptr->max_pkt;
1066 1061
1067 msg_set_prevnode(msg, tipc_own_addr); /* If routed message */ 1062 msg_set_prevnode(msg, tipc_own_addr); /* If routed message */
1068 1063
@@ -1193,7 +1188,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
1193 int res = msg_data_sz(msg); 1188 int res = msg_data_sz(msg);
1194 1189
1195 if (likely(!link_congested(l_ptr))) { 1190 if (likely(!link_congested(l_ptr))) {
1196 if (likely(msg_size(msg) <= link_max_pkt(l_ptr))) { 1191 if (likely(msg_size(msg) <= l_ptr->max_pkt)) {
1197 if (likely(list_empty(&l_ptr->b_ptr->cong_links))) { 1192 if (likely(list_empty(&l_ptr->b_ptr->cong_links))) {
1198 link_add_to_outqueue(l_ptr, buf, msg); 1193 link_add_to_outqueue(l_ptr, buf, msg);
1199 if (likely(tipc_bearer_send(l_ptr->b_ptr, buf, 1194 if (likely(tipc_bearer_send(l_ptr->b_ptr, buf,
@@ -1210,7 +1205,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf,
1210 } 1205 }
1211 } 1206 }
1212 else 1207 else
1213 *used_max_pkt = link_max_pkt(l_ptr); 1208 *used_max_pkt = l_ptr->max_pkt;
1214 } 1209 }
1215 return tipc_link_send_buf(l_ptr, buf); /* All other cases */ 1210 return tipc_link_send_buf(l_ptr, buf); /* All other cases */
1216} 1211}
@@ -1317,7 +1312,7 @@ exit:
1317 * then re-try fast path or fragment the message 1312 * then re-try fast path or fragment the message
1318 */ 1313 */
1319 1314
1320 sender->publ.max_pkt = link_max_pkt(l_ptr); 1315 sender->publ.max_pkt = l_ptr->max_pkt;
1321 tipc_node_unlock(node); 1316 tipc_node_unlock(node);
1322 read_unlock_bh(&tipc_net_lock); 1317 read_unlock_bh(&tipc_net_lock);
1323 1318
@@ -1480,8 +1475,8 @@ error:
1480 tipc_node_unlock(node); 1475 tipc_node_unlock(node);
1481 goto reject; 1476 goto reject;
1482 } 1477 }
1483 if (link_max_pkt(l_ptr) < max_pkt) { 1478 if (l_ptr->max_pkt < max_pkt) {
1484 sender->publ.max_pkt = link_max_pkt(l_ptr); 1479 sender->publ.max_pkt = l_ptr->max_pkt;
1485 tipc_node_unlock(node); 1480 tipc_node_unlock(node);
1486 for (; buf_chain; buf_chain = buf) { 1481 for (; buf_chain; buf_chain = buf) {
1487 buf = buf_chain->next; 1482 buf = buf_chain->next;
@@ -2679,7 +2674,7 @@ int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
2679 u32 dsz = msg_data_sz(inmsg); 2674 u32 dsz = msg_data_sz(inmsg);
2680 unchar *crs = buf->data; 2675 unchar *crs = buf->data;
2681 u32 rest = insize; 2676 u32 rest = insize;
2682 u32 pack_sz = link_max_pkt(l_ptr); 2677 u32 pack_sz = l_ptr->max_pkt;
2683 u32 fragm_sz = pack_sz - INT_H_SIZE; 2678 u32 fragm_sz = pack_sz - INT_H_SIZE;
2684 u32 fragm_no = 1; 2679 u32 fragm_no = 1;
2685 u32 destaddr; 2680 u32 destaddr;
@@ -3125,7 +3120,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size)
3125 tipc_printf(&pb, "Link <%s>\n" 3120 tipc_printf(&pb, "Link <%s>\n"
3126 " %s MTU:%u Priority:%u Tolerance:%u ms" 3121 " %s MTU:%u Priority:%u Tolerance:%u ms"
3127 " Window:%u packets\n", 3122 " Window:%u packets\n",
3128 l_ptr->name, status, link_max_pkt(l_ptr), 3123 l_ptr->name, status, l_ptr->max_pkt,
3129 l_ptr->priority, l_ptr->tolerance, l_ptr->queue_limit[0]); 3124 l_ptr->priority, l_ptr->tolerance, l_ptr->queue_limit[0]);
3130 tipc_printf(&pb, " RX packets:%u fragments:%u/%u bundles:%u/%u\n", 3125 tipc_printf(&pb, " RX packets:%u fragments:%u/%u bundles:%u/%u\n",
3131 l_ptr->next_in_no - l_ptr->stats.recv_info, 3126 l_ptr->next_in_no - l_ptr->stats.recv_info,
@@ -3270,7 +3265,7 @@ u32 tipc_link_get_max_pkt(u32 dest, u32 selector)
3270 tipc_node_lock(n_ptr); 3265 tipc_node_lock(n_ptr);
3271 l_ptr = n_ptr->active_links[selector & 1]; 3266 l_ptr = n_ptr->active_links[selector & 1];
3272 if (l_ptr) 3267 if (l_ptr)
3273 res = link_max_pkt(l_ptr); 3268 res = l_ptr->max_pkt;
3274 tipc_node_unlock(n_ptr); 3269 tipc_node_unlock(n_ptr);
3275 } 3270 }
3276 read_unlock_bh(&tipc_net_lock); 3271 read_unlock_bh(&tipc_net_lock);