From: Ying Xue <ying.xue@windriver.com>
To: <davem@davemloft.net>
Cc: jon.maloy@ericsson.com, netdev@vger.kernel.org,
Paul.Gortmaker@windriver.com,
tipc-discussion@lists.sourceforge.net
Subject: [PATCH net-next 07/11] tipc: use skb_queue_walk_safe marco to simplify link_prepare_wakeup routine
Date: Wed, 26 Nov 2014 11:41:51 +0800 [thread overview]
Message-ID: <1416973315-6047-8-git-send-email-ying.xue@windriver.com> (raw)
In-Reply-To: <1416973315-6047-1-git-send-email-ying.xue@windriver.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
---
net/tipc/link.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 8eb885e..ddee498 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -367,15 +367,15 @@ static bool link_schedule_user(struct tipc_link *link, u32 oport,
*/
static void link_prepare_wakeup(struct tipc_link *link)
{
- struct sk_buff_head *wq = &link->waiting_sks;
- struct sk_buff *buf;
uint pend_qsz = link->out_queue_size;
+ struct sk_buff *skb, *tmp;
- for (buf = skb_peek(wq); buf; buf = skb_peek(wq)) {
- if (pend_qsz >= link->queue_limit[TIPC_SKB_CB(buf)->chain_imp])
+ skb_queue_walk_safe(&link->waiting_sks, skb, tmp) {
+ if (pend_qsz >= link->queue_limit[TIPC_SKB_CB(skb)->chain_imp])
break;
- pend_qsz += TIPC_SKB_CB(buf)->chain_sz;
- __skb_queue_tail(&link->owner->waiting_sks, __skb_dequeue(wq));
+ pend_qsz += TIPC_SKB_CB(skb)->chain_sz;
+ __skb_unlink(skb, &link->waiting_sks);
+ __skb_queue_tail(&link->owner->waiting_sks, skb);
}
}
--
1.7.9.5
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
next prev parent reply other threads:[~2014-11-26 3:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-26 3:41 [PATCH net-next 00/11] standardize TIPC SKB queue operations Ying Xue
2014-11-26 3:41 ` [PATCH net-next 01/11] tipc: remove node subscription infrastructure Ying Xue
2014-11-26 3:41 ` [PATCH net-next 02/11] tipc: remove protocol message queue Ying Xue
2014-11-26 3:41 ` [PATCH net-next 03/11] tipc: remove retransmission queue Ying Xue
2014-11-26 3:41 ` [PATCH net-next 04/11] tipc: clean up the process of link pushing packets Ying Xue
2014-11-26 3:41 ` [PATCH net-next 05/11] tipc: eliminate two pseudo message types of BUNDLE_OPEN and BUNDLE_CLOSED Ying Xue
2014-11-26 3:41 ` [PATCH net-next 06/11] tipc: remove unused between routine Ying Xue
2014-11-26 3:41 ` Ying Xue [this message]
2014-11-26 3:41 ` [PATCH net-next 08/11] tipc: use generic SKB list APIs to manage link transmission queue Ying Xue
2014-11-26 3:41 ` [PATCH net-next 09/11] tipc: use generic SKB list APIs to manage deferred queue of link Ying Xue
2014-11-26 3:41 ` [PATCH net-next 10/11] tipc: use generic SKB list APIs to manage link receive queue Ying Xue
2014-11-26 3:41 ` [PATCH net-next 11/11] tipc: use generic SKB list APIs to manage TIPC outgoing packet chains Ying Xue
2014-11-26 17:31 ` [PATCH net-next 00/11] standardize TIPC SKB queue operations 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=1416973315-6047-8-git-send-email-ying.xue@windriver.com \
--to=ying.xue@windriver.com \
--cc=Paul.Gortmaker@windriver.com \
--cc=davem@davemloft.net \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
/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).