]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: hns: fix hns dsaf v1 dont support tx_pause close
authorQianqian Xie <xieqiaqian@huawei.com>
Tue, 21 Jun 2016 03:56:22 +0000 (11:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jun 2016 08:51:54 +0000 (04:51 -0400)
For service port, hns dsaf v1 support to close tx_pause.
However, the port will be invalid when it run command
ethtool to close tx_pause. This patch will fix it.

Signed-off-by: Qianqian Xie <xieqiaqian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c

index ac03c4a53e08f52c5a92e9924cf5a3aea639132a..422f97d5218d86af7010cdcdb0f31b87056ee364 100644 (file)
@@ -1114,10 +1114,10 @@ int hns_dsaf_set_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int mac_id,
                                 u32 en)
 {
        if (AE_IS_VER1(dsaf_dev->dsaf_ver)) {
-               if (!en)
+               if (!en) {
                        dev_err(dsaf_dev->dev, "dsafv1 can't close rx_pause!\n");
-
-               return -EINVAL;
+                       return -EINVAL;
+               }
        }
 
        dsaf_set_dev_bit(dsaf_dev, DSAF_PAUSE_CFG_REG + mac_id * 4,