Commit 9f072238 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by David S. Miller

net: tg3: use skb_list_walk_safe helper for gso segments

This is a straight-forward conversion case for the new function, and
while we're at it, we can remove a null write to skb->next by replacing
it with skb_mark_not_on_list.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d7a7438
...@@ -7874,8 +7874,8 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *); ...@@ -7874,8 +7874,8 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);
static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi, static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
struct netdev_queue *txq, struct sk_buff *skb) struct netdev_queue *txq, struct sk_buff *skb)
{ {
struct sk_buff *segs, *nskb;
u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3; u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3;
struct sk_buff *segs, *seg, *next;
/* Estimate the number of fragments in the worst case */ /* Estimate the number of fragments in the worst case */
if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) { if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {
...@@ -7898,12 +7898,10 @@ static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi, ...@@ -7898,12 +7898,10 @@ static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
if (IS_ERR(segs) || !segs) if (IS_ERR(segs) || !segs)
goto tg3_tso_bug_end; goto tg3_tso_bug_end;
do { skb_list_walk_safe(segs, seg, next) {
nskb = segs; skb_mark_not_on_list(seg);
segs = segs->next; tg3_start_xmit(seg, tp->dev);
nskb->next = NULL; }
tg3_start_xmit(nskb, tp->dev);
} while (segs);
tg3_tso_bug_end: tg3_tso_bug_end:
dev_consume_skb_any(skb); dev_consume_skb_any(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment