Skip to content

Commit

Permalink
tipc: eliminate two pseudo message types of BUNDLE_OPEN and BUNDLE_CL…
Browse files Browse the repository at this point in the history
…OSED

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 <[email protected]>
Reviewed-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ying-xue authored and davem330 committed Nov 26, 2014
1 parent 47b4c9a commit 58311d1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ struct tipc_skb_cb {
struct sk_buff *tail;
bool deferred;
bool wakeup_pending;
bool bundling;
u16 chain_sz;
u16 chain_imp;
};
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ void tipc_link_push_packets(struct tipc_link *l_ptr)
msg_set_ack(msg, mod(l_ptr->next_in_no - 1));
msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in);
if (msg_user(msg) == MSG_BUNDLER)
msg_set_type(msg, BUNDLE_CLOSED);
TIPC_SKB_CB(skb)->bundling = false;
tipc_bearer_send(l_ptr->bearer_id, skb,
&l_ptr->media_addr);
l_ptr->next_out = skb->next;
Expand Down
5 changes: 3 additions & 2 deletions net/tipc/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ bool tipc_msg_bundle(struct sk_buff *bbuf, struct sk_buff *buf, u32 mtu)
return false;
if (likely(msg_user(bmsg) != MSG_BUNDLER))
return false;
if (likely(msg_type(bmsg) != BUNDLE_OPEN))
if (likely(!TIPC_SKB_CB(bbuf)->bundling))
return false;
if (unlikely(skb_tailroom(bbuf) < (pad + msz)))
return false;
Expand Down Expand Up @@ -336,11 +336,12 @@ bool tipc_msg_make_bundle(struct sk_buff **buf, u32 mtu, u32 dnode)

skb_trim(bbuf, INT_H_SIZE);
bmsg = buf_msg(bbuf);
tipc_msg_init(bmsg, MSG_BUNDLER, BUNDLE_OPEN, INT_H_SIZE, dnode);
tipc_msg_init(bmsg, MSG_BUNDLER, 0, INT_H_SIZE, dnode);
msg_set_seqno(bmsg, msg_seqno(msg));
msg_set_ack(bmsg, msg_ack(msg));
msg_set_bcast_ack(bmsg, msg_bcast_ack(msg));
bbuf->next = (*buf)->next;
TIPC_SKB_CB(bbuf)->bundling = true;
tipc_msg_bundle(bbuf, *buf, mtu);
*buf = bbuf;
return true;
Expand Down
5 changes: 0 additions & 5 deletions net/tipc/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,6 @@ static inline struct tipc_msg *msg_get_wrapped(struct tipc_msg *m)
#define FRAGMENT 1
#define LAST_FRAGMENT 2

/* Bundling protocol message types
*/
#define BUNDLE_OPEN 0
#define BUNDLE_CLOSED 1

/*
* Link management protocol message types
*/
Expand Down

0 comments on commit 58311d1

Please sign in to comment.