]> www.infradead.org Git - users/jedix/linux-maple.git/commit
be2net: fix initial MAC setting
authorIvan Vecera <cera@cera.cz>
Tue, 31 Jan 2017 19:01:31 +0000 (20:01 +0100)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 01:05:42 +0000 (20:05 -0500)
commite5678ed5e2ff0b38786598c97292ac1d8a6d9943
treef9bcead29e7f2c3a3db50a55bf25128805072e33
parent08046feba4560c904950e6ad1a7a2c8f908a5100
be2net: fix initial MAC setting

Orabug: 25570957

Recent commit 34393529163a ("be2net: fix MAC addr setting on privileged
BE3 VFs") allows privileged BE3 VFs to set its MAC address during
initialization. Although the initial MAC for such VFs is already
programmed by parent PF the subsequent setting performed by VF is OK,
but in certain cases (after fresh boot) this command in VF can fail.

The MAC should be initialized only when:
1) no MAC is programmed (always except BE3 VFs during first init)
2) programmed MAC is different from requested (e.g. MAC is set when
   interface is down). In this case the initial MAC programmed by PF
   needs to be deleted.

The adapter->dev_mac contains MAC address currently programmed in HW so
it should be zeroed when the MAC is deleted from HW and should not be
filled when MAC is set when interface is down in be_mac_addr_set() as
no programming is performed in this case.

Example of failure without the fix (immediately after fresh boot):

be2net 0000:01:00.0 eth0: Link is Up

...
be2net 0000:01:04.0: Emulex OneConnect(be3): VF  port 0

be2net 0000:01:04.0: opcode 59-1 failed:status 1-76
RTNETLINK answers: Input/output error

iommu: Removing device 0000:01:04.0 from group 33
...

iommu: Removing device 0000:01:04.0 from group 33
...

be2net 0000:01:04.0 eth8: Link is Up

Initialization is now OK.

v2 - Corrected the comment and condition check suggested by Suresh & Harsha

Fixes: 34393529163a ("be2net: fix MAC addr setting on privileged BE3 VFs")
Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
Acked-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4993b39ab04b083ff6ee1147e7e7f120feb6bf7f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/emulex/benet/be_main.c

Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/emulex/benet/be_main.c