Commit 597589b5 authored by wangsirong's avatar wangsirong Committed by Xie XiuQi
Browse files

RDMA/hns: Add cmd for clear extend doorbell list



driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

When unloading the RoCE driver, the address of
DB was reserved in hw, which should be clear
when reloading the RoCE driver.

Feature or Bugfix: Bugfix

Signed-off-by: default avatarwangsirong <wangsirong@huawei.com>
Signed-off-by: default avatarliyangyang (M) <liyangyang20@huawei.com>
Reviewed-by: default avataroulijun <oulijun@huawei.com>
Reviewed-by: default avatarliuyixian <liuyixian@huawei.com>
Reviewed-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 50355b5b
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1354,6 +1354,19 @@ static void hns_roce_function_clear(struct hns_roce_dev *hr_dev)
		hns_roce_clear_func(hr_dev, i);
}

static void hns_roce_clear_extdb_list_info(struct hns_roce_dev *hr_dev)
{
	struct hns_roce_cmq_desc desc;
	int ret;

	hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_CLEAR_EXTDB_LIST_INFO,
					false);
	ret = hns_roce_cmq_send(hr_dev, &desc, 1);
	if (ret)
		dev_warn(hr_dev->dev, "clear extend doorbell memory failed, ret = %d.\n",
			ret);
}

static int hns_roce_query_fw_ver(struct hns_roce_dev *hr_dev)
{
	struct hns_roce_query_fw_info *resp;
@@ -2152,6 +2165,8 @@ static int hns_roce_v2_init(struct hns_roce_dev *hr_dev)
			goto err_cqc_timer_failed;
		}
	}
	if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08_B)
		hns_roce_clear_extdb_list_info(hr_dev);

	return 0;

+1 −0
Original line number Diff line number Diff line
@@ -276,6 +276,7 @@ enum hns_roce_opcode_type {
	HNS_ROCE_OPC_SCC_CTX_CLR			= 0x8509,
	HNS_ROCE_OPC_QUERY_SCC_CTX			= 0x850a,
	HNS_ROCE_OPC_RESET_SCC_CTX			= 0x850b,
	HNS_ROCE_OPC_CLEAR_EXTDB_LIST_INFO		= 0x850d,
	HNS_QUERY_FW_VER				= 0x0001,
	HNS_SWITCH_PARAMETER_CFG			= 0x1033,