Commit b2b62276 authored by Jiantao Xiao's avatar Jiantao Xiao
Browse files

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: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent 49acadc5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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)