From: Bruce Richardson Date: Thu, 8 Oct 2020 09:51:31 +0000 (+0100) Subject: raw/ioat: add xstats tracking for idxd device X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=60927cc650575e25f06e890a21ead2c1001a6bb1;p=dpdk.git raw/ioat: add xstats tracking for idxd device Add update of the relevant stats for the data path functions and point the overall device struct xstats function pointers to the existing ioat functions. At this point, all necessary hooks for supporting the existing unit tests are in place so call them for each device. Signed-off-by: Bruce Richardson Reviewed-by: Kevin Laatz Acked-by: Radu Nicolau --- diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c index bf5edcfddd..9113f8c8e9 100644 --- a/drivers/raw/ioat/idxd_pci.c +++ b/drivers/raw/ioat/idxd_pci.c @@ -107,6 +107,9 @@ static const struct rte_rawdev_ops idxd_pci_ops = { .dev_start = idxd_pci_dev_start, .dev_stop = idxd_pci_dev_stop, .dev_info_get = idxd_dev_info_get, + .xstats_get = ioat_xstats_get, + .xstats_get_names = ioat_xstats_get_names, + .xstats_reset = ioat_xstats_reset, }; /* each portal uses 4 x 4k pages */ diff --git a/drivers/raw/ioat/idxd_vdev.c b/drivers/raw/ioat/idxd_vdev.c index c75ac43175..38218cc1e1 100644 --- a/drivers/raw/ioat/idxd_vdev.c +++ b/drivers/raw/ioat/idxd_vdev.c @@ -36,6 +36,9 @@ static const struct rte_rawdev_ops idxd_vdev_ops = { .dump = idxd_dev_dump, .dev_configure = idxd_dev_configure, .dev_info_get = idxd_dev_info_get, + .xstats_get = ioat_xstats_get, + .xstats_get_names = ioat_xstats_get_names, + .xstats_reset = ioat_xstats_reset, }; static void * diff --git a/drivers/raw/ioat/ioat_rawdev_test.c b/drivers/raw/ioat/ioat_rawdev_test.c index ceeac92ef1..a84be56c47 100644 --- a/drivers/raw/ioat/ioat_rawdev_test.c +++ b/drivers/raw/ioat/ioat_rawdev_test.c @@ -273,5 +273,5 @@ int idxd_rawdev_test(uint16_t dev_id) { rte_rawdev_dump(dev_id, stdout); - return 0; + return ioat_rawdev_test(dev_id); } diff --git a/drivers/raw/ioat/rte_ioat_rawdev_fns.h b/drivers/raw/ioat/rte_ioat_rawdev_fns.h index 89bfc8d21a..d0045d8a49 100644 --- a/drivers/raw/ioat/rte_ioat_rawdev_fns.h +++ b/drivers/raw/ioat/rte_ioat_rawdev_fns.h @@ -184,6 +184,8 @@ struct rte_idxd_user_hdl { */ struct rte_idxd_rawdev { enum rte_ioat_dev_type type; + struct rte_ioat_xstats xstats; + void *portal; /* address to write the batch descriptor */ /* counters to track the batches and the individual op handles */ @@ -369,9 +371,11 @@ __idxd_write_desc(int dev_id, const struct rte_idxd_hw_desc *desc, if (++idxd->next_free_hdl == idxd->hdl_ring_sz) idxd->next_free_hdl = 0; + idxd->xstats.enqueued++; return 1; failed: + idxd->xstats.enqueue_failed++; rte_errno = ENOSPC; return 0; } @@ -429,6 +433,7 @@ __idxd_perform_ops(int dev_id) if (++idxd->next_batch == idxd->batch_ring_sz) idxd->next_batch = 0; + idxd->xstats.started = idxd->xstats.enqueued; } static __rte_always_inline int @@ -466,6 +471,7 @@ __idxd_completed_ops(int dev_id, uint8_t max_ops, idxd->next_ret_hdl = h_idx; + idxd->xstats.completed += n; return n; }