Closed mcao59 closed 1 year ago
The users need to upgrade to a compatible accel-config library if they are building the executable themselves from a newer version of QPL library or source code. It will be very ugly and error prone to add compile time checks in QPL source code for accel-config library versions assuming some API will be present in a certain version. Note that new APIs get added irrespective of major versions e.g. ( 3.x or 4.x). Further there will be other changes like bug fixes that you would need from latest accel-config library.
Accel-config APIs are backward compatible. The correct way to do it is call accfg_device_get_iaa_cap() if error skip iaa features else if required iaa cap not present skip iaa features
Closing this PR since QPL v1.2 will ask users to use accel-config v4 or later. But we might want to revisit this some time later.
This PR adds VERSION macros in libaccel_config.h. These version macros will be useful to developers using accel-config (e.g. QPL/DML developers) in the following case: If a new API is introduced in version A of accel-config, we can use the version macro as preprocessor macro to conditionally compile the code whether the new API is used. This avoids getting "undefined symbol" error with versions earlier than A.
Possible workarounds and why we prefer adding VERSION macros:
accfg_device_get_iaa_cap
, an API added in accel-config v4.0). For such customers who are staying with SPR and not migrating to GNR, we should avoid requesting them to upgrade accel-config unless necessary.accfg_device_get_version
to check HW gen2 features: this is the least preferred option since it's not guaranteed that the device version always imply certain features are present. It's safer to use the officially supported way (checking IAACAP)In this PR, the version macros are hardcoded and they will need to be updated before each official release. I'm open to other approaches besides hardcoding them. But I see that there's another "version" hardcoded in git-version being updated for each release https://github.com/intel/idxd-config/blob/stable/git-version#L22