• Yixing Liu's avatar
    RDMA/hns: Fix the gid problem caused by free mr · 487d6509
    Yixing Liu authored
    After the hns roce driver is loaded, if you modify the mac address of the
    network port, the following error will appear:
    
       __ib_cache_gid_add: unable to add gid fe80:0000:0000:0000:4600:4dff:fe22:abb5 error=-28
        hns3 0000:7d:00.0 hns_0: attr path_mtu(1) invalid while modify qp
    
    The reason for the error is that the gid being occupied will cause the
    failure to modify the gid. The gid is occupied by the loopback QP used by
    free mr. When the mac address is modified, the gid will change. If there
    is a busy QP at this time, the gid will not be released and the
    modification will fail. The QP of free mr is created using the ib
    interface. The ib interface will add a reference count to the gid,
    resulting in this error scenario.
    
    Considering that free mr is solving a bug in HIP08, not an actual
    business, it is not necessary to use ib interfaces.
    
    Fixes: 70f92521 ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT")
    Link: https://lore.kernel.org/r/20221126102911.2921820-2-xuhaoyue1@hisilicon.comSigned-off-by: default avatarYixing Liu <liuyixing1@huawei.com>
    Signed-off-by: default avatarHaoyue Xu <xuhaoyue1@hisilicon.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    487d6509
hns_roce_hw_v2.h 47.4 KB