Skip to contentSkip to conversation

crypto/ipsec_mb: handle mp request register error

PATCH Applied Kai Ji 3 participants 3 messages Nov 2, 2022 – Nov 3, 2022 Crypto API

lore
Share & tools
lore

Kai Ji

author
#0 lore raw

PATCH 1/1 crypto/ipsec_mb: handle mp request register error

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

---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/crypto/ipsec_mb/ipsec_mb_private.c +9 -2
index c5540ac8dc..50b789a29b 100644
@@ -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;
 }
 
Signature · 1 line
2.17.1
Tested-by on v1 1/1
#1 lore raw

Hi Kai,

Quoted 16 lines

-----Original Message-----
From: Kai Ji <[email protected]>
Sent: Wednesday, November 2, 2022 11:25 PM
To: [email protected]
Cc: [email protected]; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Burakov, Anatoly <[email protected]>
Subject: [dpdk-dev v1] crypto/ipsec_mb: handle mp request register error

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

---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

<snip>

Applied
#2 lore raw
Quoted 11 lines

Hi Kai,

Quoted 8 lines

Subject: [dpdk-dev v1] crypto/ipsec_mb: handle mp request register error

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

---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Applied to dpdk-next-crypto

Thanks.