netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: davem@davemloft.net, johannes@sipsolutions.net, netdev@vger.kernel.org
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: [PATCH net-next 5/8] net: sched: use skb_list_walk_safe helper for gso segments
Date: Mon, 13 Jan 2020 18:42:30 -0500	[thread overview]
Message-ID: <20200113234233.33886-6-Jason@zx2c4.com> (raw)
In-Reply-To: <20200113234233.33886-1-Jason@zx2c4.com>

This is a straight-forward conversion case for the new function, keeping
the flow of the existing code as intact as possible.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 net/sched/sch_cake.c | 4 +---
 net/sched/sch_tbf.c  | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 90ef7cc79b69..1496e87cd07b 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1682,8 +1682,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 		if (IS_ERR_OR_NULL(segs))
 			return qdisc_drop(skb, sch, to_free);
 
-		while (segs) {
-			nskb = segs->next;
+		skb_list_walk_safe(segs, segs, nskb) {
 			skb_mark_not_on_list(segs);
 			qdisc_skb_cb(segs)->pkt_len = segs->len;
 			cobalt_set_enqueue_time(segs, now);
@@ -1696,7 +1695,6 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 			slen += segs->len;
 			q->buffer_used += segs->truesize;
 			b->packets++;
-			segs = nskb;
 		}
 
 		/* stats */
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 5f72f3f916a5..2cd94973795c 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -155,8 +155,7 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch,
 		return qdisc_drop(skb, sch, to_free);
 
 	nb = 0;
-	while (segs) {
-		nskb = segs->next;
+	skb_list_walk_safe(segs, segs, nskb) {
 		skb_mark_not_on_list(segs);
 		qdisc_skb_cb(segs)->pkt_len = segs->len;
 		len += segs->len;
@@ -167,7 +166,6 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch,
 		} else {
 			nb++;
 		}
-		segs = nskb;
 	}
 	sch->q.qlen += nb;
 	if (nb > 1)
-- 
2.24.1


  parent reply	other threads:[~2020-01-13 23:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 23:42 [PATCH net-next 0/8] skb_list_walk_safe refactoring for net/*'s skb_gso_segment usage Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 1/8] net: skbuff: disambiguate argument and member for skb_list_walk_safe helper Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 2/8] net: udp: use skb_list_walk_safe helper for gso segments Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 3/8] net: xfrm: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 4/8] net: openvswitch: " Jason A. Donenfeld
2020-01-13 23:42 ` Jason A. Donenfeld [this message]
2020-01-13 23:42 ` [PATCH net-next 6/8] net: ipv4: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 7/8] net: netfilter: " Jason A. Donenfeld
2020-01-13 23:42 ` [PATCH net-next 8/8] net: mac80211: " Jason A. Donenfeld
2020-01-14 19:49 ` [PATCH net-next 0/8] skb_list_walk_safe refactoring for net/*'s skb_gso_segment usage 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=20200113234233.33886-6-Jason@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    /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).