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

!11479 【OLK 5.10】some bugfixes for hns3 driver

Merge Pull Request from: @chen-hao418 
 
    driver inclusion
    category: bugfix
    bugzilla: https://gitee.com/openeuler/kernel/issues/IAQ6G2

    Peiyang Wang:
    net: hns3:support enable or disable pfc strom prevent
    net: hns3: make sure ptp clock is unregister and freed if hclge_ptp_get_cycle returns an error

    lanhao:
    net: hns3: fix spelling mistake "reg_um" -> "reg_num"
    net: hns3: fixed hclge_fetch_pf_reg accesses bar space out of bounds issue

    Jie Wang:
    net: hns3: fix wrong use of semaphore up

    Jian Shen:
    net: hns3: fix concurrent setting vlan filter issue

    Yonglong Liu:
    net: hns3: fix snprintf() is printing too much problem 
 
Link:https://gitee.com/openeuler/kernel/pulls/11479

 

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents fb74b7c6 1ed87e8a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -656,6 +656,10 @@ enum hnae3_unic_addr_type {
 *   Execute debugfs read command.
 * request_flush_qb_config
 *   Request to update queue bonding configuration
 * request_pfc_storm_config
 *   Request to update pfc storm configuration
 * get_pfc_storm_config
 *   Get pfc storm config
 * query_fd_qb_state
 *   Query whether hw queue bonding enabled
 * set_tx_hwts_info
@@ -855,6 +859,9 @@ struct hnae3_ae_ops {
	int (*set_phy_link_ksettings)(struct hnae3_handle *handle,
				      const struct ethtool_link_ksettings *cmd);
	void (*request_flush_qb_config)(struct hnae3_handle *handle);
	void (*request_pfc_storm_config)(struct hnae3_handle *handle,
					 bool enable);
	int (*get_pfc_storm_config)(struct hnae3_handle *handle, bool *enable);
	bool (*query_fd_qb_state)(struct hnae3_handle *handle);
	bool (*set_tx_hwts_info)(struct hnae3_handle *handle,
				 struct sk_buff *skb);
@@ -1016,6 +1023,7 @@ enum hnae3_pflag {
	HNAE3_PFLAG_PUSH_ENABLE,
	HNAE3_PFLAG_FD_QB_ENABLE,
	HNAE3_PFLAG_ROH_ARP_PROXY_ENABLE,
	HNAE3_PFLAG_PFC_STORM_PREVENT_ENABLE,
	HNAE3_PFLAG_MAX
};

+12 −0
Original line number Diff line number Diff line
@@ -5732,6 +5732,18 @@ static void hns3_state_init(struct hnae3_handle *handle)
			&handle->supported_pflags);
		set_bit(HNAE3_PFLAG_ROH_ARP_PROXY_ENABLE, &handle->priv_flags);
	}

	if (handle->ae_algo->ops->get_pfc_storm_config) {
		bool enable = true;
		int ret = handle->ae_algo->ops->get_pfc_storm_config(handle,
								     &enable);

		set_bit(HNAE3_PFLAG_PFC_STORM_PREVENT_ENABLE,
			&handle->supported_pflags);
		if (!ret && enable)
			set_bit(HNAE3_PFLAG_PFC_STORM_PREVENT_ENABLE,
				&handle->priv_flags);
	}
}

static void hns3_state_uninit(struct hnae3_handle *handle)
+12 −0
Original line number Diff line number Diff line
@@ -548,11 +548,23 @@ static void hns3_update_roh_arp_proxy_enable(struct net_device *netdev,
		    enable ? "enable" : "disable");
}

static void hns3_update_pfc_storm_prevent_enable(struct net_device *netdev,
						 bool enable)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);

	if (!handle->ae_algo->ops->request_pfc_storm_config)
		return;

	handle->ae_algo->ops->request_pfc_storm_config(handle, enable);
}

static const struct hns3_pflag_desc hns3_priv_flags[HNAE3_PFLAG_MAX] = {
	{ "limit_promisc",	hns3_update_limit_promisc_mode },
	{ "tx_push_enable",	hns3_update_push_state },
	{ "qb_enable",		hns3_update_fd_qb_state },
	{ "roh_arp_proxy_enable",	hns3_update_roh_arp_proxy_enable },
	{ "pfc_storm_prevent_enable",	hns3_update_pfc_storm_prevent_enable },
};

static int hns3_get_sset_count(struct net_device *netdev, int stringset)
+9 −0
Original line number Diff line number Diff line
@@ -946,6 +946,15 @@ struct hclge_config_fastpath_cmd {
	u8 rsv1[8];
};

struct hclge_pfc_storm_para_cmd {
	__le32 dir;
	__le32 enable;
	__le32 period_ms;
	__le32 times;
	__le32 recovery_period_ms;
	__le32 rsv;
};

struct hclge_hw;
int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num);
enum hclge_comm_cmd_status hclge_cmd_mdio_write(struct hclge_hw *hw,
+0 −9
Original line number Diff line number Diff line
@@ -77,15 +77,6 @@ struct hclge_port_num_info_cmd {
	u8 rsv[20];
};

struct hclge_pfc_storm_para_cmd {
	__le32 dir;
	__le32 enable;
	__le32 period_ms;
	__le32 times;
	__le32 recovery_period_ms;
	__le32 rsv;
};

struct hclge_notify_pkt_param_cmd {
	__le32 cfg;
	__le32 ipg;
Loading