From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4D6FA04C0; Fri, 25 Sep 2020 13:14:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF93A1E978; Fri, 25 Sep 2020 13:10:53 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id BF2D91E981 for ; Fri, 25 Sep 2020 13:10:50 +0200 (CEST) IronPort-SDR: K0HrjIj1yCw/0QtFBc9ulXnRx8CfX5LqjNp9u69zFqX5uNY9Q3szOVOIuKtl/Y9V46hq9Py/T7 sN+z39BT/tSg== X-IronPort-AV: E=McAfee;i="6000,8403,9754"; a="225651748" X-IronPort-AV: E=Sophos;i="5.77,301,1596524400"; d="scan'208";a="225651748" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 04:10:50 -0700 IronPort-SDR: mOOgIZ1KW/4nukvlSc3aSvYtdIfa2LZuT5kWCGlHjqzPhNGDUrLh+DpyuxF1Z+KaMEqzM+NDyP rU7j/nihxLOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,301,1596524400"; d="scan'208";a="455788137" Received: from unknown (HELO silpixa00399126.ir.intel.com) ([10.237.222.4]) by orsmga004.jf.intel.com with ESMTP; 25 Sep 2020 04:10:47 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: patrick.fu@intel.com, Bruce Richardson , Kevin Laatz Date: Fri, 25 Sep 2020 12:09:08 +0100 Message-Id: <20200925110910.284098-24-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925110910.284098-1-bruce.richardson@intel.com> References: <20200721095140.719297-1-bruce.richardson@intel.com> <20200925110910.284098-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 23/25] raw/ioat: add xstats tracking for idxd devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/raw/ioat/idxd_pci.c | 3 +++ drivers/raw/ioat/idxd_vdev.c | 3 +++ drivers/raw/ioat/ioat_rawdev_test.c | 2 +- drivers/raw/ioat/rte_ioat_rawdev_fns.h | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c index 475763e3c..5dfa4ffab 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 5fbbd8e25..3a5cc94b4 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 a9132a8f1..0b172f318 100644 --- a/drivers/raw/ioat/ioat_rawdev_test.c +++ b/drivers/raw/ioat/ioat_rawdev_test.c @@ -264,5 +264,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 89bfc8d21..d0045d8a4 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; } -- 2.25.1