get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/64777/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 64777,
    "url": "http://patchwork.dpdk.org/api/patches/64777/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1579174909-166566-3-git-send-email-pablo.de.lara.guarch@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1579174909-166566-3-git-send-email-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1579174909-166566-3-git-send-email-pablo.de.lara.guarch@intel.com",
    "date": "2020-01-16T11:41:48",
    "name": "[v3,2/3] crypto/kasumi: use IPSec library",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f201196e6e616e6888bc47b5113eb9d36b481eb7",
    "submitter": {
        "id": 9,
        "url": "http://patchwork.dpdk.org/api/people/9/?format=api",
        "name": "Pablo de Lara",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patchwork.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "akhil.goyal@nxp.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1579174909-166566-3-git-send-email-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [
        {
            "id": 8158,
            "url": "http://patchwork.dpdk.org/api/series/8158/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8158",
            "date": "2020-01-16T11:41:46",
            "name": "Use Intel IPSec MB library in Wireless PMDs",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/8158/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/64777/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/64777/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 02EB1A0352;\n\tThu, 16 Jan 2020 12:42:17 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E5CE91C2AF;\n\tThu, 16 Jan 2020 12:42:01 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id 34B8E1C2A4\n for <dev@dpdk.org>; Thu, 16 Jan 2020 12:41:59 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 16 Jan 2020 03:41:59 -0800",
            "from silpixa00399593.ir.intel.com (HELO\n silpixa00399593.ger.corp.intel.com) ([10.237.223.21])\n by orsmga001.jf.intel.com with ESMTP; 16 Jan 2020 03:41:55 -0800"
        ],
        "X-Mailman-Version": "2.1.15",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "akhil.goyal@nxp.com, declan.doherty@intel.com, bruce.richardson@intel.com",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "References": "\n <1578915625-237451-1-git-send-email-pablo.de.lara.guarch@intel.com>\n <1579174909-166566-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Amp-File-Uploaded": "False",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Message-Id": "\n <1579174909-166566-3-git-send-email-pablo.de.lara.guarch@intel.com>",
        "Precedence": "list",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,326,1574150400\"; d=\"scan'208\";a=\"305828791\"",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "Subject": "[dpdk-dev] [PATCH v3 2/3] crypto/kasumi: use IPSec library",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-ExtLoop1": "1",
        "In-Reply-To": "\n <1579174909-166566-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailer": "git-send-email 2.7.5",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Cc": "dev@dpdk.org,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Date": "Thu, 16 Jan 2020 11:41:48 +0000"
    },
    "content": "Link against Intel IPSec Multi-buffer library, which\nadded support for KASUMI-F8 and KASUMI-F9 from version v0.53,\nmoving from libSSO KASUMI library.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n devtools/test-build.sh                     |  6 +--\n doc/guides/cryptodevs/kasumi.rst           | 62 ++++++++++++-----------\n doc/guides/rel_notes/release_20_02.rst     |  5 ++\n drivers/crypto/kasumi/Makefile             | 26 ++++++----\n drivers/crypto/kasumi/kasumi_pmd_private.h | 12 +++--\n drivers/crypto/kasumi/meson.build          | 21 ++++++--\n drivers/crypto/kasumi/rte_kasumi_pmd.c     | 79 +++++++++++++++++-------------\n drivers/crypto/kasumi/rte_kasumi_pmd_ops.c |  8 ++-\n mk/rte.app.mk                              |  2 +-\n 9 files changed, 132 insertions(+), 89 deletions(-)",
    "diff": "diff --git a/devtools/test-build.sh b/devtools/test-build.sh\nindex afa0748..56c744f 100755\n--- a/devtools/test-build.sh\n+++ b/devtools/test-build.sh\n@@ -28,7 +28,6 @@ default_path=$PATH\n # - FLEXRAN_SDK\n # - LIBMUSDK_PATH\n # - LIBSSO_SNOW3G_PATH\n-# - LIBSSO_KASUMI_PATH\n . $(dirname $(readlink -f $0))/load-devel-config\n \n print_usage () {\n@@ -121,7 +120,6 @@ reset_env ()\n \tunset FLEXRAN_SDK\n \tunset LIBMUSDK_PATH\n \tunset LIBSSO_SNOW3G_PATH\n-\tunset LIBSSO_KASUMI_PATH\n \tunset PQOS_INSTALL_PATH\n }\n \n@@ -183,10 +181,10 @@ config () # <directory> <target> <options>\n \t\tsed -ri=\"\"      's,(PMD_AESNI_GCM=)n,\\1y,' $1/.config\n \t\ttest \"$DPDK_DEP_IPSEC_MB\" != y || \\\n \t\tsed -ri=\"\"            's,(PMD_ZUC=)n,\\1y,' $1/.config\n+\t\ttest \"$DPDK_DEP_IPSEC_MB\" != y || \\\n+\t\tsed -ri=\"\"         's,(PMD_KASUMI=)n,\\1y,' $1/.config\n \t\ttest -z \"$LIBSSO_SNOW3G_PATH\" || \\\n \t\tsed -ri=\"\"         's,(PMD_SNOW3G=)n,\\1y,' $1/.config\n-\t\ttest -z \"$LIBSSO_KASUMI_PATH\" || \\\n-\t\tsed -ri=\"\"         's,(PMD_KASUMI=)n,\\1y,' $1/.config\n \t\ttest \"$DPDK_DEP_SSL\" != y || \\\n \t\tsed -ri=\"\"            's,(PMD_CCP=)n,\\1y,' $1/.config\n \t\ttest \"$DPDK_DEP_SSL\" != y || \\\ndiff --git a/doc/guides/cryptodevs/kasumi.rst b/doc/guides/cryptodevs/kasumi.rst\nindex 2265eee..6c86fe2 100644\n--- a/doc/guides/cryptodevs/kasumi.rst\n+++ b/doc/guides/cryptodevs/kasumi.rst\n@@ -1,12 +1,12 @@\n ..  SPDX-License-Identifier: BSD-3-Clause\n-    Copyright(c) 2016 Intel Corporation.\n+    Copyright(c) 2016-2019 Intel Corporation.\n \n KASUMI Crypto Poll Mode Driver\n ===============================\n \n-The KASUMI PMD (**librte_pmd_kasumi**) provides poll mode crypto driver\n-support for utilizing Intel Libsso library, which implements F8 and F9 functions\n-for KASUMI UEA1 cipher and UIA1 hash algorithms.\n+The KASUMI PMD (**librte_pmd_kasumi**) provides poll mode crypto driver support for\n+utilizing `Intel IPSec Multi-buffer library <https://github.com/01org/intel-ipsec-mb>`_\n+which implements F8 and F9 functions for KASUMI UEA1 cipher and UIA1 hash algorithms.\n \n Features\n --------\n@@ -33,33 +33,33 @@ Limitations\n Installation\n ------------\n \n-To build DPDK with the KASUMI_PMD the user is required to download\n-the export controlled ``libsso_kasumi`` library, by registering in\n-`Intel Resource & Design Center <https://www.intel.com/content/www/us/en/design/resource-design-center.html>`_.\n-Once approval has been granted, the user needs to search for\n-*Kasumi F8 F9 3GPP cryptographic algorithms Software Library* to download the\n-library or directly through this `link <https://cdrdv2.intel.com/v1/dl/getContent/575866>`_.\n+To build DPDK with the KASUMI_PMD the user is required to download the multi-buffer\n+library from `here <https://github.com/01org/intel-ipsec-mb>`_\n+and compile it on their user system before building DPDK.\n+The latest version of the library supported by this PMD is v0.53, which\n+can be downloaded from `<https://github.com/01org/intel-ipsec-mb/archive/v0.53.zip>`_.\n+\n After downloading the library, the user needs to unpack and compile it\n-on their system before building DPDK::\n+on their system before building DPDK:\n+\n+.. code-block:: console\n \n-   make\n+    make\n+    make install\n \n-**Note**: When encrypting with KASUMI F8, by default the library\n-encrypts full blocks of 8 bytes, regardless the number of bytes to\n-be encrypted provided (which leads to a possible buffer overflow).\n-To avoid this situation, it is necessary not to pass\n-3GPP_SAFE_BUFFERS as a compilation flag.\n-Also, this is required when using chained operations\n-(cipher-then-auth/auth-then-cipher).\n-For this, in the Makefile of the library, make sure that this flag\n-is commented out::\n+As a reference, the following table shows a mapping between the past DPDK versions\n+and the external crypto libraries supported by them:\n \n-  #EXTRA_CFLAGS  += -D_3GPP_SAFE_BUFFERS\n+.. _table_kasumi_versions:\n \n-**Note**: To build the PMD as a shared library, the libsso_kasumi\n-library must be built as follows::\n+.. table:: DPDK and external crypto library version compatibility\n \n-  make KASUMI_CFLAGS=-DKASUMI_C\n+   =============  ================================\n+   DPDK version   Crypto library version\n+   =============  ================================\n+   16.11 - 19.11  LibSSO KASUMI\n+   20.02+         Multi-buffer library 0.53\n+   =============  ================================\n \n \n Initialization\n@@ -67,12 +67,16 @@ Initialization\n \n In order to enable this virtual crypto PMD, user must:\n \n-* Export the environmental variable LIBSSO_KASUMI_PATH with the path where\n-  the library was extracted (kasumi folder).\n+* Build the multi buffer library (explained in Installation section).\n+\n+* Build DPDK as follows:\n+\n+.. code-block:: console\n \n-* Build the LIBSSO library (explained in Installation section).\n+\tmake config T=x86_64-native-linux-gcc\n+\tsed -i 's,\\(CONFIG_RTE_LIBRTE_PMD_KASUMI\\)=n,\\1=y,' build/.config\n+\tmake\n \n-* Set CONFIG_RTE_LIBRTE_PMD_KASUMI=y in config/common_base.\n \n To use the PMD in an application, user must:\n \ndiff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst\nindex 4216e0b..a3f6154 100644\n--- a/doc/guides/rel_notes/release_20_02.rst\n+++ b/doc/guides/rel_notes/release_20_02.rst\n@@ -63,6 +63,11 @@ New Features\n   * Removed dynamic library limitation, so PMD can be built as a shared\n     object now.\n \n+* **Updated the KASUMI PMD.**\n+\n+  * Transistioned underlying library from libSSO KASUMI to intel-ipsec-mb\n+    library (minimum version required 0.53).\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/crypto/kasumi/Makefile b/drivers/crypto/kasumi/Makefile\nindex 26f5137..c94d6bd 100644\n--- a/drivers/crypto/kasumi/Makefile\n+++ b/drivers/crypto/kasumi/Makefile\n@@ -3,12 +3,6 @@\n \n include $(RTE_SDK)/mk/rte.vars.mk\n \n-ifneq ($(MAKECMDGOALS),clean)\n-ifeq ($(LIBSSO_KASUMI_PATH),)\n-$(error \"Please define LIBSSO_KASUMI_PATH environment variable\")\n-endif\n-endif\n-\n # library name\n LIB = librte_pmd_kasumi.a\n \n@@ -21,14 +15,26 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API\n EXPORT_MAP := rte_pmd_kasumi_version.map\n \n # external library dependencies\n-CFLAGS += -I$(LIBSSO_KASUMI_PATH)\n-CFLAGS += -I$(LIBSSO_KASUMI_PATH)/include\n-CFLAGS += -I$(LIBSSO_KASUMI_PATH)/build\n-LDLIBS += -L$(LIBSSO_KASUMI_PATH)/build -lsso_kasumi\n+LDLIBS += -lIPSec_MB\n LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring\n LDLIBS += -lrte_cryptodev\n LDLIBS += -lrte_bus_vdev\n \n+IMB_HDR = $(shell echo '\\#include <intel-ipsec-mb.h>' | \\\n+\t$(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \\\n+\thead -n1 | cut -d'\"' -f2)\n+\n+# Detect library version\n+IMB_VERSION = $(shell grep -e \"IMB_VERSION_STR\" $(IMB_HDR) | cut -d'\"' -f2)\n+IMB_VERSION_NUM = $(shell grep -e \"IMB_VERSION_NUM\" $(IMB_HDR) | cut -d' ' -f3)\n+\n+ifeq ($(IMB_VERSION),)\n+$(error \"IPSec_MB version >= 0.53 is required\")\n+endif\n+\n+ifeq ($(shell expr $(IMB_VERSION_NUM) \\< 0x3400), 1)\n+$(error \"IPSec_MB version >= 0.53 is required\")\n+endif\n # library source files\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += rte_kasumi_pmd.c\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += rte_kasumi_pmd_ops.c\ndiff --git a/drivers/crypto/kasumi/kasumi_pmd_private.h b/drivers/crypto/kasumi/kasumi_pmd_private.h\nindex 7ac19c5..3b3a695 100644\n--- a/drivers/crypto/kasumi/kasumi_pmd_private.h\n+++ b/drivers/crypto/kasumi/kasumi_pmd_private.h\n@@ -5,7 +5,7 @@\n #ifndef _KASUMI_PMD_PRIVATE_H_\n #define _KASUMI_PMD_PRIVATE_H_\n \n-#include <sso_kasumi.h>\n+#include <intel-ipsec-mb.h>\n \n #define CRYPTODEV_NAME_KASUMI_PMD\tcrypto_kasumi\n /**< KASUMI PMD device name */\n@@ -24,6 +24,8 @@ int kasumi_logtype_driver;\n struct kasumi_private {\n \tunsigned max_nb_queue_pairs;\n \t/**< Max number of queue pairs supported by device */\n+\tMB_MGR *mgr;\n+\t/**< Multi-buffer instance */\n };\n \n /** KASUMI buffer queue pair */\n@@ -45,6 +47,8 @@ struct kasumi_qp {\n \t * by the driver when verifying a digest provided\n \t * by the user (using authentication verify operation)\n \t */\n+\tMB_MGR *mgr;\n+\t/**< Multi-buffer instance */\n } __rte_cache_aligned;\n \n enum kasumi_operation {\n@@ -58,8 +62,8 @@ enum kasumi_operation {\n /** KASUMI private session structure */\n struct kasumi_session {\n \t/* Keys have to be 16-byte aligned */\n-\tsso_kasumi_key_sched_t pKeySched_cipher;\n-\tsso_kasumi_key_sched_t pKeySched_hash;\n+\tkasumi_key_sched_t pKeySched_cipher;\n+\tkasumi_key_sched_t pKeySched_hash;\n \tenum kasumi_operation op;\n \tenum rte_crypto_auth_operation auth_op;\n \tuint16_t cipher_iv_offset;\n@@ -67,7 +71,7 @@ struct kasumi_session {\n \n \n int\n-kasumi_set_session_parameters(struct kasumi_session *sess,\n+kasumi_set_session_parameters(MB_MGR *mgr, struct kasumi_session *sess,\n \t\tconst struct rte_crypto_sym_xform *xform);\n \n \ndiff --git a/drivers/crypto/kasumi/meson.build b/drivers/crypto/kasumi/meson.build\nindex 90a3c4f..7350f41 100644\n--- a/drivers/crypto/kasumi/meson.build\n+++ b/drivers/crypto/kasumi/meson.build\n@@ -1,11 +1,22 @@\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2018 Intel Corporation\n+# Copyright(c) 2018-2020 Intel Corporation\n \n-lib = cc.find_library('sso_kasumi', required: false)\n-if not lib.found() or not cc.has_header('sso_kasumi.h')\n+IMB_required_ver = '0.53.0'\n+lib = cc.find_library('IPSec_MB', required: false)\n+if not lib.found()\n \tbuild = false\n-\treason = 'missing dependency, \"libsso_kasumi\"'\n-\tsubdir_done()\n+\treason = 'missing dependency, \"libIPSec_MB\"'\n+else\n+\t# version comes with quotes, so we split based on \" and take the middle\n+\timb_ver = cc.get_define('IMB_VERSION_STR',\n+\t\tprefix : '#include<intel-ipsec-mb.h>').split('\"')[1]\n+\n+\tif (imb_ver == '') or (imb_ver.version_compare('<' + IMB_required_ver))\n+\t\treason = 'IPSec_MB version >= @0@ is required, found version @1@'.format(\n+\t\t\t\tIMB_required_ver, imb_ver)\n+\t\tbuild = false\n+\tendif\n+\n endif\n \n allow_experimental_apis = true\ndiff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c\nindex d0583ef..baad5b4 100644\n--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c\n+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c\n@@ -54,7 +54,7 @@ kasumi_get_mode(const struct rte_crypto_sym_xform *xform)\n \n /** Parse crypto xform chain and set private session parameters. */\n int\n-kasumi_set_session_parameters(struct kasumi_session *sess,\n+kasumi_set_session_parameters(MB_MGR *mgr, struct kasumi_session *sess,\n \t\tconst struct rte_crypto_sym_xform *xform)\n {\n \tconst struct rte_crypto_sym_xform *auth_xform = NULL;\n@@ -97,7 +97,7 @@ kasumi_set_session_parameters(struct kasumi_session *sess,\n \t\t}\n \n \t\t/* Initialize key */\n-\t\tsso_kasumi_init_f8_key_sched(cipher_xform->cipher.key.data,\n+\t\tIMB_KASUMI_INIT_F8_KEY_SCHED(mgr, cipher_xform->cipher.key.data,\n \t\t\t\t&sess->pKeySched_cipher);\n \t}\n \n@@ -116,7 +116,7 @@ kasumi_set_session_parameters(struct kasumi_session *sess,\n \t\tsess->auth_op = auth_xform->auth.op;\n \n \t\t/* Initialize key */\n-\t\tsso_kasumi_init_f9_key_sched(auth_xform->auth.key.data,\n+\t\tIMB_KASUMI_INIT_F9_KEY_SCHED(mgr, auth_xform->auth.key.data,\n \t\t\t\t&sess->pKeySched_hash);\n \t}\n \n@@ -151,7 +151,7 @@ kasumi_get_session(struct kasumi_qp *qp, struct rte_crypto_op *op)\n \n \t\tsess = (struct kasumi_session *)_sess_private_data;\n \n-\t\tif (unlikely(kasumi_set_session_parameters(sess,\n+\t\tif (unlikely(kasumi_set_session_parameters(qp->mgr, sess,\n \t\t\t\top->sym->xform) != 0)) {\n \t\t\trte_mempool_put(qp->sess_mp, _sess);\n \t\t\trte_mempool_put(qp->sess_mp_priv, _sess_private_data);\n@@ -170,13 +170,13 @@ kasumi_get_session(struct kasumi_qp *qp, struct rte_crypto_op *op)\n \n /** Encrypt/decrypt mbufs with same cipher key. */\n static uint8_t\n-process_kasumi_cipher_op(struct rte_crypto_op **ops,\n-\t\tstruct kasumi_session *session,\n-\t\tuint8_t num_ops)\n+process_kasumi_cipher_op(struct kasumi_qp *qp, struct rte_crypto_op **ops,\n+\t\tstruct kasumi_session *session, uint8_t num_ops)\n {\n \tunsigned i;\n \tuint8_t processed_ops = 0;\n-\tuint8_t *src[num_ops], *dst[num_ops];\n+\tconst void *src[num_ops];\n+\tvoid *dst[num_ops];\n \tuint8_t *iv_ptr;\n \tuint64_t iv[num_ops];\n \tuint32_t num_bytes[num_ops];\n@@ -198,7 +198,7 @@ process_kasumi_cipher_op(struct rte_crypto_op **ops,\n \t}\n \n \tif (processed_ops != 0)\n-\t\tsso_kasumi_f8_n_buffer(&session->pKeySched_cipher, iv,\n+\t\tIMB_KASUMI_F8_N_BUFFER(qp->mgr, &session->pKeySched_cipher, iv,\n \t\t\tsrc, dst, num_bytes, processed_ops);\n \n \treturn processed_ops;\n@@ -206,7 +206,7 @@ process_kasumi_cipher_op(struct rte_crypto_op **ops,\n \n /** Encrypt/decrypt mbuf (bit level function). */\n static uint8_t\n-process_kasumi_cipher_op_bit(struct rte_crypto_op *op,\n+process_kasumi_cipher_op_bit(struct kasumi_qp *qp, struct rte_crypto_op *op,\n \t\tstruct kasumi_session *session)\n {\n \tuint8_t *src, *dst;\n@@ -216,18 +216,16 @@ process_kasumi_cipher_op_bit(struct rte_crypto_op *op,\n \n \toffset_in_bits = op->sym->cipher.data.offset;\n \tsrc = rte_pktmbuf_mtod(op->sym->m_src, uint8_t *);\n-\tif (op->sym->m_dst == NULL) {\n-\t\top->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;\n-\t\tKASUMI_LOG(ERR, \"bit-level in-place not supported\");\n-\t\treturn 0;\n-\t}\n-\tdst = rte_pktmbuf_mtod(op->sym->m_dst, uint8_t *);\n+\tif (op->sym->m_dst == NULL)\n+\t\tdst = src;\n+\telse\n+\t\tdst = rte_pktmbuf_mtod(op->sym->m_dst, uint8_t *);\n \tiv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,\n \t\t\tsession->cipher_iv_offset);\n \tiv = *((uint64_t *)(iv_ptr));\n \tlength_in_bits = op->sym->cipher.data.length;\n \n-\tsso_kasumi_f8_1_buffer_bit(&session->pKeySched_cipher, iv,\n+\tIMB_KASUMI_F8_1_BUFFER_BIT(qp->mgr, &session->pKeySched_cipher, iv,\n \t\t\tsrc, dst, length_in_bits, offset_in_bits);\n \n \treturn 1;\n@@ -262,7 +260,8 @@ process_kasumi_hash_op(struct kasumi_qp *qp, struct rte_crypto_op **ops,\n \n \t\tif (session->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {\n \t\t\tdst = qp->temp_digest;\n-\t\t\tsso_kasumi_f9_1_buffer(&session->pKeySched_hash, src,\n+\t\t\tIMB_KASUMI_F9_1_BUFFER(qp->mgr,\n+\t\t\t\t\t&session->pKeySched_hash, src,\n \t\t\t\t\tnum_bytes, dst);\n \n \t\t\t/* Verify digest. */\n@@ -272,7 +271,8 @@ process_kasumi_hash_op(struct kasumi_qp *qp, struct rte_crypto_op **ops,\n \t\t} else  {\n \t\t\tdst = ops[i]->sym->auth.digest.data;\n \n-\t\t\tsso_kasumi_f9_1_buffer(&session->pKeySched_hash, src,\n+\t\t\tIMB_KASUMI_F9_1_BUFFER(qp->mgr,\n+\t\t\t\t\t&session->pKeySched_hash, src,\n \t\t\t\t\tnum_bytes, dst);\n \t\t}\n \t\tprocessed_ops++;\n@@ -292,7 +292,7 @@ process_ops(struct rte_crypto_op **ops, struct kasumi_session *session,\n \n \tswitch (session->op) {\n \tcase KASUMI_OP_ONLY_CIPHER:\n-\t\tprocessed_ops = process_kasumi_cipher_op(ops,\n+\t\tprocessed_ops = process_kasumi_cipher_op(qp, ops,\n \t\t\t\tsession, num_ops);\n \t\tbreak;\n \tcase KASUMI_OP_ONLY_AUTH:\n@@ -300,14 +300,14 @@ process_ops(struct rte_crypto_op **ops, struct kasumi_session *session,\n \t\t\t\tnum_ops);\n \t\tbreak;\n \tcase KASUMI_OP_CIPHER_AUTH:\n-\t\tprocessed_ops = process_kasumi_cipher_op(ops, session,\n+\t\tprocessed_ops = process_kasumi_cipher_op(qp, ops, session,\n \t\t\t\tnum_ops);\n \t\tprocess_kasumi_hash_op(qp, ops, session, processed_ops);\n \t\tbreak;\n \tcase KASUMI_OP_AUTH_CIPHER:\n \t\tprocessed_ops = process_kasumi_hash_op(qp, ops, session,\n \t\t\t\tnum_ops);\n-\t\tprocess_kasumi_cipher_op(ops, session, processed_ops);\n+\t\tprocess_kasumi_cipher_op(qp, ops, session, processed_ops);\n \t\tbreak;\n \tdefault:\n \t\t/* Operation not supported. */\n@@ -350,21 +350,21 @@ process_op_bit(struct rte_crypto_op *op, struct kasumi_session *session,\n \n \tswitch (session->op) {\n \tcase KASUMI_OP_ONLY_CIPHER:\n-\t\tprocessed_op = process_kasumi_cipher_op_bit(op,\n+\t\tprocessed_op = process_kasumi_cipher_op_bit(qp, op,\n \t\t\t\tsession);\n \t\tbreak;\n \tcase KASUMI_OP_ONLY_AUTH:\n \t\tprocessed_op = process_kasumi_hash_op(qp, &op, session, 1);\n \t\tbreak;\n \tcase KASUMI_OP_CIPHER_AUTH:\n-\t\tprocessed_op = process_kasumi_cipher_op_bit(op, session);\n+\t\tprocessed_op = process_kasumi_cipher_op_bit(qp, op, session);\n \t\tif (processed_op == 1)\n \t\t\tprocess_kasumi_hash_op(qp, &op, session, 1);\n \t\tbreak;\n \tcase KASUMI_OP_AUTH_CIPHER:\n \t\tprocessed_op = process_kasumi_hash_op(qp, &op, session, 1);\n \t\tif (processed_op == 1)\n-\t\t\tprocess_kasumi_cipher_op_bit(op, session);\n+\t\t\tprocess_kasumi_cipher_op_bit(qp, op, session);\n \t\tbreak;\n \tdefault:\n \t\t/* Operation not supported. */\n@@ -533,7 +533,7 @@ cryptodev_kasumi_create(const char *name,\n {\n \tstruct rte_cryptodev *dev;\n \tstruct kasumi_private *internals;\n-\tuint64_t cpu_flags = 0;\n+\tMB_MGR *mgr;\n \n \tdev = rte_cryptodev_pmd_create(name, &vdev->device, init_params);\n \tif (dev == NULL) {\n@@ -541,12 +541,6 @@ cryptodev_kasumi_create(const char *name,\n \t\tgoto init_error;\n \t}\n \n-\t/* Check CPU for supported vector instruction set */\n-\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))\n-\t\tcpu_flags |= RTE_CRYPTODEV_FF_CPU_AVX;\n-\telse\n-\t\tcpu_flags |= RTE_CRYPTODEV_FF_CPU_SSE;\n-\n \tdev->driver_id = cryptodev_driver_id;\n \tdev->dev_ops = rte_kasumi_pmd_ops;\n \n@@ -555,12 +549,24 @@ cryptodev_kasumi_create(const char *name,\n \tdev->enqueue_burst = kasumi_pmd_enqueue_burst;\n \n \tdev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |\n-\t\t\tRTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |\n-\t\t\tcpu_flags;\n+\t\t\tRTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING;\n+\n+\tmgr = alloc_mb_mgr(0);\n+\tif (mgr == NULL)\n+\t\treturn -ENOMEM;\n+\n+\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX)) {\n+\t\tdev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX;\n+\t\tinit_mb_mgr_avx(mgr);\n+\t} else {\n+\t\tdev->feature_flags |= RTE_CRYPTODEV_FF_CPU_SSE;\n+\t\tinit_mb_mgr_sse(mgr);\n+\t}\n \n \tinternals = dev->data->dev_private;\n \n \tinternals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;\n+\tinternals->mgr = mgr;\n \n \treturn 0;\n init_error:\n@@ -598,6 +604,7 @@ cryptodev_kasumi_remove(struct rte_vdev_device *vdev)\n {\n \tstruct rte_cryptodev *cryptodev;\n \tconst char *name;\n+\tstruct kasumi_private *internals;\n \n \tname = rte_vdev_device_name(vdev);\n \tif (name == NULL)\n@@ -607,6 +614,10 @@ cryptodev_kasumi_remove(struct rte_vdev_device *vdev)\n \tif (cryptodev == NULL)\n \t\treturn -ENODEV;\n \n+\tinternals = cryptodev->data->dev_private;\n+\n+\tfree_mb_mgr(internals->mgr);\n+\n \treturn rte_cryptodev_pmd_destroy(cryptodev);\n }\n \ndiff --git a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c\nindex 5ce4953..55fbe00 100644\n--- a/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c\n+++ b/drivers/crypto/kasumi/rte_kasumi_pmd_ops.c\n@@ -195,6 +195,7 @@ kasumi_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n \t\tint socket_id)\n {\n \tstruct kasumi_qp *qp = NULL;\n+\tstruct kasumi_private *internals = dev->data->dev_private;\n \n \t/* Free memory prior to re-allocation if needed. */\n \tif (dev->data->queue_pairs[qp_id] != NULL)\n@@ -217,6 +218,7 @@ kasumi_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n \tif (qp->processed_ops == NULL)\n \t\tgoto qp_setup_cleanup;\n \n+\tqp->mgr = internals->mgr;\n \tqp->sess_mp = qp_conf->mp_session;\n \tqp->sess_mp_priv = qp_conf->mp_session_private;\n \n@@ -246,13 +248,14 @@ kasumi_pmd_sym_session_get_size(struct rte_cryptodev *dev __rte_unused)\n \n /** Configure a KASUMI session from a crypto xform chain */\n static int\n-kasumi_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,\n+kasumi_pmd_sym_session_configure(struct rte_cryptodev *dev,\n \t\tstruct rte_crypto_sym_xform *xform,\n \t\tstruct rte_cryptodev_sym_session *sess,\n \t\tstruct rte_mempool *mempool)\n {\n \tvoid *sess_private_data;\n \tint ret;\n+\tstruct kasumi_private *internals = dev->data->dev_private;\n \n \tif (unlikely(sess == NULL)) {\n \t\tKASUMI_LOG(ERR, \"invalid session struct\");\n@@ -265,7 +268,8 @@ kasumi_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,\n \t\treturn -ENOMEM;\n \t}\n \n-\tret = kasumi_set_session_parameters(sess_private_data, xform);\n+\tret = kasumi_set_session_parameters(internals->mgr,\n+\t\t\t\t\tsess_private_data, xform);\n \tif (ret != 0) {\n \t\tKASUMI_LOG(ERR, \"failed configure session parameters\");\n \ndiff --git a/mk/rte.app.mk b/mk/rte.app.mk\nindex 62724cc..a8163f1 100644\n--- a/mk/rte.app.mk\n+++ b/mk/rte.app.mk\n@@ -270,7 +270,7 @@ endif # CONFIG_RTE_LIBRTE_PMD_QAT\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G)      += -lrte_pmd_snow3g\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G)      += -L$(LIBSSO_SNOW3G_PATH)/build -lsso_snow3g\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI)      += -lrte_pmd_kasumi\n-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI)      += -L$(LIBSSO_KASUMI_PATH)/build -lsso_kasumi\n+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI)      += -lIPSec_MB\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lIPSec_MB\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8\n",
    "prefixes": [
        "v3",
        "2/3"
    ]
}