提交 7b075e22 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: Add pause/pfc mutual exclusion protection

driver inclusion
category: bugfix
bugzilla: 4472

-----------------------------------------------------------------------

PFC and Pause of 1822 cannot be enabled at the same time, so if PFC is
turned on, pause is not allowed.
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NZengweiliang <zengweiliang.zengweiliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b8997cfb
......@@ -1824,7 +1824,7 @@ static int hinic_set_pauseparam(struct net_device *netdev,
err = hinic_set_pause_info(nic_dev->hwdev, nic_pause);
if (err) {
nicif_err(nic_dev, drv, netdev, "Failed to set pauseparam\n");
return -EFAULT;
return err;
}
nicif_info(nic_dev, drv, netdev, "Set pause options, tx: %s, rx: %s\n",
......
......@@ -1029,6 +1029,10 @@ int hinic_set_pause_info(void *hwdev, struct nic_pause_config nic_pause)
return -EINVAL;
nic_cfg = &nic_hwdev->nic_io->nic_cfg;
if (nic_cfg->pfc_en) {
nic_err(nic_hwdev->dev_hdl, "Failed to set pause, please disable pfc first\n");
return -EPERM;
}
down(&nic_cfg->cfg_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册