lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1329427524.2601.58.camel@bwh-desktop>
Date:	Thu, 16 Feb 2012 21:25:24 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	"Rose, Gregory V" <gregory.v.rose@...el.com>
CC:	netdev <netdev@...r.kernel.org>,
	Shradha Shah <sshah@...arflare.com>
Subject: RE: SR-IOV setup race between PCI and rtnetlink

On Thu, 2012-02-16 at 19:55 +0000, Rose, Gregory V wrote:
[...]
> > However we really need the VFs to be configurable immediately, so that
> > the VF driver can communicate with the PF driver (sfc).  I could add an
> > separate flag to keep the RTNL interface disabled while the inter-driver
> > interface is enabled, but that doesn't seem like the right thing to do.
> > 
> > Perhaps there should be a net device op to return the number of VFs,
> > which the net driver must then only change while holding the RTNL lock?
> > RTNL would then use that instead of dev_num_vf().
> 
> Intel drivers aren't subject to this problem at this time because the
> number of VFs are configured on driver load and don't change until you
> unload the driver and then reload it with a new max_vfs parameter. 

sfc also fixes the number of VFs at driver load, but this race can occur
*during* driver load if the driver calls pci_enable_sriov() after
register_netdevice().

It looks like most other drivers with SR-IOV capability avoid this
problem by calling pci_enable_sriov() before registering the net device.
(cxgb4 is an exception and should also suffer from this.)

The reason for the current ordering in sfc is that we also use VFs for
user-level networking and in that case the VF driver's probe function
needs to identify the corresponding net device.  If the net device isn't
registered until later then we'll have to defer that to a netdevice
notifier.

> However, if/when I get some patches done that allow the user to set
> the number of VFs via ethtool instead of just the module parameter
> that will change and this change would be very helpful in that
> circumstance also.

Wouldn't it make more sense to do that through rtnetlink, along with the
configuration of the individual VFs?

Ben.

> Sounds like a good idea to me.
> 
> - Greg
> 

-- 
Ben Hutchings, Staff 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.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ