All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rose, Gregory V" <gregory.v.rose@intel.com>
To: David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bhutchings@solarflare.com" <bhutchings@solarflare.com>,
	"eric.dumazet@gmail.com" <eric.dumazet@gmail.com>
Subject: RE: [RFC V4 PATCH] rtnetlink: Compute and store minimum ifinfo dump size
Date: Wed, 18 May 2011 15:35:58 -0700	[thread overview]
Message-ID: <43F901BD926A4E43B106BF17856F0755018E321C21@orsmsx508.amr.corp.intel.com> (raw)
In-Reply-To: <20110518.180913.273729651812642114.davem@davemloft.net>

> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Wednesday, May 18, 2011 3:09 PM
> To: Rose, Gregory V
> Cc: netdev@vger.kernel.org; bhutchings@solarflare.com;
> eric.dumazet@gmail.com
> Subject: Re: [RFC V4 PATCH] rtnetlink: Compute and store minimum ifinfo
> dump size
> 
> From: Greg Rose <gregory.v.rose@intel.com>
> Date: Wed, 18 May 2011 08:54:11 -0700
> 
> > The message size allocated for rtnl info dumps was limited to a single
> > page.  This is not enough for additional interface info available with
> > devices that support SR-IOV.  Calculate the amount of data required so
> > the dump can allocate enough data to satisfy the request.
> >
> > V2 added the calcit function to the rtnl_register calls so that
> > dump functions could get the minimum dump allocation size if they
> > needed to.
> >
> > V3 leverages the fact that the netdev register function ends up
> > calling if_nlmsg_size.  We collect the minimum dump allocation size
> > there and keep it in a module static variable so that the calcit
> > function doesn't have to search for the device on every info dump.
> >
> > V4 fixes the title.
> >
> > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> 
> This only works if someone does a plain GETLINK request on the largest
> space requiring device before the dump request happens.

It looked to me like rtmsg_ifinfo is called when each device is registered through register_netdevice() and rtmsg_ifinfo in turn calls the if_nlmsg_size function returning the ifinfo dump size for each device.  In my testing it looked like the proper maximum size was being set after I loaded the drivers for the SR-IOV capable devices.

Perhaps I missed something?  Is register_netdevice not always called before a device is used?

- Greg


  reply	other threads:[~2011-05-18 22:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 15:54 [RFC V4 PATCH] rtnetlink: Compute and store minimum ifinfo dump size Greg Rose
2011-05-18 22:09 ` David Miller
2011-05-18 22:35   ` Rose, Gregory V [this message]
2011-05-18 22:47     ` David Miller
2011-05-18 22:49       ` Rose, Gregory V
2011-05-19 15:35         ` 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=43F901BD926A4E43B106BF17856F0755018E321C21@orsmsx508.amr.corp.intel.com \
    --to=gregory.v.rose@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.