提交 8174d796 编写于 作者: J Jiantao Xiao 提交者: openeuler-sync-bot

net: hns3: fix set cpu affinity when state down

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7A712
CVE: NA

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

The CPU affinity can be configured when the network
port is down. The patch fixes the problem.
Signed-off-by: NJiantao Xiao <xiaojiantao1@h-partners.com>
(cherry picked from commit b2b62276)
上级 20a1e3d0
......@@ -239,6 +239,13 @@ int nic_set_cpu_affinity(struct net_device *ndev, cpumask_t *affinity_mask)
goto err_unlock;
}
if (test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) {
netdev_err(ndev,
"ethernet is down, not support cpu affinity set\n");
ret = -ENETDOWN;
goto err_unlock;
}
for (i = 0; i < priv->vector_num; i++) {
tqp_vector = &priv->tqp_vector[i];
if (tqp_vector->irq_init_flag != HNS3_VECTOR_INITED)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册