Hi Chenbo, 

>-----Original Message-----
>From: Xia, Chenbo <chenbo....@intel.com>
>Sent: Tuesday, November 2, 2021 1:05 PM
>To: Vijay Kumar Srivastava <vsriv...@xilinx.com>; dev@dpdk.org
>Cc: maxime.coque...@redhat.com; andrew.rybche...@oktetlabs.ru; Vijay
>Kumar Srivastava <vsriv...@xilinx.com>
>Subject: RE: [PATCH v3 07/10] vdpa/sfc: add support to get queue notify area
>info
>
>Hi Vijay,
>
>> -----Original Message-----
>> From: Vijay Srivastava <vijay.srivast...@xilinx.com>
>> Sent: Friday, October 29, 2021 10:47 PM
>> To: dev@dpdk.org
>> Cc: maxime.coque...@redhat.com; Xia, Chenbo <chenbo....@intel.com>;
>> andrew.rybche...@oktetlabs.ru; Vijay Kumar Srivastava
>> <vsriv...@xilinx.com>
>> Subject: [PATCH v3 07/10] vdpa/sfc: add support to get queue notify
>> area info
>>
>> From: Vijay Kumar Srivastava <vsriv...@xilinx.com>
>>
>> Implement the vDPA ops get_notify_area to get the notify area info of
>> the queue.
>>
>> Signed-off-by: Vijay Kumar Srivastava <vsriv...@xilinx.com>
>> Acked-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
>> ---
[SNIP]
>> +static int
>> +sfc_vdpa_setup_notify_ctrl(int vid)
>> +{
>> +    int ret;
>> +    struct rte_vdpa_device *vdpa_dev;
>> +    struct sfc_vdpa_ops_data *ops_data;
>> +
>> +    vdpa_dev = rte_vhost_get_vdpa_device(vid);
>> +
>> +    ops_data = sfc_vdpa_get_data_by_dev(vdpa_dev);
>> +    if (ops_data == NULL) {
>> +            sfc_vdpa_err(ops_data->dev_handle,
>> +                         "invalid vDPA device : %p, vid : %d",
>> +                         vdpa_dev, vid);
>> +            return -1;
>> +    }
>
>Why not use struct sfc_vdpa_ops_data * as the input param rather than vid,
>then use ops_data->vdpa_dev to get vdpa_dev?
>
>As ops_data is checked as non-NULL before the func, it will make things easier.
>
Yes. ops_data can be used as input param. 
I will include this change.

Reply via email to