Re: [PATCH v3 10/14] RDMA/ionic: Register device ops for control path

Abhijit Gangurde
2025-07-03T07:00:42Z

On 7/1/25 16:08, Leon Romanovsky wrote:
> On Tue, Jun 24, 2025 at 05:43:11PM +0530, Abhijit Gangurde wrote:
>> Implement device supported verb APIs for control path.
>>
>> Co-developed-by: Andrew Boyer <andrew.boyer@amd.com>
>> Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
>> Co-developed-by: Allen Hubbe <allen.hubbe@amd.com>
>> Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
>> Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
>> ---
>> v2->v3
>> - Registered main ib ops at once
>> - Removed uverbs_cmd_mask
>> - Removed uverbs_cmd_mask
>> - Used rdma_user_mmap_* APIs for mappings
>> - Removed rw locks around xarrays
>> - Fixed sparse checks
>>
>> drivers/infiniband/hw/ionic/ionic_admin.c | 101 +
>> .../infiniband/hw/ionic/ionic_controlpath.c | 2530 +++++++++++++++++
>> drivers/infiniband/hw/ionic/ionic_fw.h | 717 +++++
>> drivers/infiniband/hw/ionic/ionic_ibdev.c | 44 +
>> drivers/infiniband/hw/ionic/ionic_ibdev.h | 249 +-
>> drivers/infiniband/hw/ionic/ionic_pgtbl.c | 19 +
>> include/uapi/rdma/ionic-abi.h | 115 +
>> 7 files changed, 3767 insertions(+), 8 deletions(-)
>> create mode 100644 include/uapi/rdma/ionic-abi.h
> <...>
>
>> +static void ionic_flush_qs(struct ionic_ibdev *dev)
>> +{
>> + struct ionic_qp *qp, *qp_tmp;
>> + struct ionic_cq *cq, *cq_tmp;
>> + LIST_HEAD(flush_list);
>> + unsigned long index;
>> +
>> + /* Flush qp send and recv */
>> + rcu_read_lock();
>> + xa_for_each(&dev->qp_tbl, index, qp) {
>> + kref_get(&qp->qp_kref);
>> + list_add_tail(&qp->ibkill_flush_ent, &flush_list);
>> + }
>> + rcu_read_unlock();
> Same question as for CQ. What does RCU lock protect here?
>
>> +
>> + list_for_each_entry_safe(qp, qp_tmp, &flush_list, ibkill_flush_ent) {
>> + ionic_flush_qp(dev, qp);
>> + kref_put(&qp->qp_kref, ionic_qp_complete);
>> + list_del(&qp->ibkill_flush_ent);
>> + }
> <...>
>
>> +err_buf:
>> +err_hdr:
> Please don't use empty goto labels.

I will correct this.

>
>> + return rc;
>> +}
> <...>
>
>> +#define IONIC_ABI_VERSION 4
> For us it is 1.
>
> Thanks

I will correct this and others in next spin.

Thanks,
Abhijit