Loading
RDMA/hns: Fix different dgids mapping to the same dip_idx
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAL7SX ---------------------------------------------------------------------- The mapping between dgid and dip_idx should be one-to-one. When two QPs use the same dgid, the first QP is repeatedly created and deleted, and different dgids are used, the problem that different dgids correspond to the same dip_idx occurs. This patch creates qpn_bitmap and dip_idx_map to record qp_num and dip_idx. The bit corresponding to qpn_bitmap is set to 1 only when qp_num is different from the used dip_idx. When dip_idx is no longer used, the bit corresponding to dip_idx_map is cleared, and the bit corresponding to qpn_bitmap is set to 1. When dip_idx needs to be allocated, the index whose first bit is 1 is found from qpn_bitmap. The bit corresponding to dip_idx_map is set to 1, and the bit corresponding to qpn_bitmap is cleared. Fixes: 2493138e ("RDMA/hns: Bugfix for incorrect association between dip_idx and dgid") Fixes: f91696f2 ("RDMA/hns: Support congestion control type selection according to the FW") Signed-off-by:Feng Fang <fangfeng4@huawei.com> Signed-off-by:
Xinghai Cen <cenxinghai@h-partners.com>