Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c448b5e7 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'tipc-next'



Jon Maloy says:

====================
tipc: remove some unnecessary complexity

The TIPC code is unnecessarily complex in some places, often because
the conditions or assumptions that were the cause for the complexity
are not valid anymore.

In these three commits, we eliminate some cases of such redundant
complexity.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c5531ca2 ed193ece
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -413,7 +413,7 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno)
	 */
	 */
	if (((seqno - tn->own_addr) % TIPC_MIN_LINK_WIN) == 0) {
	if (((seqno - tn->own_addr) % TIPC_MIN_LINK_WIN) == 0) {
		tipc_link_proto_xmit(node->active_links[node->addr & 1],
		tipc_link_proto_xmit(node->active_links[node->addr & 1],
				     STATE_MSG, 0, 0, 0, 0, 0);
				     STATE_MSG, 0, 0, 0, 0);
		tn->bcl->stats.sent_acks++;
		tn->bcl->stats.sent_acks++;
	}
	}
}
}
@@ -899,7 +899,7 @@ int tipc_bclink_init(struct net *net)
	skb_queue_head_init(&bclink->inputq);
	skb_queue_head_init(&bclink->inputq);
	bcl->owner = &bclink->node;
	bcl->owner = &bclink->node;
	bcl->owner->net = net;
	bcl->owner->net = net;
	bcl->max_pkt = MAX_PKT_DEFAULT_MCAST;
	bcl->mtu = MAX_PKT_DEFAULT_MCAST;
	tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT);
	tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT);
	bcl->bearer_id = MAX_BEARERS;
	bcl->bearer_id = MAX_BEARERS;
	rcu_assign_pointer(tn->bearer_list[MAX_BEARERS], &bcbearer->bearer);
	rcu_assign_pointer(tn->bearer_list[MAX_BEARERS], &bcbearer->bearer);
+114 −229

File changed.

Preview size limit exceeded, changes collapsed.

+14 −15
Original line number Original line Diff line number Diff line
@@ -61,6 +61,7 @@
#define LINK_STARTED     0x0001
#define LINK_STARTED     0x0001
#define LINK_STOPPED     0x0002
#define LINK_STOPPED     0x0002
#define LINK_SYNCHING    0x0004
#define LINK_SYNCHING    0x0004
#define LINK_FAILINGOVER 0x0008


/* Starting value for maximum packet size negotiation on unicast links
/* Starting value for maximum packet size negotiation on unicast links
 * (unless bearer MTU is less)
 * (unless bearer MTU is less)
@@ -122,9 +123,8 @@ struct tipc_stats {
 * @backlog_limit: backlog queue congestion thresholds (indexed by importance)
 * @backlog_limit: backlog queue congestion thresholds (indexed by importance)
 * @exp_msg_count: # of tunnelled messages expected during link changeover
 * @exp_msg_count: # of tunnelled messages expected during link changeover
 * @reset_checkpoint: seq # of last acknowledged message at time of link reset
 * @reset_checkpoint: seq # of last acknowledged message at time of link reset
 * @max_pkt: current maximum packet size for this link
 * @mtu: current maximum packet size for this link
 * @max_pkt_target: desired maximum packet size for this link
 * @advertised_mtu: advertised own mtu when link is being established
 * @max_pkt_probes: # of probes based on current (max_pkt, max_pkt_target)
 * @transmitq: queue for sent, non-acked messages
 * @transmitq: queue for sent, non-acked messages
 * @backlogq: queue for messages waiting to be sent
 * @backlogq: queue for messages waiting to be sent
 * @next_out_no: next sequence number to use for outbound messages
 * @next_out_no: next sequence number to use for outbound messages
@@ -167,16 +167,16 @@ struct tipc_link {
	struct tipc_msg *pmsg;
	struct tipc_msg *pmsg;
	u32 priority;
	u32 priority;
	char net_plane;
	char net_plane;
	u16 synch_point;


	/* Changeover */
	/* Failover */
	u32 exp_msg_count;
	u16 failover_pkts;
	u32 reset_checkpoint;
	u16 failover_checkpt;
	u32 synch_point;
	struct sk_buff *failover_skb;


	/* Max packet negotiation */
	/* Max packet negotiation */
	u32 max_pkt;
	u16 mtu;
	u32 max_pkt_target;
	u16 advertised_mtu;
	u32 max_pkt_probes;


	/* Sending */
	/* Sending */
	struct sk_buff_head transmq;
	struct sk_buff_head transmq;
@@ -201,7 +201,6 @@ struct tipc_link {
	struct sk_buff_head wakeupq;
	struct sk_buff_head wakeupq;


	/* Fragmentation/reassembly */
	/* Fragmentation/reassembly */
	u32 long_msg_seq_no;
	struct sk_buff *reasm_buf;
	struct sk_buff *reasm_buf;


	/* Statistics */
	/* Statistics */
@@ -232,7 +231,7 @@ int tipc_link_xmit(struct net *net, struct sk_buff_head *list, u32 dest,
int __tipc_link_xmit(struct net *net, struct tipc_link *link,
int __tipc_link_xmit(struct net *net, struct tipc_link *link,
		     struct sk_buff_head *list);
		     struct sk_buff_head *list);
void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int prob,
void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int prob,
			  u32 gap, u32 tolerance, u32 priority, u32 acked_mtu);
			  u32 gap, u32 tolerance, u32 priority);
void tipc_link_push_packets(struct tipc_link *l_ptr);
void tipc_link_push_packets(struct tipc_link *l_ptr);
u32 tipc_link_defer_pkt(struct sk_buff_head *list, struct sk_buff *buf);
u32 tipc_link_defer_pkt(struct sk_buff_head *list, struct sk_buff *buf);
void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window);
void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window);
+2 −2
Original line number Original line Diff line number Diff line
@@ -355,7 +355,7 @@ bool tipc_msg_bundle(struct sk_buff *bskb, struct sk_buff *skb, u32 mtu)
	start = align(bsz);
	start = align(bsz);
	pad = start - bsz;
	pad = start - bsz;


	if (unlikely(msg_user(msg) == CHANGEOVER_PROTOCOL))
	if (unlikely(msg_user(msg) == TUNNEL_PROTOCOL))
		return false;
		return false;
	if (unlikely(msg_user(msg) == BCAST_PROTOCOL))
	if (unlikely(msg_user(msg) == BCAST_PROTOCOL))
		return false;
		return false;
@@ -433,7 +433,7 @@ bool tipc_msg_make_bundle(struct sk_buff **skb, u32 mtu, u32 dnode)


	if (msg_user(msg) == MSG_FRAGMENTER)
	if (msg_user(msg) == MSG_FRAGMENTER)
		return false;
		return false;
	if (msg_user(msg) == CHANGEOVER_PROTOCOL)
	if (msg_user(msg) == TUNNEL_PROTOCOL)
		return false;
		return false;
	if (msg_user(msg) == BCAST_PROTOCOL)
	if (msg_user(msg) == BCAST_PROTOCOL)
		return false;
		return false;
+5 −5
Original line number Original line Diff line number Diff line
@@ -72,7 +72,7 @@ struct plist;
#define  MSG_BUNDLER          6
#define  MSG_BUNDLER          6
#define  LINK_PROTOCOL        7
#define  LINK_PROTOCOL        7
#define  CONN_MANAGER         8
#define  CONN_MANAGER         8
#define  CHANGEOVER_PROTOCOL  10
#define  TUNNEL_PROTOCOL      10
#define  NAME_DISTRIBUTOR     11
#define  NAME_DISTRIBUTOR     11
#define  MSG_FRAGMENTER       12
#define  MSG_FRAGMENTER       12
#define  LINK_CONFIG          13
#define  LINK_CONFIG          13
@@ -512,8 +512,8 @@ static inline void msg_set_nameupper(struct tipc_msg *m, u32 n)
/*
/*
 * Changeover tunnel message types
 * Changeover tunnel message types
 */
 */
#define DUPLICATE_MSG		0
#define SYNCH_MSG		0
#define ORIGINAL_MSG		1
#define FAILOVER_MSG		1


/*
/*
 * Config protocol message types
 * Config protocol message types
@@ -556,9 +556,9 @@ static inline void msg_set_node_capabilities(struct tipc_msg *m, u32 n)


static inline bool msg_dup(struct tipc_msg *m)
static inline bool msg_dup(struct tipc_msg *m)
{
{
	if (likely(msg_user(m) != CHANGEOVER_PROTOCOL))
	if (likely(msg_user(m) != TUNNEL_PROTOCOL))
		return false;
		return false;
	if (msg_type(m) != DUPLICATE_MSG)
	if (msg_type(m) != SYNCH_MSG)
		return false;
		return false;
	return true;
	return true;
}
}
Loading