diff options
author | David S. Miller <davem@davemloft.net> | 2018-07-29 23:42:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-10 13:06:54 -0400 |
commit | a8305bff685252e80b7c60f4f5e7dd2e63e38218 (patch) | |
tree | 3f8f073a642ad27c0921917e3b9e1622b9956478 /net/core/dev.c | |
parent | 776f07ee303a5e13970cbfaed767e28cbab4002f (diff) |
net: Add and use skb_mark_not_on_list().
An SKB is not on a list if skb->next is NULL.
Codify this convention into a helper function and use it
where we are dequeueing an SKB and need to mark it as such.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ca78dc5a79a3..f76dd7e14dd6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -3231,7 +3231,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *first, struct net_device *de | |||
3231 | while (skb) { | 3231 | while (skb) { |
3232 | struct sk_buff *next = skb->next; | 3232 | struct sk_buff *next = skb->next; |
3233 | 3233 | ||
3234 | skb->next = NULL; | 3234 | skb_mark_not_on_list(skb); |
3235 | rc = xmit_one(skb, dev, txq, next != NULL); | 3235 | rc = xmit_one(skb, dev, txq, next != NULL); |
3236 | if (unlikely(!dev_xmit_complete(rc))) { | 3236 | if (unlikely(!dev_xmit_complete(rc))) { |
3237 | skb->next = next; | 3237 | skb->next = next; |
@@ -3331,7 +3331,7 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d | |||
3331 | 3331 | ||
3332 | for (; skb != NULL; skb = next) { | 3332 | for (; skb != NULL; skb = next) { |
3333 | next = skb->next; | 3333 | next = skb->next; |
3334 | skb->next = NULL; | 3334 | skb_mark_not_on_list(skb); |
3335 | 3335 | ||
3336 | /* in case skb wont be segmented, point to itself */ | 3336 | /* in case skb wont be segmented, point to itself */ |
3337 | skb->prev = skb; | 3337 | skb->prev = skb; |
@@ -5296,7 +5296,7 @@ static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index, | |||
5296 | if (flush_old && NAPI_GRO_CB(skb)->age == jiffies) | 5296 | if (flush_old && NAPI_GRO_CB(skb)->age == jiffies) |
5297 | return; | 5297 | return; |
5298 | list_del(&skb->list); | 5298 | list_del(&skb->list); |
5299 | skb->next = NULL; | 5299 | skb_mark_not_on_list(skb); |
5300 | napi_gro_complete(skb); | 5300 | napi_gro_complete(skb); |
5301 | napi->gro_hash[index].count--; | 5301 | napi->gro_hash[index].count--; |
5302 | } | 5302 | } |
@@ -5482,7 +5482,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff | |||
5482 | 5482 | ||
5483 | if (pp) { | 5483 | if (pp) { |
5484 | list_del(&pp->list); | 5484 | list_del(&pp->list); |
5485 | pp->next = NULL; | 5485 | skb_mark_not_on_list(pp); |
5486 | napi_gro_complete(pp); | 5486 | napi_gro_complete(pp); |
5487 | napi->gro_hash[hash].count--; | 5487 | napi->gro_hash[hash].count--; |
5488 | } | 5488 | } |