Re: [PATCH v2 for-next 1/2] RDMA/hns: Add the workqueue framework for flush cqe handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2019/11/20 2:46, Jason Gunthorpe wrote:
> On Tue, Nov 19, 2019 at 04:00:00PM +0800, Liuyixian (Eason) wrote:
>>
>>
>> On 2019/11/19 1:02, Jason Gunthorpe wrote:
>>> On Mon, Nov 18, 2019 at 09:50:24PM +0800, Liuyixian (Eason) wrote:
>>>>> It kind of looks like this can be called multiple times? It won't work
>>>>> right unless it is called exactly once
>>>>>
>>>>> Jason
>>>>
>>>> Yes, you are right.
>>>>
>>>> So I think the reasonable solution is to allocate it dynamically, and I think
>>>> it is a very very little chance that the allocation will be failed. If this happened,
>>>> I think the application also needs to be over.
>>>
>>> Why do you need more than one work in parallel for this? Once you
>>> start to move the HW to error that only has to happen once, surely?
>>>
>>> Jason
>>
>> The flush operation moves QP, not the HW to error.
>>
>> For the QP, maybe the process A is posting send while the other
>> process B is modifying qp to error, both of these two operation
>> needs to initialize one flush work. That's why it could be called
>> multiple times.
> 
> The work function does something that looks like it only has to happen
> once per QP.
No, the work should be re-queued every time the producer index of qp
needs to be updated.

> 
> One do you need to keep re-queing this thing every time the user posts
> a WR?

Once a wr is posted, the producer index (pi) of qp is changed, thus,
the updated pi needs to be delivered into the HW in the flush operation,
to help the HW generated corresponding cqe. That's why modify qp is called
inside flush work, not only modify qp to error, but also transfer the pi into the HW.

In one word, the flush operation includes two parts:
1. change the state of the qp to error
2. deliver the latest pi of the qp to HW

Thanks.

> 
> Jason
> 
> 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux