aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-11-02 15:08:44 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-02-24 17:05:14 -0500
commitc74a46110fd5f97bf9299e68e9ed0453bdacb181 (patch)
tree911b806bdedf7e5e876ac9a09dbaf80f044957ac /net/tipc/link.c
parent97878a405c0ffe0f6433e1fb51834d4619ece025 (diff)
tipc: Remove duplicate check of message destination node
Eliminates a check in the processing of TIPC messages arriving from off node that ensures the message is destined for this node, since this check duplicates an earlier check. (The check would be necessary if TIPC needed to be able to route incoming messages to another node, but the elimination of multi-cluster support means that this never happens and all incoming messages are consumed by the receiving node.) Note: This change involves the elimination of a single "if" statement with a large "then" clause; consequently, a significant number of lines end up getting re-indented. In addition, a simple message header access routine that is no longer referenced is eliminated. However, the only functional change is the elimination of the single check described above. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c93
1 files changed, 46 insertions, 47 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index d8b0a22367b6..6cc78a970126 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1773,57 +1773,56 @@ protocol_check:
1773 if (unlikely(l_ptr->oldest_deferred_in)) 1773 if (unlikely(l_ptr->oldest_deferred_in))
1774 head = link_insert_deferred_queue(l_ptr, 1774 head = link_insert_deferred_queue(l_ptr,
1775 head); 1775 head);
1776 if (likely(msg_is_dest(msg, tipc_own_addr))) {
1777 int ret;
1778deliver: 1776deliver:
1779 if (likely(msg_isdata(msg))) { 1777 if (likely(msg_isdata(msg))) {
1780 tipc_node_unlock(n_ptr); 1778 tipc_node_unlock(n_ptr);
1781 tipc_port_recv_msg(buf); 1779 tipc_port_recv_msg(buf);
1782 continue; 1780 continue;
1781 }
1782 switch (msg_user(msg)) {
1783 int ret;
1784 case MSG_BUNDLER:
1785 l_ptr->stats.recv_bundles++;
1786 l_ptr->stats.recv_bundled +=
1787 msg_msgcnt(msg);
1788 tipc_node_unlock(n_ptr);
1789 tipc_link_recv_bundle(buf);
1790 continue;
1791 case NAME_DISTRIBUTOR:
1792 tipc_node_unlock(n_ptr);
1793 tipc_named_recv(buf);
1794 continue;
1795 case CONN_MANAGER:
1796 tipc_node_unlock(n_ptr);
1797 tipc_port_recv_proto_msg(buf);
1798 continue;
1799 case MSG_FRAGMENTER:
1800 l_ptr->stats.recv_fragments++;
1801 ret = tipc_link_recv_fragment(
1802 &l_ptr->defragm_buf,
1803 &buf, &msg);
1804 if (ret == 1) {
1805 l_ptr->stats.recv_fragmented++;
1806 goto deliver;
1783 } 1807 }
1784 switch (msg_user(msg)) { 1808 if (ret == -1)
1785 case MSG_BUNDLER: 1809 l_ptr->next_in_no--;
1786 l_ptr->stats.recv_bundles++; 1810 break;
1787 l_ptr->stats.recv_bundled += 1811 case CHANGEOVER_PROTOCOL:
1788 msg_msgcnt(msg); 1812 type = msg_type(msg);
1789 tipc_node_unlock(n_ptr); 1813 if (link_recv_changeover_msg(&l_ptr,
1790 tipc_link_recv_bundle(buf); 1814 &buf)) {
1791 continue; 1815 msg = buf_msg(buf);
1792 case NAME_DISTRIBUTOR: 1816 seq_no = msg_seqno(msg);
1793 tipc_node_unlock(n_ptr); 1817 if (type == ORIGINAL_MSG)
1794 tipc_named_recv(buf);
1795 continue;
1796 case CONN_MANAGER:
1797 tipc_node_unlock(n_ptr);
1798 tipc_port_recv_proto_msg(buf);
1799 continue;
1800 case MSG_FRAGMENTER:
1801 l_ptr->stats.recv_fragments++;
1802 ret = tipc_link_recv_fragment(
1803 &l_ptr->defragm_buf,
1804 &buf, &msg);
1805 if (ret == 1) {
1806 l_ptr->stats.recv_fragmented++;
1807 goto deliver; 1818 goto deliver;
1808 } 1819 goto protocol_check;
1809 if (ret == -1)
1810 l_ptr->next_in_no--;
1811 break;
1812 case CHANGEOVER_PROTOCOL:
1813 type = msg_type(msg);
1814 if (link_recv_changeover_msg(&l_ptr, &buf)) {
1815 msg = buf_msg(buf);
1816 seq_no = msg_seqno(msg);
1817 if (type == ORIGINAL_MSG)
1818 goto deliver;
1819 goto protocol_check;
1820 }
1821 break;
1822 default:
1823 buf_discard(buf);
1824 buf = NULL;
1825 break;
1826 } 1820 }
1821 break;
1822 default:
1823 buf_discard(buf);
1824 buf = NULL;
1825 break;
1827 } 1826 }
1828 tipc_node_unlock(n_ptr); 1827 tipc_node_unlock(n_ptr);
1829 tipc_net_route_msg(buf); 1828 tipc_net_route_msg(buf);