[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <eab96d92e08f63de5a2321571781faf2343802eb.camel@amazon.com>
Date: Mon, 31 Jul 2023 23:03:19 +0000
From: "Erdogan, Tahsin" <trdgn@...zon.com>
To: "kuba@...nel.org" <kuba@...nel.org>
CC: "herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
"edumazet@...gle.com" <edumazet@...gle.com>, "davem@...emloft.net"
<davem@...emloft.net>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tun: avoid high-order page allocation for packet header
Thanks Jakub for considering this patch.
On Mon, 2023-07-31 at 13:58 -0700, Jakub Kicinski wrote:
> On Tue, 25 Jul 2023 20:09:36 -0700 Tahsin Erdogan wrote:
> > @@ -1838,6 +1838,9 @@ static ssize_t tun_get_user(struct tun_struct
> > *tun, struct tun_file *tfile,
> > */
> > zerocopy = false;
> > } else {
> > + if (linear == 0)
> > + linear = min_t(size_t, good_linear,
> > copylen);
>
> nit: would you mind changing to !linear instead of linear == 0 ?
Yes, I will fix this in v2.
> Also - I don't see linear explicitly getting set to 0. What
> guarantees
> that? What's the story there?
linear is set to 0 in the earlier if block. When gso.hdr_len is 0,
linear also becomes 0:
if (!zerocopy) {
copylen = len;
if (tun16_to_cpu(tun, gso.hdr_len) > good_linear)
linear = good_linear;
else
linear = tun16_to_cpu(tun, gso.hdr_len);
}
Powered by blists - more mailing lists