Skip to content

Commit

Permalink
net: openvswitch: use skb_list_walk_safe helper for gso segments
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jason A. Donenfeld authored and David S. Miller committed Jan 14, 2020
1 parent c3b18e0 commit 2cec444
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions net/openvswitch/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,26 +321,23 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
}

/* Queue all of the segments. */
skb = segs;
do {
skb_list_walk_safe(segs, skb, nskb) {
if (gso_type & SKB_GSO_UDP && skb != segs)
key = &later_key;

err = queue_userspace_packet(dp, skb, key, upcall_info, cutlen);
if (err)
break;

} while ((skb = skb->next));
}

/* Free all of the segments. */
skb = segs;
do {
nskb = skb->next;
skb_list_walk_safe(segs, skb, nskb) {
if (err)
kfree_skb(skb);
else
consume_skb(skb);
} while ((skb = nskb));
}
return err;
}

Expand Down

0 comments on commit 2cec444

Please sign in to comment.