get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64778,
    "url": "http://patchwork.dpdk.org/api/patches/64778/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1579174909-166566-4-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-4-git-send-email-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1579174909-166566-4-git-send-email-pablo.de.lara.guarch@intel.com",
    "date": "2020-01-16T11:41:49",
    "name": "[v3,3/3] crypto/snow3g: use IPSec library",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b9a36771c1cb6d74eeb3d881c023258d726c8a2c",
    "submitter": {
        "id": 9,
        "url": "http://patchwork.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "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": "gakhil@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1579174909-166566-4-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/64778/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/64778/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 54119A0352;\n\tThu, 16 Jan 2020 12:42:25 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BA8A11C23E;\n\tThu, 16 Jan 2020 12:42:03 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by dpdk.org (Postfix) with ESMTP id 67F371C2A7\n for <dev@dpdk.org>; Thu, 16 Jan 2020 12:42:00 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by orsmga102.jf.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:57 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,326,1574150400\"; d=\"scan'208\";a=\"305828795\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "akhil.goyal@nxp.com, declan.doherty@intel.com, bruce.richardson@intel.com",
        "Cc": "dev@dpdk.org,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Date": "Thu, 16 Jan 2020 11:41:49 +0000",
        "Message-Id": "\n <1579174909-166566-4-git-send-email-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.7.5",
        "In-Reply-To": "\n <1579174909-166566-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "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>",
        "Subject": "[dpdk-dev] [PATCH v3 3/3] crypto/snow3g: use IPSec library",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Link against Intel IPSec Multi-buffer library, which\nadded support for SNOW3G-UEA2 and SNOW3G-UIA2 from version v0.53,\nmoving from libSSO SNOW3G library.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n devtools/test-build.sh                     |  4 +-\n doc/guides/cryptodevs/snow3g.rst           | 58 +++++++++++---------\n doc/guides/rel_notes/release_20_02.rst     |  5 ++\n drivers/crypto/snow3g/Makefile             | 29 ++++++----\n drivers/crypto/snow3g/meson.build          | 21 ++++++--\n drivers/crypto/snow3g/rte_snow3g_pmd.c     | 85 ++++++++++++++++++------------\n drivers/crypto/snow3g/rte_snow3g_pmd_ops.c |  8 ++-\n drivers/crypto/snow3g/snow3g_pmd_private.h | 14 +++--\n mk/rte.app.mk                              |  2 +-\n 9 files changed, 140 insertions(+), 86 deletions(-)",
    "diff": "diff --git a/devtools/test-build.sh b/devtools/test-build.sh\nindex 56c744f..7bdd35e 100755\n--- a/devtools/test-build.sh\n+++ b/devtools/test-build.sh\n@@ -27,7 +27,6 @@ default_path=$PATH\n # - DPDK_NOTIFY (notify-send)\n # - FLEXRAN_SDK\n # - LIBMUSDK_PATH\n-# - LIBSSO_SNOW3G_PATH\n . $(dirname $(readlink -f $0))/load-devel-config\n \n print_usage () {\n@@ -119,7 +118,6 @@ reset_env ()\n \tunset ARMV8_CRYPTO_LIB_PATH\n \tunset FLEXRAN_SDK\n \tunset LIBMUSDK_PATH\n-\tunset LIBSSO_SNOW3G_PATH\n \tunset PQOS_INSTALL_PATH\n }\n \n@@ -183,7 +181,7 @@ config () # <directory> <target> <options>\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\ttest \"$DPDK_DEP_IPSEC_MB\" != y || \\\n \t\tsed -ri=\"\"         's,(PMD_SNOW3G=)n,\\1y,' $1/.config\n \t\ttest \"$DPDK_DEP_SSL\" != y || \\\n \t\tsed -ri=\"\"            's,(PMD_CCP=)n,\\1y,' $1/.config\ndiff --git a/doc/guides/cryptodevs/snow3g.rst b/doc/guides/cryptodevs/snow3g.rst\nindex 7cba712..d45bcad 100644\n--- a/doc/guides/cryptodevs/snow3g.rst\n+++ b/doc/guides/cryptodevs/snow3g.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 SNOW 3G Crypto Poll Mode Driver\n ===============================\n \n-The SNOW 3G PMD (**librte_pmd_snow3g**) provides poll mode crypto driver\n-support for utilizing Intel Libsso library, which implements F8 and F9 functions\n-for SNOW 3G UEA2 cipher and UIA2 hash algorithms.\n+The SNOW3G PMD (**librte_snow3g_zuc**) 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 F8 functions for SNOW 3G UEA2 cipher and UIA2 hash algorithms.\n \n Features\n --------\n@@ -32,26 +32,33 @@ Limitations\n Installation\n ------------\n \n-To build DPDK with the SNOW3G_PMD the user is required to download\n-the export controlled ``libsso_snow3g`` 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-*Snow3G F8 F9 3GPP cryptographic algorithms Software Library* to download the\n-library or directly through this `link <https://cdrdv2.intel.com/v1/dl/getContent/575867>`_.\n+To build DPDK with the SNOW3G_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 install\n \n-   make snow3G\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-**Note**: When encrypting with SNOW3G UEA2, by default the library\n-encrypts blocks of 4 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-For this, in the Makefile of the library, make sure that this flag\n-is commented out.::\n+.. _table_zuc_versions:\n \n-  #EXTRA_CFLAGS  += -D_3GPP_SAFE_BUFFERS\n+.. table:: DPDK and external crypto library version compatibility\n+\n+   =============  ================================\n+   DPDK version   Crypto library version\n+   =============  ================================\n+   16.04 - 19.11  LibSSO SNOW3G\n+   20.02+         Multi-buffer library 0.53\n+   =============  ================================\n \n \n Initialization\n@@ -59,12 +66,15 @@ Initialization\n \n In order to enable this virtual crypto PMD, user must:\n \n-* Export the environmental variable LIBSSO_SNOW3G_PATH with the path where\n-  the library was extracted (snow3g folder).\n+* Build the multi buffer library (explained in Installation section).\n+\n+* Build DPDK as follows:\n \n-* Build the LIBSSO_SNOW3G library (explained in Installation section).\n+.. code-block:: console\n \n-* Set CONFIG_RTE_LIBRTE_PMD_SNOW3G=y in config/common_base.\n+\tmake config T=x86_64-native-linux-gcc\n+\tsed -i 's,\\(CONFIG_RTE_LIBRTE_PMD_SNOW3G\\)=n,\\1=y,' build/.config\n+\tmake\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 a3f6154..2532b21 100644\n--- a/doc/guides/rel_notes/release_20_02.rst\n+++ b/doc/guides/rel_notes/release_20_02.rst\n@@ -68,6 +68,11 @@ New Features\n   * Transistioned underlying library from libSSO KASUMI to intel-ipsec-mb\n     library (minimum version required 0.53).\n \n+* **Updated the SNOW3G PMD.**\n+\n+  * Transistioned underlying library from libSSO SNOW3G to intel-ipsec-mb\n+    library (minimum version required 0.53).\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/crypto/snow3g/Makefile b/drivers/crypto/snow3g/Makefile\nindex 4086c57..438119c 100644\n--- a/drivers/crypto/snow3g/Makefile\n+++ b/drivers/crypto/snow3g/Makefile\n@@ -1,14 +1,8 @@\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2016 Intel Corporation\n+# Copyright(c) 2016-2019 Intel Corporation\n \n include $(RTE_SDK)/mk/rte.vars.mk\n \n-ifneq ($(MAKECMDGOALS),clean)\n-ifeq ($(LIBSSO_SNOW3G_PATH),)\n-$(error \"Please define LIBSSO_SNOW3G_PATH environment variable\")\n-endif\n-endif\n-\n # library name\n LIB = librte_pmd_snow3g.a\n \n@@ -21,14 +15,27 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API\n EXPORT_MAP := rte_pmd_snow3g_version.map\n \n # external library dependencies\n-CFLAGS += -I$(LIBSSO_SNOW3G_PATH)\n-CFLAGS += -I$(LIBSSO_SNOW3G_PATH)/include\n-CFLAGS += -I$(LIBSSO_SNOW3G_PATH)/build\n-LDLIBS += -L$(LIBSSO_SNOW3G_PATH)/build -lsso_snow3g\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+\n # library source files\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd.c\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd_ops.c\ndiff --git a/drivers/crypto/snow3g/meson.build b/drivers/crypto/snow3g/meson.build\nindex 0e8742a..9d93cbe 100644\n--- a/drivers/crypto/snow3g/meson.build\n+++ b/drivers/crypto/snow3g/meson.build\n@@ -1,11 +1,22 @@\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2019 Intel Corporation\n+# Copyright(c) 2019-2020 Intel Corporation\n \n-lib = cc.find_library('sso_snow3g', required: false)\n-if not lib.found() or not cc.has_header('sso_snow3g.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_snow3g\"'\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+                reason = '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/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c\nindex 9d07e1a..d72112b 100644\n--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c\n+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c\n@@ -53,7 +53,7 @@ snow3g_get_mode(const struct rte_crypto_sym_xform *xform)\n \n /** Parse crypto xform chain and set private session parameters. */\n int\n-snow3g_set_session_parameters(struct snow3g_session *sess,\n+snow3g_set_session_parameters(MB_MGR *mgr, struct snow3g_session *sess,\n \t\tconst struct rte_crypto_sym_xform *xform)\n {\n \tconst struct rte_crypto_sym_xform *auth_xform = NULL;\n@@ -84,8 +84,6 @@ snow3g_set_session_parameters(struct snow3g_session *sess,\n \t}\n \n \tif (cipher_xform) {\n-\t\tuint8_t cipher_key[SNOW3G_MAX_KEY_SIZE];\n-\n \t\t/* Only SNOW 3G UEA2 supported */\n \t\tif (cipher_xform->cipher.algo != RTE_CRYPTO_CIPHER_SNOW3G_UEA2)\n \t\t\treturn -ENOTSUP;\n@@ -102,14 +100,11 @@ snow3g_set_session_parameters(struct snow3g_session *sess,\n \t\tsess->cipher_iv_offset = cipher_xform->cipher.iv.offset;\n \n \t\t/* Initialize key */\n-\t\tmemcpy(cipher_key, cipher_xform->cipher.key.data,\n-\t\t\t\tcipher_xform->cipher.key.length);\n-\t\tsso_snow3g_init_key_sched(cipher_key, &sess->pKeySched_cipher);\n+\t\tIMB_SNOW3G_INIT_KEY_SCHED(mgr, cipher_xform->cipher.key.data,\n+\t\t\t\t\t&sess->pKeySched_cipher);\n \t}\n \n \tif (auth_xform) {\n-\t\tuint8_t auth_key[SNOW3G_MAX_KEY_SIZE];\n-\n \t\t/* Only SNOW 3G UIA2 supported */\n \t\tif (auth_xform->auth.algo != RTE_CRYPTO_AUTH_SNOW3G_UIA2)\n \t\t\treturn -ENOTSUP;\n@@ -132,12 +127,10 @@ snow3g_set_session_parameters(struct snow3g_session *sess,\n \t\tsess->auth_iv_offset = auth_xform->auth.iv.offset;\n \n \t\t/* Initialize key */\n-\t\tmemcpy(auth_key, auth_xform->auth.key.data,\n-\t\t\t\tauth_xform->auth.key.length);\n-\t\tsso_snow3g_init_key_sched(auth_key, &sess->pKeySched_hash);\n+\t\tIMB_SNOW3G_INIT_KEY_SCHED(mgr, auth_xform->auth.key.data,\n+\t\t\t\t\t&sess->pKeySched_hash);\n \t}\n \n-\n \tsess->op = mode;\n \n \treturn 0;\n@@ -168,7 +161,7 @@ snow3g_get_session(struct snow3g_qp *qp, struct rte_crypto_op *op)\n \n \t\tsess = (struct snow3g_session *)_sess_private_data;\n \n-\t\tif (unlikely(snow3g_set_session_parameters(sess,\n+\t\tif (unlikely(snow3g_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@@ -188,14 +181,15 @@ snow3g_get_session(struct snow3g_qp *qp, struct rte_crypto_op *op)\n \n /** Encrypt/decrypt mbufs with same cipher key. */\n static uint8_t\n-process_snow3g_cipher_op(struct rte_crypto_op **ops,\n+process_snow3g_cipher_op(struct snow3g_qp *qp, struct rte_crypto_op **ops,\n \t\tstruct snow3g_session *session,\n \t\tuint8_t num_ops)\n {\n \tunsigned i;\n \tuint8_t processed_ops = 0;\n-\tuint8_t *src[SNOW3G_MAX_BURST], *dst[SNOW3G_MAX_BURST];\n-\tuint8_t *iv[SNOW3G_MAX_BURST];\n+\tconst void *src[SNOW3G_MAX_BURST];\n+\tvoid *dst[SNOW3G_MAX_BURST];\n+\tconst void *iv[SNOW3G_MAX_BURST];\n \tuint32_t num_bytes[SNOW3G_MAX_BURST];\n \n \tfor (i = 0; i < num_ops; i++) {\n@@ -213,15 +207,16 @@ process_snow3g_cipher_op(struct rte_crypto_op **ops,\n \t\tprocessed_ops++;\n \t}\n \n-\tsso_snow3g_f8_n_buffer(&session->pKeySched_cipher, iv, src, dst,\n-\t\t\tnum_bytes, processed_ops);\n+\tIMB_SNOW3G_F8_N_BUFFER(qp->mgr, &session->pKeySched_cipher, iv,\n+\t\t\tsrc, dst, num_bytes, processed_ops);\n \n \treturn processed_ops;\n }\n \n /** Encrypt/decrypt mbuf (bit level function). */\n static uint8_t\n-process_snow3g_cipher_op_bit(struct rte_crypto_op *op,\n+process_snow3g_cipher_op_bit(struct snow3g_qp *qp,\n+\t\tstruct rte_crypto_op *op,\n \t\tstruct snow3g_session *session)\n {\n \tuint8_t *src, *dst;\n@@ -240,7 +235,7 @@ process_snow3g_cipher_op_bit(struct rte_crypto_op *op,\n \t\t\t\tsession->cipher_iv_offset);\n \tlength_in_bits = op->sym->cipher.data.length;\n \n-\tsso_snow3g_f8_1_buffer_bit(&session->pKeySched_cipher, iv,\n+\tIMB_SNOW3G_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@@ -276,9 +271,9 @@ process_snow3g_hash_op(struct snow3g_qp *qp, struct rte_crypto_op **ops,\n \t\tif (session->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {\n \t\t\tdst = qp->temp_digest;\n \n-\t\t\tsso_snow3g_f9_1_buffer(&session->pKeySched_hash,\n-\t\t\t\t\tiv, src,\n-\t\t\t\t\tlength_in_bits,\tdst);\n+\t\t\tIMB_SNOW3G_F9_1_BUFFER(qp->mgr,\n+\t\t\t\t\t&session->pKeySched_hash,\n+\t\t\t\t\tiv, src, length_in_bits, dst);\n \t\t\t/* Verify digest. */\n \t\t\tif (memcmp(dst, ops[i]->sym->auth.digest.data,\n \t\t\t\t\tSNOW3G_DIGEST_LENGTH) != 0)\n@@ -286,9 +281,9 @@ process_snow3g_hash_op(struct snow3g_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_snow3g_f9_1_buffer(&session->pKeySched_hash,\n-\t\t\t\t\tiv, src,\n-\t\t\t\t\tlength_in_bits, dst);\n+\t\t\tIMB_SNOW3G_F9_1_BUFFER(qp->mgr,\n+\t\t\t\t\t&session->pKeySched_hash,\n+\t\t\t\t\tiv, src, length_in_bits, dst);\n \t\t}\n \t\tprocessed_ops++;\n \t}\n@@ -322,7 +317,7 @@ process_ops(struct rte_crypto_op **ops, struct snow3g_session *session,\n \n \tswitch (session->op) {\n \tcase SNOW3G_OP_ONLY_CIPHER:\n-\t\tprocessed_ops = process_snow3g_cipher_op(ops,\n+\t\tprocessed_ops = process_snow3g_cipher_op(qp, ops,\n \t\t\t\tsession, num_ops);\n \t\tbreak;\n \tcase SNOW3G_OP_ONLY_AUTH:\n@@ -330,14 +325,14 @@ process_ops(struct rte_crypto_op **ops, struct snow3g_session *session,\n \t\t\t\tnum_ops);\n \t\tbreak;\n \tcase SNOW3G_OP_CIPHER_AUTH:\n-\t\tprocessed_ops = process_snow3g_cipher_op(ops, session,\n+\t\tprocessed_ops = process_snow3g_cipher_op(qp, ops, session,\n \t\t\t\tnum_ops);\n \t\tprocess_snow3g_hash_op(qp, ops, session, processed_ops);\n \t\tbreak;\n \tcase SNOW3G_OP_AUTH_CIPHER:\n \t\tprocessed_ops = process_snow3g_hash_op(qp, ops, session,\n \t\t\t\tnum_ops);\n-\t\tprocess_snow3g_cipher_op(ops, session, processed_ops);\n+\t\tprocess_snow3g_cipher_op(qp, ops, session, processed_ops);\n \t\tbreak;\n \tdefault:\n \t\t/* Operation not supported. */\n@@ -380,21 +375,21 @@ process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session,\n \n \tswitch (session->op) {\n \tcase SNOW3G_OP_ONLY_CIPHER:\n-\t\tprocessed_op = process_snow3g_cipher_op_bit(op,\n+\t\tprocessed_op = process_snow3g_cipher_op_bit(qp, op,\n \t\t\t\tsession);\n \t\tbreak;\n \tcase SNOW3G_OP_ONLY_AUTH:\n \t\tprocessed_op = process_snow3g_hash_op(qp, &op, session, 1);\n \t\tbreak;\n \tcase SNOW3G_OP_CIPHER_AUTH:\n-\t\tprocessed_op = process_snow3g_cipher_op_bit(op, session);\n+\t\tprocessed_op = process_snow3g_cipher_op_bit(qp, op, session);\n \t\tif (processed_op == 1)\n \t\t\tprocess_snow3g_hash_op(qp, &op, session, 1);\n \t\tbreak;\n \tcase SNOW3G_OP_AUTH_CIPHER:\n \t\tprocessed_op = process_snow3g_hash_op(qp, &op, session, 1);\n \t\tif (processed_op == 1)\n-\t\t\tprocess_snow3g_cipher_op_bit(op, session);\n+\t\t\tprocess_snow3g_cipher_op_bit(qp, op, session);\n \t\tbreak;\n \tdefault:\n \t\t/* Operation not supported. */\n@@ -550,7 +545,7 @@ cryptodev_snow3g_create(const char *name,\n {\n \tstruct rte_cryptodev *dev;\n \tstruct snow3g_private *internals;\n-\tuint64_t cpu_flags = RTE_CRYPTODEV_FF_CPU_SSE;\n+\tMB_MGR *mgr;\n \n \tdev = rte_cryptodev_pmd_create(name, &vdev->device, init_params);\n \tif (dev == NULL) {\n@@ -566,10 +561,25 @@ cryptodev_snow3g_create(const char *name,\n \tdev->enqueue_burst = snow3g_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_AVX2)) {\n+\t\tdev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2;\n+\t\tinit_mb_mgr_avx2(mgr);\n+\t} else if (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+\tinternals->mgr = mgr;\n \n \tinternals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;\n \n@@ -609,6 +619,7 @@ cryptodev_snow3g_remove(struct rte_vdev_device *vdev)\n {\n \tstruct rte_cryptodev *cryptodev;\n \tconst char *name;\n+\tstruct snow3g_private *internals;\n \n \tname = rte_vdev_device_name(vdev);\n \tif (name == NULL)\n@@ -618,6 +629,10 @@ cryptodev_snow3g_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/snow3g/rte_snow3g_pmd_ops.c b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c\nindex 8778f28..ea76637 100644\n--- a/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c\n+++ b/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c\n@@ -201,6 +201,7 @@ snow3g_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n \t\tint socket_id)\n {\n \tstruct snow3g_qp *qp = NULL;\n+\tstruct snow3g_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@@ -223,6 +224,7 @@ snow3g_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@@ -253,13 +255,14 @@ snow3g_pmd_sym_session_get_size(struct rte_cryptodev *dev __rte_unused)\n \n /** Configure a SNOW 3G session from a crypto xform chain */\n static int\n-snow3g_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,\n+snow3g_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 snow3g_private *internals = dev->data->dev_private;\n \n \tif (unlikely(sess == NULL)) {\n \t\tSNOW3G_LOG(ERR, \"invalid session struct\");\n@@ -272,7 +275,8 @@ snow3g_pmd_sym_session_configure(struct rte_cryptodev *dev __rte_unused,\n \t\treturn -ENOMEM;\n \t}\n \n-\tret = snow3g_set_session_parameters(sess_private_data, xform);\n+\tret = snow3g_set_session_parameters(internals->mgr,\n+\t\t\t\t\tsess_private_data, xform);\n \tif (ret != 0) {\n \t\tSNOW3G_LOG(ERR, \"failed configure session parameters\");\n \ndiff --git a/drivers/crypto/snow3g/snow3g_pmd_private.h b/drivers/crypto/snow3g/snow3g_pmd_private.h\nindex 1fe05eb..2074f3d 100644\n--- a/drivers/crypto/snow3g/snow3g_pmd_private.h\n+++ b/drivers/crypto/snow3g/snow3g_pmd_private.h\n@@ -1,11 +1,11 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2016-2018 Intel Corporation\n+ * Copyright(c) 2016-2019 Intel Corporation\n  */\n \n #ifndef _SNOW3G_PMD_PRIVATE_H_\n #define _SNOW3G_PMD_PRIVATE_H_\n \n-#include <sso_snow3g.h>\n+#include <intel-ipsec-mb.h>\n \n #define CRYPTODEV_NAME_SNOW3G_PMD\tcrypto_snow3g\n /**< SNOW 3G PMD device name */\n@@ -25,6 +25,8 @@ int snow3g_logtype_driver;\n struct snow3g_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 /** SNOW 3G buffer queue pair */\n@@ -46,6 +48,8 @@ struct snow3g_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 snow3g_operation {\n@@ -60,15 +64,15 @@ enum snow3g_operation {\n struct snow3g_session {\n \tenum snow3g_operation op;\n \tenum rte_crypto_auth_operation auth_op;\n-\tsso_snow3g_key_schedule_t pKeySched_cipher;\n-\tsso_snow3g_key_schedule_t pKeySched_hash;\n+\tsnow3g_key_schedule_t pKeySched_cipher;\n+\tsnow3g_key_schedule_t pKeySched_hash;\n \tuint16_t cipher_iv_offset;\n \tuint16_t auth_iv_offset;\n } __rte_cache_aligned;\n \n \n extern int\n-snow3g_set_session_parameters(struct snow3g_session *sess,\n+snow3g_set_session_parameters(MB_MGR *mgr, struct snow3g_session *sess,\n \t\tconst struct rte_crypto_sym_xform *xform);\n \n \ndiff --git a/mk/rte.app.mk b/mk/rte.app.mk\nindex a8163f1..8bf6b3d 100644\n--- a/mk/rte.app.mk\n+++ b/mk/rte.app.mk\n@@ -268,7 +268,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT_SYM)     += -lrte_pmd_qat -lcrypto\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT_ASYM)    += -lrte_pmd_qat -lcrypto\n 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_SNOW3G)      += -lIPSec_MB\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI)      += -lrte_pmd_kasumi\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI)      += -lIPSec_MB\n _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc\n",
    "prefixes": [
        "v3",
        "3/3"
    ]
}