OpenCloudOS-Kernel/drivers/net/ethernet/cavium/thunder
Pavel Fedin f406ce4234 net: thunderx: Correctly distinguish between VF and LMAC count
Commit bc69fdfc6c
("net: thunderx: Enable BGX LMAC's RX/TX only after VF is up")
introduces lmac_cnt member and starts verifying VF number against it.
This is plain wrong, and works only because currently we have hardcoded
1:1 mapping between VFs and LMACs, and in this case num_vf_en and
lmac_cnt are always equal. However in future this may change, and the
code will badly misbehave. The worst consequence of this is failure to
deliver link status messages, causing VFs to go defunct because since
commit 0b72a9a106 ("net: thunderx: Switchon carrier only upon
interface link up") VF will not fully bring itself up without it.

This patch fixes the potential problem by doing VF number checks against
the num_vf_en. Since lmac_cnt is not used anywhere else, it is removed.

Additionally some duplicated code is factored out into nic_enable_vf()

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-08 22:44:55 -05:00
..
Makefile net: Adding support for Cavium ThunderX network controller 2015-05-27 14:19:44 -04:00
nic.h net: thunderx: Set CQ timer threshold properly 2015-12-02 15:58:50 -05:00
nic_main.c net: thunderx: Correctly distinguish between VF and LMAC count 2015-12-08 22:44:55 -05:00
nic_reg.h net: thunderx: Incorporate pass2 silicon CPI index configuration changes 2015-10-25 18:13:02 -07:00
nicvf_ethtool.c net: thunderx: Switchon carrier only upon interface link up 2015-12-02 15:58:50 -05:00
nicvf_main.c net: thunderx: Switchon carrier only upon interface link up 2015-12-02 15:58:50 -05:00
nicvf_queues.c net: thunderx: Set CQ timer threshold properly 2015-12-02 15:58:50 -05:00
nicvf_queues.h net: thunderx: Set CQ timer threshold properly 2015-12-02 15:58:50 -05:00
q_struct.h net: Adding support for Cavium ThunderX network controller 2015-05-27 14:19:44 -04:00
thunder_bgx.c net: thunderx: Enable BGX LMAC's RX/TX only after VF is up 2015-12-02 15:58:50 -05:00
thunder_bgx.h net: thunderx: Enable BGX LMAC's RX/TX only after VF is up 2015-12-02 15:58:50 -05:00