Commit ea169d67 authored by Chengchang Tang's avatar Chengchang Tang Committed by 岳国风
Browse files

RDMA/hns: directly read the scc parameters in the driver instead of the firmware

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9SI44



----------------------------------------------------------------------

The driver will now read the SCC parameters from the firmware during
initialization. Subsequent SCC parameters are configured by the driver,
so there is no need to read parameters from firmware again.

Fixes: 523f34d8 ("RDMA/hns: Support congestion control algorithm parameter configuration")
Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
Signed-off-by: default avatarGuofeng Yue <yueguofeng@h-partners.com>
parent 593d8957
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7388,7 +7388,7 @@ static int hns_roce_v2_query_scc_param(struct hns_roce_dev *hr_dev,
	struct hns_roce_port *pdata;
	int ret;

	if (hr_dev->pci_dev->revision <= PCI_REVISION_ID_HIP08)
	if (hr_dev->pci_dev->revision <= PCI_REVISION_ID_HIP08 || hr_dev->is_vf)
		return -EOPNOTSUPP;

	if (port_num > hr_dev->caps.num_ports) {
+0 −13
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ static ssize_t scc_attr_show(struct hns_roce_port *pdata,
	struct hns_port_cc_attr *scc_attr =
		container_of(attr, struct hns_port_cc_attr, port_attr);
	struct hns_roce_scc_param *scc_param;
	unsigned long exp_time;
	__le32 val = 0;
	int ret;

@@ -103,18 +102,6 @@ static ssize_t scc_attr_show(struct hns_roce_port *pdata,

	scc_param = &pdata->scc_param[scc_attr->algo_type];

	/* Only HW param need be queried */
	if (scc_attr->offset < offsetof(typeof(*scc_param), lifespan)) {
		exp_time = scc_param->timestamp +
			   msecs_to_jiffies(scc_param->lifespan);

		if (time_is_before_eq_jiffies(exp_time)) {
			scc_param->timestamp = jiffies;
			pdata->hr_dev->hw->query_scc_param(pdata->hr_dev,
					pdata->port_num, scc_attr->algo_type);
		}
	}

	memcpy(&val, (void *)scc_param + scc_attr->offset, scc_attr->size);

	return sysfs_emit(buf, "%u\n", le32_to_cpu(val));