netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: <netdev@vger.kernel.org>, Eric Dumazet <eric.dumazet@gmail.com>,
	"David Miller" <davem@davemloft.net>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	Sowmini Varadhan <sowmini.varadhan@oracle.com>,
	Ilan Tayari <ilant@mellanox.com>
Subject: [PATCH RFC ipsec-next 1/2] net: Drop secpath on free after gro merge.
Date: Fri, 27 Jan 2017 08:19:31 +0100	[thread overview]
Message-ID: <1485501572-20908-2-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1485501572-20908-1-git-send-email-steffen.klassert@secunet.com>

With a followup patch, a gro merged skb can have a secpath.
So drop it before freeing or reusing the skb.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/core/dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 56818f7..ef3a969 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4623,6 +4623,7 @@ static gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
 	case GRO_MERGED_FREE:
 		if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD) {
 			skb_dst_drop(skb);
+			secpath_reset(skb);
 			kmem_cache_free(skbuff_head_cache, skb);
 		} else {
 			__kfree_skb(skb);
@@ -4663,6 +4664,7 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
 	skb->encapsulation = 0;
 	skb_shinfo(skb)->gso_type = 0;
 	skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));
+	secpath_reset(skb);
 
 	napi->skb = skb;
 }
-- 
1.9.1

  reply	other threads:[~2017-01-27  7:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27  7:19 [PATCH RFC ipsec-next v2] IPsec GRO Steffen Klassert
2017-01-27  7:19 ` Steffen Klassert [this message]
2017-01-27  7:19 ` [PATCH RFC ipsec-next 2/2] xfrm: Add a dummy network device for napi Steffen Klassert
2017-01-27 14:46   ` Eric Dumazet
2017-01-27 14:53     ` David Miller
2017-01-27 15:25       ` Eric Dumazet
2017-01-27 15:26         ` David Miller
2017-01-30 11:45       ` Steffen Klassert
  -- strict thread matches above, loose matches on Subject: below --
2017-01-26  6:50 [PATCH RFC ipsec-next] IPsec GRO Steffen Klassert
2017-01-26  6:50 ` [PATCH RFC ipsec-next 1/2] net: Drop secpath on free after gro merge Steffen Klassert
2017-01-26  8:52   ` Steffen Klassert

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=1485501572-20908-2-git-send-email-steffen.klassert@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=ilant@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=sowmini.varadhan@oracle.com \
    /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).