In many scenarios, AFU is needed searched by name, this
function add the feature.
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
return NULL;
}
+struct rte_afu_device *
+rte_ifpga_find_afu_by_name(const char *name)
+{
+ struct rte_afu_device *afu_dev = NULL;
+
+ TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) {
+ if (afu_dev &&
+ !strcmp(afu_dev->device.name, name))
+ return afu_dev;
+ }
+ return NULL;
+}
+
static const char * const valid_args[] = {
#define IFPGA_ARG_NAME "ifpga"
IFPGA_ARG_NAME,
return NULL;
}
+/**
+ * Find AFU by AFU name.
+ *
+ * @param name
+ * A pointer to AFU name string.
+ */
+struct rte_afu_device *
+rte_ifpga_find_afu_by_name(const char *name);
+
/**
* Register a ifpga afu device driver.
*
local: *;
};
+
+DPDK_19.05 {
+ global:
+
+ rte_ifpga_find_afu_by_name;
+
+} DPDK_18.05;