All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keller, Jacob E <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v1 2/2] fm10k: don't re-map queues when a mailbox message suffices
Date: Mon, 8 Aug 2016 23:58:19 +0000	[thread overview]
Message-ID: <1470700698.30641.4.camel@intel.com> (raw)
In-Reply-To: <20160803220528.26222-2-jacob.e.keller@intel.com>

On Wed, 2016-08-03 at 15:05 -0700, Jacob Keller wrote:
> When the PF assigns a new MAC Address to a VF, it uses a little
> register
> trick to allow a later load of VF driver access to the MAC Address at
> start without having to wait for a mailbox message. Unfortunately, to
> do
> this the PF must assign ownership of the Queues and take it away from
> the VF, otherwise writing these registers would be unsafe when the VF
> driver is active.
> 
> This causes a potential race where a VF could try to access its
> queues
> while they are owned by the PF. The fault detection code will prevent
> this and issue a FUM fault error when the VF does this.
> 
> We can do better, by simply avoiding the register trick when it's not
> necessary. We already have a mailbox message which indicates the new
> MAC/VLAN pair. The PF currently attempts to send this message and
> ignores failures which happen in the case where VF driver is not
> loaded.
> 
> Fix this logic so that we always send the mailbox message first, then
> if
> the mailbox errors due to no connected VF driver, we will fall back
> to
> the register routine. This prevents using the pre-load method of
> writing
> registers when we have an active VF driver, and thus prevents the
> need
> to take queue ownership back. The whole logic is cleaner and avoids
> the
> messy register interactions that could occur.
> 
> We still keep the register flow so that the PF can ensure a new
> driver
> load will have the MAC Address at start without having to wait for
> the
> PF to send a new mailbox message.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

This patch should not be sent, it has a bug we discovered in testing. I
have a re-worked patch that I will submit shortly.

Thanks,
Jake

  reply	other threads:[~2016-08-08 23:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03 22:05 [Intel-wired-lan] [PATCH v1 1/2] fm10k: don't clear the RXQCTL register when enabling or disabling queues Jacob Keller
2016-08-03 22:05 ` [Intel-wired-lan] [PATCH v1 2/2] fm10k: don't re-map queues when a mailbox message suffices Jacob Keller
2016-08-08 23:58   ` Keller, Jacob E [this message]
2016-08-22 22:47 ` [Intel-wired-lan] [PATCH v1 1/2] fm10k: don't clear the RXQCTL register when enabling or disabling queues Singh, Krishneil K

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=1470700698.30641.4.camel@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=intel-wired-lan@osuosl.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.