diff options
| author | Nicolas Chautru <[email protected]> | 2022-10-04 10:16:55 -0700 |
|---|---|---|
| committer | Akhil Goyal <[email protected]> | 2022-10-07 08:44:58 +0200 |
| commit | 4f08028c5e24aedcddc044d139893203d07ffd8f (patch) | |
| tree | 82bb013adabf1ddb763b300552aa20e4e7e9396a /lib/bbdev | |
| parent | 9d3933252d86f8428eb3db1dc37f912e0b39b083 (diff) | |
bbdev: expose queue related warning and status
Added parameters in rte_bbdev_queue_data to expose information
with regards to any queue related failure and warning
which cannot be supported in existing API.
Signed-off-by: Nicolas Chautru <[email protected]>
Acked-by: Maxime Coquelin <[email protected]>
Acked-by: Akhil Goyal <[email protected]>
Diffstat (limited to 'lib/bbdev')
| -rw-r--r-- | lib/bbdev/rte_bbdev.c | 19 | ||||
| -rw-r--r-- | lib/bbdev/rte_bbdev.h | 44 | ||||
| -rw-r--r-- | lib/bbdev/version.map | 1 |
3 files changed, 64 insertions, 0 deletions
diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index d2380ad2a8..453e5747b6 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -721,6 +721,8 @@ get_stats_from_queues(struct rte_bbdev *dev, struct rte_bbdev_stats *stats) stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; } rte_bbdev_log_debug("Got stats on %u", dev->data->dev_id); } @@ -1163,3 +1165,20 @@ rte_bbdev_device_status_str(enum rte_bbdev_device_status status) rte_bbdev_log(ERR, "Invalid device status"); return NULL; } + +const char * +rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status) +{ + static const char * const enq_sta_string[] = { + "RTE_BBDEV_ENQ_STATUS_NONE", + "RTE_BBDEV_ENQ_STATUS_QUEUE_FULL", + "RTE_BBDEV_ENQ_STATUS_RING_FULL", + "RTE_BBDEV_ENQ_STATUS_INVALID_OP", + }; + + if (status < sizeof(enq_sta_string) / sizeof(char *)) + return enq_sta_string[status]; + + rte_bbdev_log(ERR, "Invalid enqueue status"); + return NULL; +} diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index 0fe41ab8ce..1eb5fa532b 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -35,6 +35,13 @@ extern "C" { #define RTE_BBDEV_MAX_DEVS 128 /**< Max number of devices */ #endif +/* + * Maximum size to be used to manage the enum rte_bbdev_enqueue_status + * including padding for future enum insertion. + * The enum values must be explicitly kept smaller or equal to this padded maximum size. + */ +#define RTE_BBDEV_ENQ_STATUS_SIZE_MAX 6 + /** Flags indicate current state of BBDEV device */ enum rte_bbdev_state { RTE_BBDEV_UNUSED, @@ -224,6 +231,22 @@ int rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id); /** + * Flags to indicate the reason why a previous enqueue may not have + * consumed all requested operations. + * In case of multiple reasons the latter supersedes a previous one. + * The related macro RTE_BBDEV_ENQ_STATUS_SIZE_MAX can be used + * as an absolute maximum for notably sizing array + * while allowing for future enumeration insertion. + */ +enum rte_bbdev_enqueue_status { + RTE_BBDEV_ENQ_STATUS_NONE, /**< Nothing to report. */ + RTE_BBDEV_ENQ_STATUS_QUEUE_FULL, /**< Not enough room in queue. */ + RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough room in ring. */ + RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation was rejected as invalid. */ + /* Note: RTE_BBDEV_ENQ_STATUS_SIZE_MAX must be larger or equal to maximum enum value. */ +}; + +/** * Flags to indicate the status of the device. */ enum rte_bbdev_device_status { @@ -246,6 +269,12 @@ struct rte_bbdev_stats { uint64_t enqueue_err_count; /** Total error count on operations dequeued */ uint64_t dequeue_err_count; + /** Total warning count on operations enqueued. */ + uint64_t enqueue_warn_count; + /** Total warning count on operations dequeued. */ + uint64_t dequeue_warn_count; + /** Total enqueue status count based on *rte_bbdev_enqueue_status* enum. */ + uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_SIZE_MAX]; /** CPU cycles consumed by the (HW/SW) accelerator device to offload * the enqueue request to its internal queues. * - For a HW device this is the cycles consumed in MMIO write @@ -386,6 +415,7 @@ struct rte_bbdev_queue_data { void *queue_private; /**< Driver-specific per-queue data */ struct rte_bbdev_queue_conf conf; /**< Current configuration */ struct rte_bbdev_stats queue_stats; /**< Queue statistics */ + enum rte_bbdev_enqueue_status enqueue_status; /**< Enqueue status when op is rejected */ bool started; /**< Queue state */ }; @@ -938,6 +968,20 @@ __rte_experimental const char* rte_bbdev_device_status_str(enum rte_bbdev_device_status status); +/** + * Convert queue status from enum to string. + * + * @param status + * Queue status as enum. + * + * @returns + * Queue status as string or NULL if op_type is invalid. + * + */ +__rte_experimental +const char* +rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status); + #ifdef __cplusplus } #endif diff --git a/lib/bbdev/version.map b/lib/bbdev/version.map index db178917e2..d0bb835255 100644 --- a/lib/bbdev/version.map +++ b/lib/bbdev/version.map @@ -47,6 +47,7 @@ EXPERIMENTAL { rte_bbdev_dequeue_fft_ops; rte_bbdev_device_status_str; rte_bbdev_enqueue_fft_ops; + rte_bbdev_enqueue_status_str; rte_bbdev_fft_op_alloc_bulk; rte_bbdev_fft_op_free_bulk; }; |
