netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ibmvnic: always store valid MAC address
@ 2021-03-04 16:18 Jiri Wiesner
  2021-03-04 22:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Wiesner @ 2021-03-04 16:18 UTC (permalink / raw)
  To: netdev
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Dany Madden, Lijun Pan, Sukadev Bhattiprolu, David S. Miller,
	Jakub Kicinski, Michal Suchanek

The last change to ibmvnic_set_mac(), 8fc3672a8ad3, meant to prevent
users from setting an invalid MAC address on an ibmvnic interface
that has not been brought up yet. The change also prevented the
requested MAC address from being stored by the adapter object for an
ibmvnic interface when the state of the ibmvnic interface is
VNIC_PROBED - that is after probing has finished but before the
ibmvnic interface is brought up. The MAC address stored by the
adapter object is used and sent to the hypervisor for checking when
an ibmvnic interface is brought up.

The ibmvnic driver ignoring the requested MAC address when in
VNIC_PROBED state caused LACP bonds (bonds in 802.3ad mode) with more
than one slave to malfunction. The bonding code must be able to
change the MAC address of its slaves before they are brought up
during enslaving. The inability of kernels with 8fc3672a8ad3 to set
the MAC addresses of bonding slaves is observable in the output of
"ip address show". The MAC addresses of the slaves are the same as
the MAC address of the bond on a working system whereas the slaves
retain their original MAC addresses on a system with a malfunctioning
LACP bond.

Fixes: 8fc3672a8ad3 ("ibmvnic: fix ibmvnic_set_mac")
Signed-off-by: Jiri Wiesner <jwiesner@suse.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 3bad762083c5..b6102ccf9b90 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1906,10 +1906,9 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p)
 	if (!is_valid_ether_addr(addr->sa_data))
 		return -EADDRNOTAVAIL;
 
-	if (adapter->state != VNIC_PROBED) {
-		ether_addr_copy(adapter->mac_addr, addr->sa_data);
+	ether_addr_copy(adapter->mac_addr, addr->sa_data);
+	if (adapter->state != VNIC_PROBED)
 		rc = __ibmvnic_set_mac(netdev, addr->sa_data);
-	}
 
 	return rc;
 }
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ibmvnic: always store valid MAC address
  2021-03-04 16:18 [PATCH net] ibmvnic: always store valid MAC address Jiri Wiesner
@ 2021-03-04 22:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-04 22:40 UTC (permalink / raw)
  To: Jiri Wiesner
  Cc: netdev, mpe, benh, paulus, drt, ljp, sukadev, davem, kuba, msuchanek

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 4 Mar 2021 17:18:28 +0100 you wrote:
> The last change to ibmvnic_set_mac(), 8fc3672a8ad3, meant to prevent
> users from setting an invalid MAC address on an ibmvnic interface
> that has not been brought up yet. The change also prevented the
> requested MAC address from being stored by the adapter object for an
> ibmvnic interface when the state of the ibmvnic interface is
> VNIC_PROBED - that is after probing has finished but before the
> ibmvnic interface is brought up. The MAC address stored by the
> adapter object is used and sent to the hypervisor for checking when
> an ibmvnic interface is brought up.
> 
> [...]

Here is the summary with links:
  - [net] ibmvnic: always store valid MAC address
    https://git.kernel.org/netdev/net/c/67eb211487f0

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-04 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 16:18 [PATCH net] ibmvnic: always store valid MAC address Jiri Wiesner
2021-03-04 22:40 ` patchwork-bot+netdevbpf

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