netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Jonathan Cooper <jonathan.s.cooper@amd.com>,
	netdev@vger.kernel.org, linux-net-drivers@amd.com
Cc: "Martin Habets" <habetsm.xilinx@gmail.com>,
	"Íñigo Huguet" <ihuguet@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH net] sfc: Change VF mac via PF as first preference if available.
Date: Thu, 13 Oct 2022 11:09:56 +0100	[thread overview]
Message-ID: <5631204c-546f-c45d-9e6f-330c3cddf275@gmail.com> (raw)
In-Reply-To: <20221013095553.52957-1-jonathan.s.cooper@amd.com>

On 13/10/2022 10:55, Jonathan Cooper wrote:
> Changing a VF's mac address through the VF (rather than via the PF)
> fails with EPERM because the latter part of efx_ef10_set_mac_address
> attempts to change the vport mac address list as the VF.
> Even with this fixed it still fails with EBUSY because the vadaptor
> is still assigned on the VF - the vadaptor reassignment must be within
> a section where the VF has torn down its state.
> 
> A major reason this has broken is because we have two functions that
> ostensibly do the same thing - have a PF and VF cooperate to change a
> VF mac address. Rather than do this, if we are changing the mac of a VF
> that has a link to the PF in the same VM then simply call
> sriov_set_vf_mac instead, which is a proven working function that does
> that.
> 
> If there is no PF available, or that fails non-fatally, then attempt to
> change the VF's mac address as we would a PF, without updating the PF's
> data.
> 
> Test case:
> Create a VF:
>   echo 1 > /sys/class/net/<if>/device/sriov_numvfs
> Set the mac address of the VF directly:
>   ip link set <vf> addr 00:11:22:33:44:55
> Set the MAC address of the VF via the PF:
>   ip link set <pf> vf 0 mac 00:11:22:33:44:66
> Without this patch the last command will fail with ENOENT.
> 
> Signed-off-by: Jonathan Cooper <jonathan.s.cooper@amd.com>
> Reported-by: Íñigo Huguet <ihuguet@redhat.com>
> Fixes: 910c8789a777 ("set the MAC address using MC_CMD_VADAPTOR_SET_MAC")

Acked-by: Edward Cree <ecree.xilinx@gmail.com>

  reply	other threads:[~2022-10-13 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  9:55 [PATCH net] sfc: Change VF mac via PF as first preference if available Jonathan Cooper
2022-10-13 10:09 ` Edward Cree [this message]
2022-10-15 10:10 ` patchwork-bot+netdevbpf

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=5631204c-546f-c45d-9e6f-330c3cddf275@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=davem@davemloft.net \
    --cc=habetsm.xilinx@gmail.com \
    --cc=ihuguet@redhat.com \
    --cc=jonathan.s.cooper@amd.com \
    --cc=linux-net-drivers@amd.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;
as well as URLs for NNTP newsgroup(s).