Thread (17 messages) 17 messages, 2 authors, 2016-02-25

Re: [PATCH net-next 01/10] bnxt_en: Improve bnxt_vf_update_mac().

flat view

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-02-25 16:57:03

On Thu, Feb 25, 2016 at 8:31 AM, David Miller [off-list ref] wrote:
From: Michael Chan <michael.chan@broadcom.com>
Date: Thu, 25 Feb 2016 03:19:25 -0500
quoted
From: Jeffrey Huang <redacted>

Allow the VF to setup its own MAC address if the PF has not administratively
set it for the VF.  If the perm_mac_address returned by firmware is all
zeros, that means the PF has not set up the MAC address for the VF and
we should store it.  This will allow the VF to change the MAC address using
ndo_set_mac_address() when it sees that the stored permanent MAC address
is all zeros.

Signed-off-by: Jeffrey Huang <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
What triggers that ->ndo_set_mac_address() call in the VF?
ip link set eth0 address ...

done on the VF.
You cannot register an ethernet netdev with an invalid ethernet address,
you must use a random one if you don't have a valid one available.
We are not registering an invalid MAC address.  We are just storing it in the
driver's VF data structure.  There are 2 cases:

1. VF comes up and the MAC address from firmware is 0.  The VF will
generate random MAC.  The stored MAC address in the VF datastructure is
0 so that ip set link eth0 address is allowed on the VF.

2. PF sets the MAC address for the VF using ip link set eth0 vf mac ....
The firmware will now provide the PF administered MAC address to the
VF and random MAC is no longer generated.  This valid MAC is now
stored and ip link set eth0 address ... on the VF is no longer allowed.

This patch is to make case 2 work properly.  I will change the commit
message to make it more clear and I will fix the parameter formatting
in the other patch.  Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help