From: David L Stevens <david.stevens@oracle•com>
To: Raghuram Kothakota <Raghuram.Kothakota@oracle•com>
Cc: David Miller <davem@davemloft•net>, netdev@vger•kernel.org
Subject: Re: [PATCHv6 net-next 1/3] sunvnet: upgrade to VIO protocol version 1.6
Date: Thu, 18 Sep 2014 09:03:52 -0400 [thread overview]
Message-ID: <541AD838.50700@oracle.com> (raw)
In-Reply-To: <2AB76E42-C12D-47C5-8476-0D0C611691A5@oracle.com>
On 09/18/2014 12:09 AM, Raghuram Kothakota wrote:
>> @@ -1048,8 +1116,8 @@ static int vnet_port_alloc_tx_bufs(struct vnet_port *port)
>> void *dring;
>>
>> for (i = 0; i < VNET_TX_RING_SIZE; i++) {
>> - void *buf = kzalloc(ETH_FRAME_LEN + 8, GFP_KERNEL);
>> - int map_len = (ETH_FRAME_LEN + 7) & ~7;
>> + void *buf = kzalloc(VNET_MAXPACKET + 8, GFP_KERNEL);
>
>
> This patch doesn't change the VNET_MAXPACKET to 64k, but the patch 2/3 changes
> it to 64k+. Allocating buffers of size VNET_MAXPACKET always can consume too much
> memory for every port/LDC, that would be more than 32MB. You may want to allocate
> buffers based on the mtu that is negotiated, so that this memory used only when
> such large packets are accepted by the peer.
I originally had code to dynamically allocate them after the MTU negotiation, but
that opens up a can of worms regarding stopping and freeing an active ring. I don't
believe the shutdown code addresses this adequately, either, and I think this is
worth addressing, but separately.
I convinced myself to do it this way because:
a) memory is cheap
b) I think most people will want to use large MTUs for performance; enough so
that perhaps the bring-up MTU should be 64K too
c) future (actually current) TSO/GSO work will want large buffers even if the MTU
is not changed
So, if this is actually too much memory, I was more inclined to reduce the ring
size rather than either add complicating code to handle active-ring reallocation
that would typically be run once per boot, or another alternative of adding
module parameters to specify the buffer size TSO/GSO will need 64K to perform
well, regardless of the device MTU.
+-DLS
next prev parent reply other threads:[~2014-09-18 13:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 0:11 [PATCHv6 net-next 1/3] sunvnet: upgrade to VIO protocol version 1.6 David L Stevens
2014-09-18 4:09 ` Raghuram Kothakota
2014-09-18 13:03 ` David L Stevens [this message]
2014-09-18 18:49 ` Raghuram Kothakota
2014-09-18 19:58 ` David L Stevens
2014-09-22 4:40 ` David L Stevens
2014-09-22 16:40 ` Raghuram Kothakota
2014-09-23 16:24 ` David Miller
2014-09-23 16:49 ` David L Stevens
2014-09-23 18:44 ` David Miller
2014-09-24 14:43 ` David L Stevens
2014-09-18 4:23 ` Raghuram Kothakota
2014-09-18 13:21 ` David L Stevens
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=541AD838.50700@oracle.com \
--to=david.stevens@oracle$(echo .)com \
--cc=Raghuram.Kothakota@oracle$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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