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: 523f34d81ea7 ("RDMA/hns: Support congestion control algorithm parameter configuration") Signed-off-by: Chengchang Tang tangchengchang@huawei.com Signed-off-by: Guofeng Yue yueguofeng@h-partners.com --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- drivers/infiniband/hw/hns/hns_roce_sysfs.c | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 5df6a07cc8f7..045fe899d953 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -7382,7 +7382,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) { diff --git a/drivers/infiniband/hw/hns/hns_roce_sysfs.c b/drivers/infiniband/hw/hns/hns_roce_sysfs.c index f92e5c13ab92..0262ec6716f1 100644 --- a/drivers/infiniband/hw/hns/hns_roce_sysfs.c +++ b/drivers/infiniband/hw/hns/hns_roce_sysfs.c @@ -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));