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

!2292 Backport some patch for HNS3 and revert some patch

Merge Pull Request from: @svishen 
 
This PR backport some patch from mainline

issues:
https://gitee.com/openeuler/kernel/issues/I83ZCY 
 
Link:https://gitee.com/openeuler/kernel/pulls/2292

 

Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents b2e20aab 85c4ae5d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3592,6 +3592,15 @@ static void hns3_set_default_feature(struct net_device *netdev)
		  NETIF_F_HW_TC);

	netdev->hw_enc_features |= netdev->vlan_features | NETIF_F_TSO_MANGLEID;

	/* The device_version V3 hardware can't offload the checksum for IP in
	 * GRE packets, but can do it for NvGRE. So default to disable the
	 * checksum and GSO offload for GRE.
	 */
	if (ae_dev->dev_version > HNAE3_DEVICE_VERSION_V2) {
		netdev->features &= ~NETIF_F_GSO_GRE;
		netdev->features &= ~NETIF_F_GSO_GRE_CSUM;
	}
}

static int hns3_alloc_buffer(struct hns3_enet_ring *ring,
+11 −0
Original line number Diff line number Diff line
@@ -3469,9 +3469,14 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type,
				    u32 regclr)
{
#define HCLGE_IMP_RESET_DELAY		5

	switch (event_type) {
	case HCLGE_VECTOR0_EVENT_PTP:
	case HCLGE_VECTOR0_EVENT_RST:
		if (regclr == BIT(HCLGE_VECTOR0_IMPRESET_INT_B))
			mdelay(HCLGE_IMP_RESET_DELAY);

		hclge_write_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG, regclr);
		break;
	case HCLGE_VECTOR0_EVENT_MBX:
@@ -7777,6 +7782,12 @@ static int hclge_del_cls_flower(struct hnae3_handle *handle,
	ret = hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, rule->location,
				   NULL, false);
	if (ret) {
		/* if tcam config fail, set rule state to TO_DEL,
		 * so the rule will be deleted when periodic
		 * task being scheduled.
		 */
		hclge_update_fd_list(hdev, HCLGE_FD_TO_DEL, rule->location, NULL);
		set_bit(HCLGE_STATE_FD_TBL_CHANGED, &hdev->state);
		spin_unlock_bh(&hdev->fd_rule_lock);
		return ret;
	}
+2 −1
Original line number Diff line number Diff line
@@ -1923,7 +1923,8 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
	unsigned long delta = round_jiffies_relative(HZ);
	struct hnae3_handle *handle = &hdev->nic;

	if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state))
	if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state) ||
	    test_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state))
		return;

	if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) {