Commit 48a79994 authored by Chengchang Tang's avatar Chengchang Tang Committed by Juan Zhou
Browse files

RDMA/hns: Fix port active speed

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



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

HW supports a variety of different speed, but the current speed
is fixed.

The real speed should be queried from ethernet.

Fixes: 9a443537 ("IB/hns: Add driver files for hns RoCE driver")
Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
parent 146d3257
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -318,6 +318,7 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num,
	unsigned long flags;
	enum ib_mtu mtu;
	u8 port;
	int ret;

	port = port_num - 1;

@@ -330,8 +331,10 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num,
				IB_PORT_BOOT_MGMT_SUP;
	props->max_msg_sz = HNS_ROCE_MAX_MSG_LEN;
	props->pkey_tbl_len = 1;
	props->active_width = IB_WIDTH_4X;
	props->active_speed = 1;
	ret = ib_get_eth_speed(ib_dev, port_num, &props->active_speed,
			       &props->active_width);
	if (ret)
		ibdev_warn(ib_dev, "failed to get speed, ret = %d.\n", ret);

	spin_lock_irqsave(&hr_dev->iboe.lock, flags);