diff mbox

[dpdk-dev,3/3] crypto/mrvl: print message if dma mem is initialized

Message ID 1508224668-30354-4-git-send-email-tdu@semihalf.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Tomasz Duszynski Oct. 17, 2017, 7:17 a.m. UTC
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 mbox

Patch

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;