Skip to content

Commit

Permalink
tipc: Optimize routing of returned payload messages
Browse files Browse the repository at this point in the history
Reduces the work involved in transmitting a returned payload message
by doing only the work necessary to route such a message directly to
the specified destination port, rather than invoking the code used
to route an arbitrary message to an arbitrary destination.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Jun 24, 2011
1 parent 76d1252 commit 017dac3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/tipc/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
int hdr_sz;
u32 imp = msg_importance(msg);
u32 data_sz = msg_data_sz(msg);
u32 src_node;

if (data_sz > MAX_REJECT_SIZE)
data_sz = MAX_REJECT_SIZE;
Expand Down Expand Up @@ -416,7 +417,11 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)

/* send returned message & dispose of rejected message */

tipc_net_route_msg(rbuf);
src_node = msg_prevnode(msg);
if (src_node == tipc_own_addr)
tipc_port_recv_msg(rbuf);
else
tipc_link_send(rbuf, src_node, msg_link_selector(rmsg));
exit:
buf_discard(buf);
return data_sz;
Expand Down

0 comments on commit 017dac3

Please sign in to comment.