[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120921.130440.1881102470665263512.davem@davemloft.net>
Date: Fri, 21 Sep 2012 13:04:40 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: rick.jones2@...com, subramanian.vijay@...il.com,
netdev@...r.kernel.org
Subject: Re: [RFC] tcp: use order-3 pages in tcp_sendmsg()
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Fri, 21 Sep 2012 18:51:21 +0200
> On Fri, 2012-09-21 at 12:27 -0400, David Miller wrote:
>> From: Eric Dumazet <eric.dumazet@...il.com>
>> Date: Fri, 21 Sep 2012 17:48:31 +0200
>>
>> > There is probably a reason why lo default MTU is 16436 ?
>>
>> That's what fit into L1 caches back in 1999
>
> I see ;)
>
> Nowadays, we even have the NETIF_F_NOCACHE_COPY flag and
> __copy_from_user_nocache()
>
> Hmm, we can not toggle this flag on loopback yet
>
> # ethtool -K lo tx-nocache-copy on
> Could not change any device features
It's a silly limitation, in net/core/dev.c:
/* Turn on no cache copy if HW is doing checksum */
if (!(dev->flags & IFF_LOOPBACK)) {
dev->hw_features |= NETIF_F_NOCACHE_COPY;
if (dev->features & NETIF_F_ALL_CSUM) {
dev->wanted_features |= NETIF_F_NOCACHE_COPY;
dev->features |= NETIF_F_NOCACHE_COPY;
}
}
Maybe this is probably better done as:
/* Turn on no cache copy if HW is doing checksum */
dev->hw_features |= NETIF_F_NOCACHE_COPY;
if (!(dev->flags & IFF_LOOPBACK)) {
if (dev->features & NETIF_F_ALL_CSUM) {
dev->wanted_features |= NETIF_F_NOCACHE_COPY;
dev->features |= NETIF_F_NOCACHE_COPY;
}
}
And then the code matches more closely the comment. :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists