Re: [for-next PATCH v6 09/10] RDMA/cm: Make QP FLUSHABLE

From: lizhijian@xxxxxxxxxxx
Date: Tue Dec 06 2022 - 20:26:12 EST




On 06/12/2022 01:12, Jason Gunthorpe wrote:
> On Mon, Dec 05, 2022 at 10:07:11AM +0000, lizhijian@xxxxxxxxxxx wrote:
>> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
>> index 1f9938a2c475..603c0aecc361 100644
>> --- a/drivers/infiniband/core/cm.c
>> +++ b/drivers/infiniband/core/cm.c
>> @@ -4094,9 +4094,18 @@ static int cm_init_qp_init_attr(struct cm_id_private *cm_id_priv,
>> *qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS |
>> IB_QP_PKEY_INDEX | IB_QP_PORT;
>> qp_attr->qp_access_flags = IB_ACCESS_REMOTE_WRITE;
>> - if (cm_id_priv->responder_resources)
>> + if (cm_id_priv->responder_resources) {
>> + struct ib_device *ib_dev = cm_id_priv->id.device;
>> + u64 support_flush = ib_dev->attrs.device_cap_flags &
>> + (IB_DEVICE_FLUSH_GLOBAL | IB_DEVICE_FLUSH_PERSISTENT);
>> + u32 flushable = support_flush ?
>> + (IB_ACCESS_FLUSH_GLOBAL |
>> + IB_ACCESS_FLUSH_PERSISTENT) : 0;
>> +
>> qp_attr->qp_access_flags |= IB_ACCESS_REMOTE_READ |
>> - IB_ACCESS_REMOTE_ATOMIC;
>> + IB_ACCESS_REMOTE_ATOMIC |
>> + flushable;
>> + }
>
> This makes more sense

thanks for your help, i have posted V7 revision.
https://lore.kernel.org/lkml/20221206130201.30986-1-lizhijian@xxxxxxxxxxx/T/#t

Thanks
Zhijian

>
> Jason