|
@@ -406,8 +406,6 @@ static int hns_roce_port_immutable(struct ib_device *ib_dev, u8 port_num,
|
|
|
struct ib_port_attr attr;
|
|
|
int ret;
|
|
|
|
|
|
- immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE;
|
|
|
-
|
|
|
ret = ib_query_port(ib_dev, port_num, &attr);
|
|
|
if (ret)
|
|
|
return ret;
|
|
@@ -416,6 +414,9 @@ static int hns_roce_port_immutable(struct ib_device *ib_dev, u8 port_num,
|
|
|
immutable->gid_tbl_len = attr.gid_tbl_len;
|
|
|
|
|
|
immutable->max_mad_size = IB_MGMT_MAD_SIZE;
|
|
|
+ immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE;
|
|
|
+ if (to_hr_dev(ib_dev)->caps.flags & HNS_ROCE_CAP_FLAG_ROCE_V1_V2)
|
|
|
+ immutable->core_cap_flags |= RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP;
|
|
|
|
|
|
return 0;
|
|
|
}
|