Skip to content

Commit 6750c87

Browse files
Manish Chopradavem330
authored andcommitted
qlge: Fix netdev features configuration.
qlge_fix_features() is not supposed to modify hardware or driver state, rather it is supposed to only fix requested fetures bits. Currently qlge_fix_features() also goes for interface down and up unnecessarily if there is not even any change in features set. This patch changes/fixes following - 1) Move reload of interface or device re-config from qlge_fix_features() to qlge_set_features(). 2) Reload of interface in qlge_set_features() only if relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed. 3) Get rid of qlge_fix_features() since driver is not really required to fix any features bit. Signed-off-by: Manish <[email protected]> Reviewed-by: Benjamin Poirier <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0da70f8 commit 6750c87

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

drivers/net/ethernet/qlogic/qlge/qlge_main.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,26 +2384,20 @@ static int qlge_update_hw_vlan_features(struct net_device *ndev,
23842384
return status;
23852385
}
23862386

2387-
static netdev_features_t qlge_fix_features(struct net_device *ndev,
2388-
netdev_features_t features)
2389-
{
2390-
int err;
2391-
2392-
/* Update the behavior of vlan accel in the adapter */
2393-
err = qlge_update_hw_vlan_features(ndev, features);
2394-
if (err)
2395-
return err;
2396-
2397-
return features;
2398-
}
2399-
24002387
static int qlge_set_features(struct net_device *ndev,
24012388
netdev_features_t features)
24022389
{
24032390
netdev_features_t changed = ndev->features ^ features;
2391+
int err;
2392+
2393+
if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
2394+
/* Update the behavior of vlan accel in the adapter */
2395+
err = qlge_update_hw_vlan_features(ndev, features);
2396+
if (err)
2397+
return err;
24042398

2405-
if (changed & NETIF_F_HW_VLAN_CTAG_RX)
24062399
qlge_vlan_mode(ndev, features);
2400+
}
24072401

24082402
return 0;
24092403
}
@@ -4719,7 +4713,6 @@ static const struct net_device_ops qlge_netdev_ops = {
47194713
.ndo_set_mac_address = qlge_set_mac_address,
47204714
.ndo_validate_addr = eth_validate_addr,
47214715
.ndo_tx_timeout = qlge_tx_timeout,
4722-
.ndo_fix_features = qlge_fix_features,
47234716
.ndo_set_features = qlge_set_features,
47244717
.ndo_vlan_rx_add_vid = qlge_vlan_rx_add_vid,
47254718
.ndo_vlan_rx_kill_vid = qlge_vlan_rx_kill_vid,

0 commit comments

Comments
 (0)