DPDK patches and discussions
 help / color / mirror / Atom feed
From: Arek Kusztal <arkadiuszx.kusztal@intel.com>
To: dev@dpdk.org
Cc: akhil.goyal@nxp.com, fiona.trahe@intel.com, arkaduszx.kusztal@intel.com
Subject: [dpdk-dev] [PATCH 2/2] cryptodev: add cryptodev trace in multi process function
Date: Wed, 10 Jun 2020 20:53:08 +0200	[thread overview]
Message-ID: <20200610185308.15220-2-arkadiuszx.kusztal@intel.com> (raw)
In-Reply-To: <20200610185308.15220-1-arkadiuszx.kusztal@intel.com>

From: Fiona Trahe <fiona.trahe@intel.com>

This patch adds traces to some Cryptodev functions that are used
in primary/secondary context.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 lib/librte_cryptodev/rte_cryptodev.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 705387b..230c5cf 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -717,8 +717,13 @@ rte_cryptodev_data_alloc(uint8_t dev_id, struct rte_cryptodev_data **data,
 		mz = rte_memzone_reserve(mz_name,
 				sizeof(struct rte_cryptodev_data),
 				socket_id, 0);
-	} else
+		CDEV_LOG_DEBUG("PRIMARY:reserved memzone for %s (%p)",
+				mz_name, mz);
+	} else {
 		mz = rte_memzone_lookup(mz_name);
+		CDEV_LOG_DEBUG("SECONDARY:looked up memzone for %s (%p)",
+				mz_name, mz);
+	}
 
 	if (mz == NULL)
 		return -ENOMEM;
@@ -749,8 +754,14 @@ rte_cryptodev_data_free(uint8_t dev_id, struct rte_cryptodev_data **data)
 	RTE_ASSERT(*data == mz->addr);
 	*data = NULL;
 
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		CDEV_LOG_DEBUG("PRIMARY:free memzone of %s (%p)",
+				mz_name, mz);
 		return rte_memzone_free(mz);
+	} else {
+		CDEV_LOG_DEBUG("SECONDARY:don't free memzone of %s (%p)",
+				mz_name, mz);
+	}
 
 	return 0;
 }
@@ -807,8 +818,15 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
 			cryptodev->data->dev_id = dev_id;
 			cryptodev->data->socket_id = socket_id;
 			cryptodev->data->dev_started = 0;
+			CDEV_LOG_DEBUG("PRIMARY:init data");
 		}
 
+		CDEV_LOG_DEBUG("Data for %s: dev_id %d, socket %d, started %d",
+				cryptodev->data->name,
+				cryptodev->data->dev_id,
+				cryptodev->data->socket_id,
+				cryptodev->data->dev_started);
+
 		/* init user callbacks */
 		TAILQ_INIT(&(cryptodev->link_intr_cbs));
 
-- 
2.1.0


  reply	other threads:[~2020-06-10 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 18:53 [dpdk-dev] [PATCH 1/2] cryptodev: add function to check if qp was setup Arek Kusztal
2020-06-10 18:53 ` Arek Kusztal [this message]
2020-06-11 13:45   ` [dpdk-dev] [PATCH 2/2] cryptodev: add cryptodev trace in multi process function Trahe, Fiona
2020-07-04 20:08     ` Akhil Goyal
2020-06-11 13:42 ` [dpdk-dev] [PATCH 1/2] cryptodev: add function to check if qp was setup Trahe, Fiona

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200610185308.15220-2-arkadiuszx.kusztal@intel.com \
    --to=arkadiuszx.kusztal@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=arkaduszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).