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

!15300 net: hns3: some bugfixes for hns3 driver

Merge Pull Request from: @chen-hao418 
 
    1. net: hns3: add command queue trace for hns3
    2. Revert "net: hns3: add command queue trace for hns3"
    3. net: hns3: add mac tunnel number query
    4. net: hns3: fix oops when unload drivers paralleling

    maillist inclusion
    category: bugfix
    bugzilla: https://gitee.com/openeuler/kernel/issues/IBQKQF
    CVE: NA

    Reference: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=f2c14899caba76da93ff3fff46b4d5a8f43ce07e 
 
Link:https://gitee.com/openeuler/kernel/pulls/15300

 

Reviewed-by: default avatarLi Nan <linan122@huawei.com>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parents 29bb04c8 ec796ec9
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -37,6 +37,21 @@ EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare);
 */
static DEFINE_MUTEX(hnae3_common_lock);

/* ensure the drivers being unloaded one by one */
static DEFINE_MUTEX(hnae3_unload_lock);

void hnae3_acquire_unload_lock(void)
{
	mutex_lock(&hnae3_unload_lock);
}
EXPORT_SYMBOL(hnae3_acquire_unload_lock);

void hnae3_release_unload_lock(void)
{
	mutex_unlock(&hnae3_unload_lock);
}
EXPORT_SYMBOL(hnae3_release_unload_lock);

static bool hnae3_client_match(enum hnae3_client_type client_type)
{
	if (client_type == HNAE3_CLIENT_KNIC ||
+2 −0
Original line number Diff line number Diff line
@@ -1106,4 +1106,6 @@ int hnae3_register_client(struct hnae3_client *client);
void hnae3_set_client_init_flag(struct hnae3_client *client,
				struct hnae3_ae_dev *ae_dev,
				unsigned int inited);
void hnae3_acquire_unload_lock(void);
void hnae3_release_unload_lock(void);
#endif
+1 −1
Original line number Diff line number Diff line
@@ -474,7 +474,7 @@ static int hclge_comm_cmd_check_result(struct hclge_comm_hw *hw,
int hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc,
			int num)
{
	bool is_special = hclge_comm_is_special_opcode(desc->opcode);
	bool is_special = hclge_comm_is_special_opcode(le16_to_cpu(desc->opcode));
	struct hclge_comm_cmq_ring *csq = &hw->cmq.csq;
	int ret;
	int ntc;
+2 −0
Original line number Diff line number Diff line
@@ -1109,6 +1109,8 @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos)
			  dev->watchdog_timeo / HZ);
	*pos += scnprintf(buf + *pos, len - *pos, "Hilink Version: %u\n",
			  dev_specs->hilink_version);
	pos += scnprintf(buf + *pos, len - *pos, "mac tunnel number: %u\n",
			  dev_specs->tnl_num);
	*pos += scnprintf(buf + *pos, len - *pos, "total rx buffer size: %u\n",
			  dev_specs->total_rx_buffer_size);
	*pos += scnprintf(buf + *pos, len - *pos, "min rx buffer size per tc: %u\n",
+2 −0
Original line number Diff line number Diff line
@@ -6527,12 +6527,14 @@ module_init(hns3_init_module);
 */
static void __exit hns3_exit_module(void)
{
	hnae3_acquire_unload_lock();
#ifdef CONFIG_HNS3_UBL
	unregister_ipaddr_notifier();
#endif
	pci_unregister_driver(&hns3_driver);
	hnae3_unregister_client(&client);
	hns3_dbg_unregister_debugfs();
	hnae3_release_unload_lock();
}
module_exit(hns3_exit_module);

Loading