• Luoyouming's avatar
    RDMA/hns: Fix incorrect sge nums calculation · 0c5e259b
    Luoyouming authored
    The user usually configures the number of sge through the max_send_sge
    parameter when creating qp, and configures the maximum size of inline data
    that can be sent through max_inline_data. Inline uses sge to fill data to
    send. Expect the following:
    
    1) When the sge space cannot hold inline data, the sge space needs to be
       expanded to accommodate all inline data
    
    2) When the sge space is enough to accommodate inline data, the upper
       limit of inline data can be increased so that users can send larger
       inline data
    
    Currently case one is not implemented. When the inline data is larger than
    the sge space, an error of insufficient sge space occurs.  This part of
    the code needs to be reimplemented according to the expected rules. The
    calculation method of sge num is modified to take the maximum value of
    max_send_sge and the sge for max_inline_data to solve this problem.
    
    Fixes: 05201e01 ("RDMA/hns: Refactor process of setting extended sge")
    Fixes: 30b70788 ("RDMA/hns: Support inline data in extented sge space for RC")
    Link: https://lore.kernel.org/r/20221108133847.2304539-3-xuhaoyue1@hisilicon.comSigned-off-by: default avatarLuoyouming <luoyouming@huawei.com>
    Signed-off-by: default avatarHaoyue Xu <xuhaoyue1@hisilicon.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    0c5e259b
hns_roce_main.c 26.8 KB