From: "David S. Miller" <davem@redhat.com>
To: trond.myklebust@fys.uio.no
Cc: kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org
Subject: Re: Fragment flooding in 2.4.x/2.5.x
Date: Sat, 03 Aug 2002 03:17:40 -0700 (PDT) [thread overview]
Message-ID: <20020803.031740.84726417.davem@redhat.com> (raw)
In-Reply-To: <200207011414.50465.trond.myklebust@fys.uio.no>
From: Trond Myklebust <trond.myklebust@fys.uio.no>
Date: Mon, 1 Jul 2002 14:14:50 +0200
I've now got the application and a demonstration of what kind of fix is
needed. I hope you and Dave can work out a better patch in for 2.4.20-pre
;-)...
Trond does this patch fix your problem? It is exactly how Alexey
described the fix and it should work.
I think the memory failure issue is totally moot. In fact your
"accumulate skb till we have them all, then send the whole bunch"
version of the fix is very bad because it defers the transmit
on the device until the whole set of fragments have been created.
--- net/ipv4/ip_output.c.~1~ Sat Aug 3 03:14:35 2002
+++ net/ipv4/ip_output.c Sat Aug 3 03:20:49 2002
@@ -520,8 +520,18 @@
/*
* Get the memory we require with some space left for alignment.
*/
-
- skb = sock_alloc_send_skb(sk, fraglen+hh_len+15, flags&MSG_DONTWAIT, &err);
+ if (!(flags & MSG_DONTWAIT) || nfrags == 0) {
+ skb = sock_alloc_send_skb(sk, fraglen + hh_len + 15,
+ (flags & MSG_DONTWAIT), &err);
+ } else {
+ /* On a non-blocking write, we check for send buffer
+ * usage on the first fragment only.
+ */
+ skb = sock_wmalloc(sk, fraglen + hh_len + 15, 1,
+ sk->allocation);
+ if (!skb)
+ err = -ENOBUFS;
+ }
if (skb == NULL)
goto error;
next prev parent reply other threads:[~2002-08-03 10:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-27 15:57 Fragment flooding in 2.4.x/2.5.x Trond Myklebust
2002-06-27 16:34 ` kuznet
2002-06-27 17:00 ` Trond Myklebust
2002-06-27 20:05 ` kuznet
2002-06-27 20:45 ` Trond Myklebust
2002-06-27 22:07 ` kuznet
2002-06-28 8:22 ` Trond Myklebust
2002-06-28 10:38 ` Trond Myklebust
2002-06-28 18:21 ` Alexey Kuznetsov
2002-07-01 12:14 ` Trond Myklebust
2002-08-03 10:17 ` David S. Miller [this message]
2002-08-05 13:43 ` Trond Myklebust
2002-08-05 14:00 ` Trond Myklebust
2002-08-05 14:54 ` David S. Miller
2002-08-05 23:30 ` kuznet
2002-08-05 23:45 ` Trond Myklebust
2002-08-06 7:53 ` Henning P. Schmiedehausen
2002-08-06 4:43 ` David S. Miller
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=20020803.031740.84726417.davem@redhat.com \
--to=davem@redhat.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/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