diff options
author | Lijun Ou <oulijun@huawei.com> | 2018-09-22 16:21:06 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-09-26 14:59:13 -0600 |
commit | 384f881851127dd834a2733f91999b859a5ffddb (patch) | |
tree | c84963aecea006719dec769a4f3249126a1b49f1 /drivers/infiniband/hw/hns/hns_roce_main.c | |
parent | RDMA/hns: Refactor the codes for setting transport opode (diff) | |
download | linux-dev-384f881851127dd834a2733f91999b859a5ffddb.tar.xz linux-dev-384f881851127dd834a2733f91999b859a5ffddb.zip |
RDMA/hns: Add atomic support
This patch adds atomic operations for hip08, includes fetchadd and cmpswap
operation. In order to enable atomic, the driver needs to do the
following steps:
1. Enable the atomic caps for RoCE device
2. Post the wqe context of atomic type
3. Configure the atomic type of mtpt
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 5a86a48cba13..202408874c54 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -215,7 +215,8 @@ static int hns_roce_query_device(struct ib_device *ib_dev, props->max_pd = hr_dev->caps.num_pds; props->max_qp_rd_atom = hr_dev->caps.max_qp_dest_rdma; props->max_qp_init_rd_atom = hr_dev->caps.max_qp_init_rdma; - props->atomic_cap = IB_ATOMIC_NONE; + props->atomic_cap = hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_ATOMIC ? + IB_ATOMIC_HCA : IB_ATOMIC_NONE; props->max_pkeys = 1; props->local_ca_ack_delay = hr_dev->caps.local_ca_ack_delay; |