]> git.baikalelectronics.ru Git - kernel.git/commit
cxgb4: Fix issue while re-registering VF mgmt netdev
authorHariprasad Shenai <hariprasad@chelsio.com>
Tue, 23 Aug 2016 06:05:32 +0000 (11:35 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Aug 2016 00:07:08 +0000 (17:07 -0700)
commit5a75949f4e44f0eae39685affb4163fbfd865240
tree8d0bb64a559d51f41457ca4d04dda8c32a6a7ade
parentb13537707fdeb11c5d5b360e417aca322cdc10fa
cxgb4: Fix issue while re-registering VF mgmt netdev

When we disable SRIOV, we used to unregister the netdev but wasn't
freed. But next time when the same netdev is registered, since the state
was in 'NETREG_UNREGISTERED', we used to hit BUG_ON in register_netdevice,
where it expects the state to be 'NETREG_UNINITIALIZED'.

Alloc netdev and register them while configuring SRIOV, and free them
when SRIOV is disabled. Also added a new function to setup ethernet
properties instead of using ether_setup. Set carrier off by default,
since we don't have to do any transmit on the interface.

Fixes: 52394974c2aa ("cxgb4: Add control net_device for configuring PCIe VF")
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c