All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: <linux-pci@vger.kernel.org>
Subject: pci_sriov_set_totalvfs question
Date: Tue, 29 Jul 2014 15:04:44 +0100	[thread overview]
Message-ID: <53D7A9FC.3040001@solarflare.com> (raw)

Not sure if this list is the right place to ask, but:
I'm working on fallback code in the sfc driver where in some
configurations the device won't support using VFs, but will still
advertise them as present [1].  This is discovered at PF probe time, and
what I want to do is just set sriov_totalvfs to 0 in this case.

As far as I can tell, pci_sriov_set_totalvfs (drivers/pci/iov.c) is the
function to call, but I'm confused by the comment on that function which
states "Should be called from PF driver's probe routine with device's
mutex held."

Specifically, it's unclear what mutex is meant.  struct pci_dev doesn't
have one; struct pci_sriov /does/ but the struct is only defined in
drivers/pci/pci.h which I don't appear to be able to include from a
driver.  There's also one in the 'struct device dev' member of struct
pci_dev, but that seems rather unlikely.

Also, the wording of the comment makes me wonder if being in the PF
probe routine /implies/ that the mutex is held already, in which case I
don't have to do anything.  This is supported by the only callers,
igb_probe (via igb_sw_init and igb_probe_vfs) and ixgbe_probe, not
appearing to take any mutexes before calling pci_sriov_set_totalvfs.

Please CC on replies, as I'm not subscribed to the list.

Thanks,
-Edward

[1] SFC9120-based NICs support multiple PFs per port and these can be
used as a kind of "poor-man's SR-IOV" (we're calling it 'PF-IOV') by
placing the firmware v-switch below the PFs.  However, this then
precludes adding a v-switch above the PF to direct VF traffic, meaning
that VFs are useless in this configuration.  Consequently, our
configuration tools won't allow VFs and PF-IOV to be enabled
simultaneously, but bugs or corruption could cause this to happen.
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.

             reply	other threads:[~2014-07-29 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 14:04 Edward Cree [this message]
2014-07-29 14:51 ` pci_sriov_set_totalvfs question Alex Williamson
2014-07-30 10:22   ` Edward Cree
2014-07-30  2:48 ` Ethan Zhao

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=53D7A9FC.3040001@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=linux-pci@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.