Re: [RDMA PATCH 16/16] i40iw: Adding queue drain functions

Sagi Grimberg
2016-04-10T19:26:08Z

>>> I want to bring back last conversation about need special function to
>>> drain QPs for iWARP devices.
>>> Come on guys, it is already third place there is the same implementation
>>> is introduced in last 2 months.
>>
>> In order to move this into core, the core would need to determine if the
>> sq and rq are empty. To do this it will need the driver's internal sq and
>> rq information such as head and tail. Then if not empty it will need
>> more information about the qp's cq processing. All this is device specific.
>>
>> It is just a few lines of code in each driver to check if its hw sq and rq
>> are empty and if not, handle it from its cq processing.
>>
>> For this reason, it seems best left to each iWARP driver to handle.
>>
>> Thanks,
>
> I agree. My cxgb4 drain functions need to check if the sq/rq are empty as well.
> And for cxgb4, that will require holding the qp spinlock. (I need to post this
> patch soon).
>
> So while they are all very similar, the guts for looking at the sq/rq are
> device-specific.

I actually agree here too.

The iWARP folks needs some driver specific logic to get the QP drained
correctly so I'm all for them having the freedom to do whats best
for them.

I do understand Leon when he sees 3 copies of this code, but all these
copies are looking into the raw queue so I'm fine with it.

Cheers,
Sagi.