From: Chiqijun chiqijun@huawei.com
driver inclusion category: bugfix bugzilla: 4472
-----------------------------------------------------------------------
In the x86 system, the hinic device turns off LRO by default, and the LRO state will not be set when the driver is loaded. If the LRO of the chip is turned on before the driver is loaded, it will cause the chip to still turn on LRO after reloading the driver, but the LRO that the user sees is turned off. Therefore, the driver is forced to set the default features of the device when probe.
Signed-off-by: Chiqijun chiqijun@huawei.com Reviewed-by: Wangxiaoyun cloud.wangxiaoyun@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/huawei/hinic/hinic_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c index cf7b6ceef060..26cd2929f60a 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -1491,7 +1491,7 @@ static int set_feature_lro(struct hinic_nic_dev *nic_dev,
static int set_features(struct hinic_nic_dev *nic_dev, netdev_features_t pre_features, - netdev_features_t features, bool force_change) + netdev_features_t features) { netdev_features_t failed_features = 0; u32 err; @@ -1518,7 +1518,7 @@ static int hinic_set_features(struct net_device *netdev, struct hinic_nic_dev *nic_dev = netdev_priv(netdev);
return set_features(nic_dev, nic_dev->netdev->features, - features, false); + features); }
static netdev_features_t hinic_fix_features(struct net_device *netdev, @@ -1563,7 +1563,8 @@ static int hinic_set_default_hw_feature(struct hinic_nic_dev *nic_dev) }
/* enable all hw features in netdev->features */ - return set_features(nic_dev, 0, nic_dev->netdev->features, true); + return set_features(nic_dev, ~nic_dev->netdev->features, + nic_dev->netdev->features); }
static int hinic_setup_tc_mqprio(struct net_device *dev,