DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tomasz Duszynski <tdu@semihalf.com>
To: dev@dpdk.org
Cc: Tomasz Duszynski <tdu@semihalf.com>
Subject: [dpdk-dev] [PATCH 3/3] crypto/mrvl: print message if dma mem is initialized
Date: Tue, 17 Oct 2017 09:17:48 +0200	[thread overview]
Message-ID: <1508224668-30354-4-git-send-email-tdu@semihalf.com> (raw)
In-Reply-To: <1508224668-30354-1-git-send-email-tdu@semihalf.com>

In case MUSDK dma memory has been already initialized by a different
driver (and perhaps do the different size) mv_sys_dma_mem_init()
will return -EEXIST error code.

Printing extra message makes it clear.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
---
 drivers/crypto/mrvl/rte_mrvl_pmd.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/mrvl/rte_mrvl_pmd.c b/drivers/crypto/mrvl/rte_mrvl_pmd.c
index 0c540fa..e2bbfe0 100644
--- a/drivers/crypto/mrvl/rte_mrvl_pmd.c
+++ b/drivers/crypto/mrvl/rte_mrvl_pmd.c
@@ -41,9 +41,7 @@
 
 #include "rte_mrvl_pmd_private.h"
 
-#ifndef RTE_MRVL_MUSDK_DMA_MEMSIZE
-#define RTE_MRVL_MUSDK_DMA_MEMSIZE 41943040
-#endif
+#define MRVL_MUSDK_DMA_MEMSIZE 41943040
 
 static uint8_t cryptodev_driver_id;
 
@@ -766,9 +764,14 @@ cryptodev_mrvl_crypto_create(const char *name,
 	 * ret == -EEXIST is correct, it means DMA
 	 * has been already initialized.
 	 */
-	ret = mv_sys_dma_mem_init(RTE_MRVL_MUSDK_DMA_MEMSIZE);
-	if ((ret < 0) && (ret != -EEXIST))
-		return ret;
+	ret = mv_sys_dma_mem_init(MRVL_MUSDK_DMA_MEMSIZE);
+	if (ret < 0) {
+		if (ret != -EEXIST)
+			return ret;
+
+		MRVL_CRYPTO_LOG_INFO(
+			"DMA memory has been already initialized by a different driver.");
+	}
 
 	sam_params.max_num_sessions = internals->max_nb_sessions;
 
-- 
2.7.4

  parent reply	other threads:[~2017-10-17  7:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  7:17 [dpdk-dev] [PATCH 0/3] crypto/mrvl: updates and bugfixes Tomasz Duszynski
2017-10-17  7:17 ` [dpdk-dev] [PATCH 1/3] crypto/mrvl: fix driver name in debug log Tomasz Duszynski
2017-10-17  7:17 ` [dpdk-dev] [PATCH 2/3] crypto/mrvl: fix enabling debug logs Tomasz Duszynski
2017-10-17  7:17 ` Tomasz Duszynski [this message]
2017-10-17 11:56 ` [dpdk-dev] [PATCH 0/3] crypto/mrvl: updates and bugfixes De Lara Guarch, Pablo

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=1508224668-30354-4-git-send-email-tdu@semihalf.com \
    --to=tdu@semihalf.com \
    --cc=dev@dpdk.org \
    /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).