Commit ba501666 authored by David S. Miller's avatar David S. Miller

Merge branch 'tipc_net-next_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

Paul Gortmaker says:

====================
Changes since v1:
	-get rid of essentially unused variable spotted by
	 Neil Horman (patch #2)

	-drop patch #3; defer it for 3.9 content, so Neil,
	 Jon and Ying can discuss its specifics at their
	 leisure while net-next is closed.  (It had no
	 direct dependencies to the rest of the series, and
	 was just an optimization)

	-fix indentation of accept() code directly in place
	 vs. forking it out to a separate function (was patch
	 #10, now patch #9).

Rebuilt and re-ran tests just to ensure nothing odd happened.

Original v1 text follows, updated pull information follows that.

           ---------

Here is another batch of TIPC changes.  The most interesting
thing is probably the non-blocking socket connect - I'm told
there were several users looking forward to seeing this.

Also there were some resource limitation changes that had
the right intent back in 2005, but were now apparently causing
needless limitations to people's real use cases; those have
been relaxed/removed.

There is a lockdep splat fix, but no need for a stable backport,
since it is virtually impossible to trigger in mainline; you
have to essentially modify code to force the probabilities
in your favour to see it.

The rest can largely be categorized as general cleanup of things
seen in the process of getting the above changes done.

Tested between 64 and 32 bit nodes with the test suite.  I've
also compile tested all the individual commits on the chain.

I'd originally figured on this queue not being ready for 3.8, but
the extended stabilization window of 3.7 has changed that.  On
the other hand, this can still be 3.9 material, if that simply
works better for folks - no problem for me to defer it to 2013.
If anyone spots any problems then I'll definitely defer it,
rather than rush a last minute respin.
===================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c772dde3 0fef8f20
...@@ -97,7 +97,6 @@ static int link_send_sections_long(struct tipc_port *sender, ...@@ -97,7 +97,6 @@ static int link_send_sections_long(struct tipc_port *sender,
struct iovec const *msg_sect, struct iovec const *msg_sect,
u32 num_sect, unsigned int total_len, u32 num_sect, unsigned int total_len,
u32 destnode); u32 destnode);
static void link_check_defragm_bufs(struct tipc_link *l_ptr);
static void link_state_event(struct tipc_link *l_ptr, u32 event); static void link_state_event(struct tipc_link *l_ptr, u32 event);
static void link_reset_statistics(struct tipc_link *l_ptr); static void link_reset_statistics(struct tipc_link *l_ptr);
static void link_print(struct tipc_link *l_ptr, const char *str); static void link_print(struct tipc_link *l_ptr, const char *str);
...@@ -271,7 +270,6 @@ static void link_timeout(struct tipc_link *l_ptr) ...@@ -271,7 +270,6 @@ static void link_timeout(struct tipc_link *l_ptr)
} }
/* do all other link processing performed on a periodic basis */ /* do all other link processing performed on a periodic basis */
link_check_defragm_bufs(l_ptr);
link_state_event(l_ptr, TIMEOUT_EVT); link_state_event(l_ptr, TIMEOUT_EVT);
...@@ -2497,16 +2495,6 @@ static void set_expected_frags(struct sk_buff *buf, u32 exp) ...@@ -2497,16 +2495,6 @@ static void set_expected_frags(struct sk_buff *buf, u32 exp)
msg_set_bcast_ack(buf_msg(buf), exp); msg_set_bcast_ack(buf_msg(buf), exp);
} }
static u32 get_timer_cnt(struct sk_buff *buf)
{
return msg_reroute_cnt(buf_msg(buf));
}
static void incr_timer_cnt(struct sk_buff *buf)
{
msg_incr_reroute_cnt(buf_msg(buf));
}
/* /*
* tipc_link_recv_fragment(): Called with node lock on. Returns * tipc_link_recv_fragment(): Called with node lock on. Returns
* the reassembled buffer if message is complete. * the reassembled buffer if message is complete.
...@@ -2585,38 +2573,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, ...@@ -2585,38 +2573,6 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
return 0; return 0;
} }
/**
* link_check_defragm_bufs - flush stale incoming message fragments
* @l_ptr: pointer to link
*/
static void link_check_defragm_bufs(struct tipc_link *l_ptr)
{
struct sk_buff *prev = NULL;
struct sk_buff *next = NULL;
struct sk_buff *buf = l_ptr->defragm_buf;
if (!buf)
return;
if (!link_working_working(l_ptr))
return;
while (buf) {
u32 cnt = get_timer_cnt(buf);
next = buf->next;
if (cnt < 4) {
incr_timer_cnt(buf);
prev = buf;
} else {
if (prev)
prev->next = buf->next;
else
l_ptr->defragm_buf = buf->next;
kfree_skb(buf);
}
buf = next;
}
}
static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance) static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance)
{ {
if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL)) if ((tolerance < TIPC_MIN_LINK_TOL) || (tolerance > TIPC_MAX_LINK_TOL))
......
...@@ -726,7 +726,7 @@ static void port_dispatcher_sigh(void *dummy) ...@@ -726,7 +726,7 @@ static void port_dispatcher_sigh(void *dummy)
if (unlikely(!cb)) if (unlikely(!cb))
goto reject; goto reject;
if (unlikely(!connected)) { if (unlikely(!connected)) {
if (tipc_connect2port(dref, &orig)) if (tipc_connect(dref, &orig))
goto reject; goto reject;
} else if (peer_invalid) } else if (peer_invalid)
goto reject; goto reject;
...@@ -1036,15 +1036,30 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq) ...@@ -1036,15 +1036,30 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
return res; return res;
} }
int tipc_connect2port(u32 ref, struct tipc_portid const *peer) int tipc_connect(u32 ref, struct tipc_portid const *peer)
{ {
struct tipc_port *p_ptr; struct tipc_port *p_ptr;
struct tipc_msg *msg; int res;
int res = -EINVAL;
p_ptr = tipc_port_lock(ref); p_ptr = tipc_port_lock(ref);
if (!p_ptr) if (!p_ptr)
return -EINVAL; return -EINVAL;
res = __tipc_connect(ref, p_ptr, peer);
tipc_port_unlock(p_ptr);
return res;
}
/*
* __tipc_connect - connect to a remote peer
*
* Port must be locked.
*/
int __tipc_connect(u32 ref, struct tipc_port *p_ptr,
struct tipc_portid const *peer)
{
struct tipc_msg *msg;
int res = -EINVAL;
if (p_ptr->published || p_ptr->connected) if (p_ptr->published || p_ptr->connected)
goto exit; goto exit;
if (!peer->ref) if (!peer->ref)
...@@ -1067,17 +1082,16 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer) ...@@ -1067,17 +1082,16 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
(net_ev_handler)port_handle_node_down); (net_ev_handler)port_handle_node_down);
res = 0; res = 0;
exit: exit:
tipc_port_unlock(p_ptr);
p_ptr->max_pkt = tipc_link_get_max_pkt(peer->node, ref); p_ptr->max_pkt = tipc_link_get_max_pkt(peer->node, ref);
return res; return res;
} }
/** /*
* tipc_disconnect_port - disconnect port from peer * __tipc_disconnect - disconnect port from peer
* *
* Port must be locked. * Port must be locked.
*/ */
int tipc_disconnect_port(struct tipc_port *tp_ptr) int __tipc_disconnect(struct tipc_port *tp_ptr)
{ {
int res; int res;
...@@ -1104,7 +1118,7 @@ int tipc_disconnect(u32 ref) ...@@ -1104,7 +1118,7 @@ int tipc_disconnect(u32 ref)
p_ptr = tipc_port_lock(ref); p_ptr = tipc_port_lock(ref);
if (!p_ptr) if (!p_ptr)
return -EINVAL; return -EINVAL;
res = tipc_disconnect_port(p_ptr); res = __tipc_disconnect(p_ptr);
tipc_port_unlock(p_ptr); tipc_port_unlock(p_ptr);
return res; return res;
} }
......
...@@ -190,7 +190,7 @@ int tipc_publish(u32 portref, unsigned int scope, ...@@ -190,7 +190,7 @@ int tipc_publish(u32 portref, unsigned int scope,
int tipc_withdraw(u32 portref, unsigned int scope, int tipc_withdraw(u32 portref, unsigned int scope,
struct tipc_name_seq const *name_seq); struct tipc_name_seq const *name_seq);
int tipc_connect2port(u32 portref, struct tipc_portid const *port); int tipc_connect(u32 portref, struct tipc_portid const *port);
int tipc_disconnect(u32 portref); int tipc_disconnect(u32 portref);
...@@ -200,7 +200,9 @@ int tipc_shutdown(u32 ref); ...@@ -200,7 +200,9 @@ int tipc_shutdown(u32 ref);
/* /*
* The following routines require that the port be locked on entry * The following routines require that the port be locked on entry
*/ */
int tipc_disconnect_port(struct tipc_port *tp_ptr); int __tipc_disconnect(struct tipc_port *tp_ptr);
int __tipc_connect(u32 ref, struct tipc_port *p_ptr,
struct tipc_portid const *peer);
int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg); int tipc_port_peer_msg(struct tipc_port *p_ptr, struct tipc_msg *msg);
/* /*
......
This diff is collapsed.
...@@ -462,7 +462,7 @@ static void subscr_named_msg_event(void *usr_handle, ...@@ -462,7 +462,7 @@ static void subscr_named_msg_event(void *usr_handle,
kfree(subscriber); kfree(subscriber);
return; return;
} }
tipc_connect2port(subscriber->port_ref, orig); tipc_connect(subscriber->port_ref, orig);
/* Lock server port (& save lock address for future use) */ /* Lock server port (& save lock address for future use) */
subscriber->lock = tipc_port_lock(subscriber->port_ref)->lock; subscriber->lock = tipc_port_lock(subscriber->port_ref)->lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment