+ if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+#if IMB_VERSION(1, 1, 0) > IMB_VERSION_NUM
+ IPSEC_MB_LOG(ERR, "The intel-ipsec-mb version (%s) does not support multiprocess,"
+ "the minimum version required for this feature is %s.",
+ IMB_VERSION_STR, IMB_MP_REQ_VER_STR);
+ return -EINVAL;
+#endif
+ if (dev->data->queue_pairs[qp_id] != NULL)
+ qp = dev->data->queue_pairs[qp_id];
+ } else {
+ /* Free memory prior to re-allocation if needed. */
+ if (dev->data->queue_pairs[qp_id] != NULL)
+ ipsec_mb_qp_release(dev, qp_id);
+
+ qp_size = sizeof(*qp) + pmd_data->qp_priv_size;
+ /* Allocate the queue pair data structure. */
+ qp = rte_zmalloc_socket("IPSEC PMD Queue Pair", qp_size,
+ RTE_CACHE_LINE_SIZE, socket_id);
+ if (qp == NULL)
+ return -ENOMEM;
+ }
+
+#if IMB_VERSION(1, 1, 0) > IMB_VERSION_NUM
+ qp->mb_mgr = alloc_init_mb_mgr();
+#else
+ char mz_name[IPSEC_MB_MAX_MZ_NAME];
+ snprintf(mz_name, sizeof(mz_name), "IMB_MGR_DEV_%d_QP_%d",
+ dev->data->dev_id, qp_id);
+ qp->mb_mgr = ipsec_mb_alloc_mgr_from_memzone(&(qp->mb_mgr_mz),
+ mz_name);
+#endif
+ if (qp->mb_mgr == NULL) {
+ ret = -ENOMEM;
+ goto qp_setup_cleanup;
+ }