ionic: VF initial random MAC address if no assigned mac
authorR Mohamed Shah <mohamed@pensando.io>
Wed, 24 Aug 2022 16:50:51 +0000 (09:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:45 +0000 (17:16 +0200)
commit48f4d54ccc4d249e936e2d82bc8d37e3662abc9f
treee7ae80f448bf87a4f9393700699ea59703e2a1e2
parentbcbf1d959933fda1042625fe46129ca0d494c858
ionic: VF initial random MAC address if no assigned mac

[ Upstream commit 19058be7c48ceb3e60fa3948e24da1059bd68ee4 ]

Assign a random mac address to the VF interface station
address if it boots with a zero mac address in order to match
similar behavior seen in other VF drivers.  Handle the errors
where the older firmware does not allow the VF to set its own
station address.

Newer firmware will allow the VF to set the station mac address
if it hasn't already been set administratively through the PF.
Setting it will also be allowed if the VF has trust.

Fixes: fbb39807e9ae ("ionic: support sr-iov operations")
Signed-off-by: R Mohamed Shah <mohamed@pensando.io>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c