DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kai Ji <kai.ji@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, Kai Ji <kai.ji@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [dpdk-dev v1] crypto/ipsec_mb: handle mp request register error
Date: Thu,  3 Nov 2022 07:25:03 +0800	[thread overview]
Message-ID: <20221102232503.67970-1-kai.ji@intel.com> (raw)

This patch fix the EXIST error handling when calling
rte_mp_action_register().

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
index c5540ac8dc..50b789a29b 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
@@ -5,6 +5,7 @@
 #include <bus_vdev_driver.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
+#include <rte_errno.h>
 
 #include "ipsec_mb_private.h"
 
@@ -46,7 +47,6 @@ static int
 ipsec_mb_mp_request_register(void)
 {
 	RTE_ASSERT(rte_eal_process_type() == RTE_PROC_PRIMARY);
-	IPSEC_MB_LOG(INFO, "Starting register MP IPC request\n");
 	return rte_mp_action_register(IPSEC_MB_MP_MSG,
 				ipsec_mb_ipc_request);
 }
@@ -168,9 +168,16 @@ ipsec_mb_create(struct rte_vdev_device *vdev,
 	IPSEC_MB_LOG(INFO, "IPSec Multi-buffer library version used: %s\n",
 		     imb_get_version_str());
 
-	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		retval = ipsec_mb_mp_request_register();
+		if (retval && (rte_errno == EEXIST))
+			/* Safe to proceed, return 0 */
+			return 0;
 
+		if (retval)
+			IPSEC_MB_LOG(ERR,
+				"IPSec Multi-buffer register MP request failed.\n");
+	}
 	return retval;
 }
 
-- 
2.17.1


             reply	other threads:[~2022-11-02 23:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 23:25 Kai Ji [this message]
2022-11-03  9:20 ` Dooley, Brian
2022-11-03 12:02   ` Akhil Goyal

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=20221102232503.67970-1-kai.ji@intel.com \
    --to=kai.ji@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=pablo.de.lara.guarch@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).