Unverified Commit 4c2d8732 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!874 nic: hns3: fix pointer cast for wol and fix getting GE port lanes error and set cpu affinity

Merge Pull Request from: @svishen 
 
This pull Requests fix pointer cast for wol and fix getting GE port lanes error and set cpu affinity

issue:
https://gitee.com/openeuler/kernel/issues/I7A712 
 
Link:https://gitee.com/openeuler/kernel/pulls/874

 

Reviewed-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 6bc20a2c b2b62276
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)
+3 −3
Original line number Diff line number Diff line
@@ -12083,7 +12083,7 @@ int hclge_get_wol_supported_mode(struct hclge_dev *hdev,

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_WOL_GET_SUPPORTED_MODE,
				   true);
	wol_supported_cmd = (struct hclge_query_wol_supported_cmd *)&desc.data;
	wol_supported_cmd = (struct hclge_query_wol_supported_cmd *)desc.data;

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
@@ -12111,7 +12111,7 @@ int hclge_get_wol_cfg(struct hclge_dev *hdev, u32 *mode)
		return ret;
	}

	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)&desc.data;
	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)desc.data;
	*mode = le32_to_cpu(wol_cfg_cmd->wake_on_lan_mode);

	return 0;
@@ -12125,7 +12125,7 @@ static int hclge_set_wol_cfg(struct hclge_dev *hdev,
	int ret;

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_WOL_CFG, false);
	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)&desc.data;
	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)desc.data;
	wol_cfg_cmd->wake_on_lan_mode = cpu_to_le32(wol_info->wol_current_mode);
	wol_cfg_cmd->sopass_size = wol_info->wol_sopass_size;
	memcpy(&wol_cfg_cmd->sopass, wol_info->wol_sopass, SOPASS_MAX);
+6 −1
Original line number Diff line number Diff line
@@ -7,10 +7,15 @@
static ssize_t lane_num_show(struct device *dev,
			     struct device_attribute *attr, char *buf)
{
#define HCLGE_GE_PORT_ONE_LANE	1
	struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev);
	struct hclge_dev *hdev = ae_dev->priv;

	if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER)
		return scnprintf(buf, PAGE_SIZE, "%u\n",
				 HCLGE_GE_PORT_ONE_LANE);
	else
		return scnprintf(buf, PAGE_SIZE, "%u\n", hdev->hw.mac.lane_num);
}