public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	sf-linux-drivers <linux-net-drivers@solarflare.com>
Subject: rtnetlink and many VFs
Date: Thu, 21 Apr 2011 15:36:16 +0100	[thread overview]
Message-ID: <1303396576.3165.13.camel@bwh-desktop> (raw)

My colleagues have been working on SR-IOV support for sfc.  The hardware
supports up to 127 VFs per port.

If we configure all 127 VFs through the net device, an RTM_GETLINK dump
will need to include messages describing them, with a total size of:

127 * (sizeof(struct ifla_vf_mac) + sizeof(struct ifla_vf_vlan) +
       sizeof(struct ifla_vf_tx_rate) + protocol overhead)
> 7112

These messages are nested within the message describing the device as a
whole, so they cannot be split.  The maximum size of an outgoing netlink
message, based on NLMSG_GOODSIZE, seems to be min(PAGE_SIZE, 8192).  So
when PAGE_SIZE = 4096 it is simply impossible to dump information about
such a device!

I think it needs to be made possible to grow a netlink skb during
generation of the first message.  Userspace may still be unable to
receive the large message but at least it has a chance.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


             reply	other threads:[~2011-04-21 14:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 14:36 Ben Hutchings [this message]
2011-04-21 17:02 ` rtnetlink and many VFs Rose, Gregory V
2011-04-21 17:40   ` Ben Hutchings
2011-04-21 17:50     ` Rose, Gregory V
2011-04-21 18:11       ` Ben Hutchings
2011-04-21 18:28         ` Rose, Gregory V
2011-04-22 22:29         ` Rose, Gregory V
2011-04-22 22:31           ` David Miller
2011-04-22 22:49             ` Rose, Gregory V

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=1303396576.3165.13.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.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