On 5/21/2026 9:06 PM, David Marchand wrote:
> Hello Chengwen,
>
> On Mon, 2 Mar 2026 at 12:02, Chengwen Feng <[email protected]> wrote:
>>
>> As we know, the uacce driver (e.g. hisi_acc DMA driver) reads the API of
>> the hardware device (through /sysfs/class/uacce/xxx/api) and compares it
>> with the API supported by the driver to match the corresponding hardware
>> device.
>>
>> Hardware devices will continue to evolve, which means their APIs will
>> change, but business requirements demand that they support old
>> programming interfaces as much as possible.
>>
>> To adapt to this situation, this commit supports forward compatibility
>> of driver APIs. For example, if the driver supports the hisi_qm_v5 API,
>> it can drive the hardware device that supports the hisi_qm_v6 or
>> hisi_qm_v7 API.
>>
>> In addition, a driver flag (RTE_UACCE_DRV_FORWARD_COMPATIBILITY_DEV) is
>> introduced. The driver supports forward compatibility of APIs only when
>> this flag is defined.
>>
>> Signed-off-by: Chengwen Feng <[email protected]>
>> ---
>> drivers/bus/uacce/bus_uacce_driver.h | 5 +++
>> drivers/bus/uacce/uacce.c | 51 ++++++++++++++++++++++++++--
>> 2 files changed, 53 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/bus/uacce/bus_uacce_driver.h
>> b/drivers/bus/uacce/bus_uacce_driver.h
>> index 618e0f9b76..c7445778a6 100644
>> --- a/drivers/bus/uacce/bus_uacce_driver.h
>> +++ b/drivers/bus/uacce/bus_uacce_driver.h
>> @@ -50,6 +50,7 @@ struct rte_uacce_device {
>> char dev_root[RTE_UACCE_DEV_PATH_SIZE]; /**< Sysfs path with device
>> name. */
>> char cdev_path[RTE_UACCE_DEV_PATH_SIZE]; /**< Device path in devfs.
>> */
>> char api[RTE_UACCE_API_NAME_SIZE]; /**< Device context type. */
>> + uint32_t api_ver; /**< Device api version
>> used for compatibility. */
>
> I have some problem with this field.
> See below.
...
>> +
>> static bool
>> -uacce_match(const struct rte_uacce_driver *dr, const struct
>> rte_uacce_device *dev)
>> +uacce_match(const struct rte_uacce_driver *dr, struct rte_uacce_device *dev)
>
> A matching helper should only match, and not modify the object.
Yes, you are right
>
>> {
>> + bool forward_compat = !!(dr->drv_flags &
>> RTE_UACCE_DRV_FORWARD_COMPATIBILITY_DEV);
>> + uint32_t api_ver = uacce_calc_api_ver(dev->api, NULL);
>
> This conversion from a string to integer could be placed in the scanning step.
> Why place it here?
I think it's OK to place in the scanning step.
Should I submit a commit to fix this?
>
>
> The dev->api_ver has no in-tree user.
> This field was (silently?) dropped by my best AI friend in the bus
> refactoring series I posted.
> https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
>
> Please advise if I can drop this field (it is just the integer value
> extracted from dev->api afaiu), or if it should be moved to the
> scanning step.
Please keep this field.
This field mainly used for driver to know which api-version the device support,
so driver could do
bug-fix for specific device by judging this field.
Thanks
>
>