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

!7691 net: hns3: backport some bugfixes

Merge Pull Request from: @chenyi211 
 
| from     | commit id    | commit msg                                                        | 有无冲突 |
|----------|--------------|-------------------------------------------------------------------|------|
| upstream | 47e39d213e09 | net: hns3: fix index limit to support all queue stats             | 无    |
| upstream | 5bd088d6c21a | net: hns3: mark unexcuted loopback test result as UNEXECUTED      | 无    |
| OLK-6.6  | 6cca64db | net: hns3: using cpumask_copy when set value to cpumask_t         | 无    |
| OLK-6.6  | 5900b1a6 | net: hns3: set irq affinity directly                              | 无    |
| OLK-6.6  | a2205b33 | net: hns3: don't need to check an unsigned number is less than 0  | 无    |
| OLK-6.6  | c2ab7cfe | net: hns3: add \n at the end when print msg                       | 无    |
| upstream | b20250afcfb4 | net: hns3: move constants from hclge_debugfs.h to hclge_debugfs.c | 无    |
| OLK-6.6  | 8430f52a | net: hns3: add cond_resched() to hns3 ring buffer init process    | 无    |
| OLK-6.6  | e6917fe7 | net: hns3: fix kernel crash problem in concurrent scenario        | 冲突   |
| upstream | 05eb60e9648c | net: hns3: using user configure after hardware reset       | 无   |
| upstream  | 669554c512d2 | net: hns3: direct return when receive a unknown mailbox message        | 无   |
| OLK-6.6  | 22f24bb3 | net: hns3: change type of numa_node_mask as nodemask_t        | 无   |
| upstream  | 950aa4239989 | net: hns3: release PTP resources if pf initialization failed        | 冲突   |
| upstream  | 094c28122852 | net: hns3: use appropriate barrier function after setting a bit value        | 无   |
 
 
Link:https://gitee.com/openeuler/kernel/pulls/7691

 

Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 0488a59f 6e3631c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1007,7 +1007,7 @@ struct hnae3_handle {
		struct hnae3_udma_private_info udmainfo;
	};

	u32 numa_node_mask;	/* for multi-chip support */
	nodemask_t numa_node_mask; /* for multi-chip support */

	enum hnae3_port_base_vlan_state port_base_vlan_state;

+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ int hclge_comm_tqps_update_stats(struct hnae3_handle *handle,
		hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS,
						true);

		desc.data[0] = cpu_to_le32(tqp->index & 0x1ff);
		desc.data[0] = cpu_to_le32(tqp->index);
		ret = hclge_comm_cmd_send(hw, &desc, 1);
		if (ret) {
			dev_err(&hw->cmq.csq.pdev->dev,
+5 −1
Original line number Diff line number Diff line
@@ -2711,7 +2711,7 @@ static int hns3_nic_set_features(struct net_device *netdev,
	if ((netdev->features & NETIF_F_HW_TC) > (features & NETIF_F_HW_TC) &&
	    h->ae_algo->ops->cls_flower_active(h)) {
		netdev_err(netdev,
			   "there are offloaded TC filters active, cannot disable HW TC offload");
			   "there are offloaded TC filters active, cannot disable HW TC offload\n");
		return -EINVAL;
	}

@@ -3880,6 +3880,9 @@ static int hns3_alloc_ring_buffers(struct hns3_enet_ring *ring)
		ret = hns3_alloc_and_attach_buffer(ring, i);
		if (ret)
			goto out_buffer_fail;

		if (!(i % HNS3_RESCHED_BD_NUM))
			cond_resched();
	}

	return 0;
@@ -5486,6 +5489,7 @@ int hns3_init_all_ring(struct hns3_nic_priv *priv)
		}

		u64_stats_init(&priv->ring[i].syncp);
		cond_resched();
	}

	return 0;
+2 −0
Original line number Diff line number Diff line
@@ -221,6 +221,8 @@ enum hns3_nic_state {

#define HNS3_FD_QB_FORCE_CNT_MAX		20

#define HNS3_RESCHED_BD_NUM			1024

enum hns3_pkt_l2t_type {
	HNS3_L2_TYPE_UNICAST,
	HNS3_L2_TYPE_MULTICAST,
+21 −6
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ static const struct hns3_stats hns3_rxq_stats[] = {
#define HNS3_NIC_LB_TEST_NO_MEM_ERR	1
#define HNS3_NIC_LB_TEST_TX_CNT_ERR	2
#define HNS3_NIC_LB_TEST_RX_CNT_ERR	3
#define HNS3_NIC_LB_TEST_UNEXECUTED	4

static int hns3_get_sset_count(struct net_device *netdev, int stringset);

static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
{
@@ -450,18 +453,26 @@ static void hns3_do_external_lb(struct net_device *ndev,
static void hns3_self_test(struct net_device *ndev,
			   struct ethtool_test *eth_test, u64 *data)
{
	int cnt = hns3_get_sset_count(ndev, ETH_SS_TEST);
	struct hns3_nic_priv *priv = netdev_priv(ndev);
	struct hnae3_handle *h = priv->ae_handle;
	int st_param[HNAE3_LOOP_NONE][2];
	bool if_running = netif_running(ndev);
	int i;

	/* initialize the loopback test result, avoid marking an unexcuted
	 * loopback test as PASS.
	 */
	for (i = 0; i < cnt; i++)
		data[i] = HNS3_NIC_LB_TEST_UNEXECUTED;

	if (hns3_nic_resetting(ndev)) {
		netdev_err(ndev, "dev resetting!");
		return;
		netdev_err(ndev, "dev resetting!\n");
		goto failure;
	}

	if (!(eth_test->flags & ETH_TEST_FL_OFFLINE))
		return;
		goto failure;

	if (netif_msg_ifdown(h))
		netdev_info(ndev, "self test start\n");
@@ -483,6 +494,10 @@ static void hns3_self_test(struct net_device *ndev,

	if (netif_msg_ifdown(h))
		netdev_info(ndev, "self test end\n");
	return;

failure:
	eth_test->flags |= ETH_TEST_FL_FAILED;
}

static void hns3_update_limit_promisc_mode(struct net_device *netdev,
@@ -900,7 +915,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
		break;
	default:

		netdev_warn(netdev, "Unknown media type");
		netdev_warn(netdev, "Unknown media type\n");
		return 0;
	}

@@ -947,7 +962,7 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
	if (cmd->base.duplex == DUPLEX_HALF &&
	    media_type != HNAE3_MEDIA_TYPE_COPPER) {
		netdev_err(netdev,
			   "only copper port supports half duplex!");
			   "only copper port supports half duplex!\n");
		return -EINVAL;
	}

@@ -1376,7 +1391,7 @@ static int hns3_nway_reset(struct net_device *netdev)
		return 0;

	if (hns3_nic_resetting(netdev)) {
		netdev_err(netdev, "dev resetting!");
		netdev_err(netdev, "dev resetting!\n");
		return -EBUSY;
	}

Loading