+#define RTE_REGEXDEV_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
+
+extern int rte_regexdev_logtype;
+
+#define RTE_REGEXDEV_LOG(level, ...) \
+ rte_log(RTE_LOG_ ## level, rte_regexdev_logtype, "" __VA_ARGS__)
+
+/* Macros to check for valid port */
+#define RTE_REGEXDEV_VALID_DEV_ID_OR_ERR_RET(dev_id, retval) do { \
+ if (!rte_regexdev_is_valid_dev(dev_id)) { \
+ RTE_REGEXDEV_LOG(ERR, "Invalid dev_id=%u\n", dev_id); \
+ return retval; \
+ } \
+} while (0)
+
+#define RTE_REGEXDEV_VALID_DEV_ID_OR_RET(dev_id) do { \
+ if (!rte_regexdev_is_valid_dev(dev_id)) { \
+ RTE_REGEXDEV_LOG(ERR, "Invalid dev_id=%u\n", dev_id); \
+ return; \
+ } \
+} while (0)
+
+/**
+ * Check if dev_id is ready.
+ *
+ * @param dev_id
+ * The dev identifier of the RegEx device.
+ *
+ * @return
+ * - 0 if device state is not in ready state.
+ * - 1 if device state is ready state.
+ */
+int rte_regexdev_is_valid_dev(uint16_t dev_id);
+