aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-11-25 22:41:49 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-26 12:30:17 -0500
commit58311d169083f1940c7ce64cb6bf736e2a023cd0 (patch)
tree4a6381e83b0c30aba89b39d8b7a522d0ffa6028b /net/tipc
parent47b4c9a82f2ed0c00aa1c20899b41f54d6f8a07a (diff)
tipc: eliminate two pseudo message types of BUNDLE_OPEN and BUNDLE_CLOSED
The pseudo message types of BUNDLE_CLOSED as well as BUNDLE_OPEN are used to flag whether or not more messages can be bundled into a data packet in the outgoing transmission queue. Obviously, no more messages can be appended after the packet has been sent and is waiting to be acknowledged and deleted. These message types do in reality represent a send-side local implementation flag, and are not defined as part of the protocol. It is therefore safe to move it to to where it belongs, that is, the control area (TIPC_SKB_CB) of the buffer. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/core.h1
-rw-r--r--net/tipc/link.c2
-rw-r--r--net/tipc/msg.c5
-rw-r--r--net/tipc/msg.h5
4 files changed, 5 insertions, 8 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h
index b578b10feefa..84602137ce20 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -192,6 +192,7 @@ struct tipc_skb_cb {
192 struct sk_buff *tail; 192 struct sk_buff *tail;
193 bool deferred; 193 bool deferred;
194 bool wakeup_pending; 194 bool wakeup_pending;
195 bool bundling;
195 u16 chain_sz; 196 u16 chain_sz;
196 u16 chain_imp; 197 u16 chain_imp;
197}; 198};
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 470f05383d43..8eb885eb1433 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -875,7 +875,7 @@ void tipc_link_push_packets(struct tipc_link *l_ptr)
875 msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); 875 msg_set_ack(msg, mod(l_ptr->next_in_no - 1));
876 msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); 876 msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in);
877 if (msg_user(msg) == MSG_BUNDLER) 877 if (msg_user(msg) == MSG_BUNDLER)
878 msg_set_type(msg, BUNDLE_CLOSED); 878 TIPC_SKB_CB(skb)->bundling = false;
879 tipc_bearer_send(l_ptr->bearer_id, skb, 879 tipc_bearer_send(l_ptr->bearer_id, skb,
880 &l_ptr->media_addr); 880 &l_ptr->media_addr);
881 l_ptr->next_out = skb->next; 881 l_ptr->next_out = skb->next;
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 9155496b8a8a..94db39217248 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -289,7 +289,7 @@ bool tipc_msg_bundle(struct sk_buff *bbuf, struct sk_buff *buf, u32 mtu)
289 return false; 289 return false;
290 if (likely(msg_user(bmsg) != MSG_BUNDLER)) 290 if (likely(msg_user(bmsg) != MSG_BUNDLER))
291 return false; 291 return false;
292 if (likely(msg_type(bmsg) != BUNDLE_OPEN)) 292 if (likely(!TIPC_SKB_CB(bbuf)->bundling))
293 return false; 293 return false;
294 if (unlikely(skb_tailroom(bbuf) < (pad + msz))) 294 if (unlikely(skb_tailroom(bbuf) < (pad + msz)))
295 return false; 295 return false;
@@ -336,11 +336,12 @@ bool tipc_msg_make_bundle(struct sk_buff **buf, u32 mtu, u32 dnode)
336 336
337 skb_trim(bbuf, INT_H_SIZE); 337 skb_trim(bbuf, INT_H_SIZE);
338 bmsg = buf_msg(bbuf); 338 bmsg = buf_msg(bbuf);
339 tipc_msg_init(bmsg, MSG_BUNDLER, BUNDLE_OPEN, INT_H_SIZE, dnode); 339 tipc_msg_init(bmsg, MSG_BUNDLER, 0, INT_H_SIZE, dnode);
340 msg_set_seqno(bmsg, msg_seqno(msg)); 340 msg_set_seqno(bmsg, msg_seqno(msg));
341 msg_set_ack(bmsg, msg_ack(msg)); 341 msg_set_ack(bmsg, msg_ack(msg));
342 msg_set_bcast_ack(bmsg, msg_bcast_ack(msg)); 342 msg_set_bcast_ack(bmsg, msg_bcast_ack(msg));
343 bbuf->next = (*buf)->next; 343 bbuf->next = (*buf)->next;
344 TIPC_SKB_CB(bbuf)->bundling = true;
344 tipc_msg_bundle(bbuf, *buf, mtu); 345 tipc_msg_bundle(bbuf, *buf, mtu);
345 *buf = bbuf; 346 *buf = bbuf;
346 return true; 347 return true;
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index d7d2ba2afe6c..8ca874d6b4dc 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -464,11 +464,6 @@ static inline struct tipc_msg *msg_get_wrapped(struct tipc_msg *m)
464#define FRAGMENT 1 464#define FRAGMENT 1
465#define LAST_FRAGMENT 2 465#define LAST_FRAGMENT 2
466 466
467/* Bundling protocol message types
468 */
469#define BUNDLE_OPEN 0
470#define BUNDLE_CLOSED 1
471
472/* 467/*
473 * Link management protocol message types 468 * Link management protocol message types
474 */ 469 */