netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: [PATCH RFC] xfrm: Don't queue retransmitted packets if the original is still on the host
Date: Wed, 16 Oct 2013 13:42:47 +0200	[thread overview]
Message-ID: <20131016114246.GB7660@secunet.com> (raw)
In-Reply-To: <20131016094549.GZ7660@secunet.com>

It does not make sense to queue retransmitted packets if the
original packet is still in some queue of this host. So add
a check to xdst_queue_output() and drop the packet if the
original packet is not yet sent.

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

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index ed38d5d..e09edfc 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1832,6 +1832,13 @@ static int xdst_queue_output(struct sk_buff *skb)
 	struct dst_entry *dst = skb_dst(skb);
 	struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
 	struct xfrm_policy_queue *pq = &xdst->pols[0]->polq;
+	const struct sk_buff *fclone = skb + 1;
+
+	if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
+		     fclone->fclone == SKB_FCLONE_CLONE)) {
+		kfree_skb(skb);
+		return 0;
+	}
 
 	if (pq->hold_queue.qlen > XFRM_MAX_QUEUE_LEN) {
 		kfree_skb(skb);
-- 
1.7.9.5

  reply	other threads:[~2013-10-16 11:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10  6:33 [PATCH RFC 0/2] xfrm: Remove ancient sleeping code Steffen Klassert
2013-10-10  6:33 ` [PATCH RFC 1/2] xfrm: Remove ancient sleeping when the SA is in acquire state Steffen Klassert
2013-10-10  6:34 ` [PATCH RFC 2/2] net: Remove FLOWI_FLAG_CAN_SLEEP Steffen Klassert
2013-10-10  7:02 ` [PATCH RFC 0/2] xfrm: Remove ancient sleeping code Fan Du
2013-10-10  8:57   ` Steffen Klassert
2013-10-11  7:18     ` Fan Du
2013-10-11  9:21       ` Steffen Klassert
2013-10-11 19:01 ` David Miller
2013-10-15  7:30   ` Steffen Klassert
2013-10-15 23:14     ` David Miller
2013-10-15 23:58     ` Eric Dumazet
2013-10-16  9:45       ` Steffen Klassert
2013-10-16 11:42         ` Steffen Klassert [this message]
2013-10-18 20:19           ` [PATCH RFC] xfrm: Don't queue retransmitted packets if the original is still on the host David Miller
2013-10-18 20:23             ` Eric Dumazet
2013-10-18 20:34               ` David Miller
2013-10-21 14:51                 ` 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=20131016114246.GB7660@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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).