From: Jon Maloy <jon.maloy@ericsson.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org,
Paul Gortmaker <paul.gortmaker@windriver.com>,
erik.hugne@ericsson.com, ying.xue@windriver.com,
maloy@donjonn.com, tipc-discussion@lists.sourceforge.net,
Jon Maloy <jon.maloy@ericsson.com>
Subject: [PATCH net-next v2 5/7] tipc: eliminate unnecessary call to broadcast ack function
Date: Fri, 13 Mar 2015 16:08:09 -0400 [thread overview]
Message-ID: <1426277291-2427-6-git-send-email-jon.maloy@ericsson.com> (raw)
In-Reply-To: <1426277291-2427-1-git-send-email-jon.maloy@ericsson.com>
The unicast packet header contains a broadcast acknowledge sequence
number, that may need to be conveyed to the broadcast link for proper
treatment. Currently, the function tipc_rcv(), which is on the most
critical data path, calls the function tipc_bclink_acknowledge() to
have this done. This call is made for each received packet, and results
in the unconditional grabbing of the broadcast link spinlock.
This is unnecessary, since we can see directly from tipc_rcv() if
the acknowledged number differs from what has been previously acked
from the node in question. In the vast majority of cases the numbers
won't differ, and there is nothing to update.
We now make the call to tipc_bclink_acknowledge() conditional
to that the two ack values differ.
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
net/tipc/bcast.c | 4 ++++
net/tipc/link.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 3e41704..5ee5076 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -215,7 +215,11 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked)
struct net *net = n_ptr->net;
struct tipc_net *tn = net_generic(net, tipc_net_id);
+ if (unlikely(!n_ptr->bclink.recv_permitted))
+ return;
+
tipc_bclink_lock(net);
+
/* Bail out if tx queue is empty (no clean up is required) */
skb = skb_peek(&tn->bcl->outqueue);
if (!skb)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 56c39b1..2652c32 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1117,7 +1117,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b_ptr)
ackd = msg_ack(msg);
/* Release acked messages */
- if (likely(n_ptr->bclink.recv_permitted))
+ if (unlikely(n_ptr->bclink.acked != msg_bcast_ack(msg)))
tipc_bclink_acknowledge(n_ptr, msg_bcast_ack(msg));
released = 0;
--
1.9.1
next prev parent reply other threads:[~2015-03-13 20:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 20:08 [PATCH net-next v2 0/7] tipc: some optimizations and impovements Jon Maloy
2015-03-13 20:08 ` [PATCH net-next v2 1/7] tipc: add framework for node capabilities exchange Jon Maloy
2015-03-13 20:08 ` [PATCH net-next v2 2/7] tipc: move message validation function to msg.c Jon Maloy
2015-03-13 20:08 ` [PATCH net-next v2 3/7] tipc: eliminate unnecessary linearization of incoming buffers Jon Maloy
2015-03-13 20:08 ` [PATCH net-next v2 4/7] tipc: extract bundled buffers by cloning instead of copying Jon Maloy
2015-03-13 20:08 ` Jon Maloy [this message]
2015-03-13 20:08 ` [PATCH net-next v2 6/7] tipc: split link outqueue Jon Maloy
2015-03-13 20:08 ` [PATCH net-next v2 7/7] tipc: clean up handling of message priorities Jon Maloy
2015-03-14 18:39 ` [PATCH net-next v2 0/7] tipc: some optimizations and impovements David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426277291-2427-6-git-send-email-jon.maloy@ericsson.com \
--to=jon.maloy@ericsson.com \
--cc=davem@davemloft.net \
--cc=erik.hugne@ericsson.com \
--cc=maloy@donjonn.com \
--cc=netdev@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).