Skip to content

Commit

Permalink
enic: do not call enic_change_mtu in enic_probe
Browse files Browse the repository at this point in the history
In commit ab123fe ("enic: handle mtu change for vf properly")
ASSERT_RTNL() is added to _enic_change_mtu() to prevent it from being
called without rtnl held. enic_probe() calls enic_change_mtu()
without rtnl held. At this point netdev is not registered yet.
Remove call to enic_change_mtu and assign the mtu to netdev->mtu.

Fixes: ab123fe ("enic: handle mtu change for vf properly")
Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Govindarajulu Varadarajan authored and davem330 committed Jul 31, 2018
1 parent 4672694 commit cb5c656
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/cisco/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2892,7 +2892,6 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
*/

enic->port_mtu = enic->config.mtu;
(void)enic_change_mtu(netdev, enic->port_mtu);

err = enic_set_mac_addr(netdev, enic->mac_addr);
if (err) {
Expand Down Expand Up @@ -2982,6 +2981,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* MTU range: 68 - 9000 */
netdev->min_mtu = ENIC_MIN_MTU;
netdev->max_mtu = ENIC_MAX_MTU;
netdev->mtu = enic->port_mtu;

err = register_netdev(netdev);
if (err) {
Expand Down

0 comments on commit cb5c656

Please sign in to comment.