Show a patch.

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

{
    "id": 41804,
    "url": "http://patches.dpdk.org/api/patches/41804/",
    "web_url": "http://patches.dpdk.org/patch/41804/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180628005304.26544-8-pablo.de.lara.guarch@intel.com>",
    "date": "2018-06-28T00:52:55",
    "name": "[v3,07/16] crypto/mvsam: parse max number of sessions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "756e4b0fca3c6e79fa4de47de8fdb3c455809ee6",
    "submitter": {
        "id": 9,
        "url": "http://patches.dpdk.org/api/people/9/",
        "name": "Pablo de Lara",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patches.dpdk.org/api/users/22/",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41804/mbox/",
    "series": [
        {
            "id": 286,
            "url": "http://patches.dpdk.org/api/series/286/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=286",
            "date": "2018-06-28T00:52:48",
            "name": "Cryptodev API changes for 18.08",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/286/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41804/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41804/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Mailer": "git-send-email 2.14.4",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 493631B05D;\n\tThu, 28 Jun 2018 10:59:48 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 798688E65\n\tfor <dev@dpdk.org>; Thu, 28 Jun 2018 10:59:36 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Jun 2018 01:59:35 -0700",
            "from silpixa00399466.ir.intel.com (HELO\n\tsilpixa00399466.ger.corp.intel.com) ([10.237.223.220])\n\tby orsmga002.jf.intel.com with ESMTP; 28 Jun 2018 01:59:17 -0700"
        ],
        "References": "<20180608220234.10170-1-pablo.de.lara.guarch@intel.com>\n\t<20180628005304.26544-1-pablo.de.lara.guarch@intel.com>",
        "X-Amp-File-Uploaded": "False",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20180628005304.26544-8-pablo.de.lara.guarch@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,282,1526367600\"; d=\"scan'208\";a=\"70667027\"",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "In-Reply-To": "<20180628005304.26544-1-pablo.de.lara.guarch@intel.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "declan.doherty@intel.com, akhil.goyal@nxp.com,\n\tshally.verma@caviumnetworks.com, ravi1.kumar@amd.com,\n\tjerin.jacob@caviumnetworks.com, roy.fan.zhang@intel.com,\n\tfiona.trahe@intel.com, tdu@semihalf.com, jianjay.zhou@huawei.com",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Thu, 28 Jun 2018 01:52:55 +0100",
        "Cc": "dev@dpdk.org,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v3 07/16] crypto/mvsam: parse max number of\n\tsessions"
    },
    "content": "The maximum number of sessions device argument will be removed,\nas most PMDs do not have a limitation on this number.\nTherefore, the MVSAM PMD needs to parse this value internally.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n drivers/crypto/mvsam/rte_mrvl_pmd.c | 132 ++++++++++++++++++++++++++++++++----\n 1 file changed, 120 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c\nindex 1b6029a56..a7f5389ee 100644\n--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c\n+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c\n@@ -16,8 +16,23 @@\n \n #define MRVL_MUSDK_DMA_MEMSIZE 41943040\n \n+#define MRVL_PMD_MAX_NB_SESS_ARG\t\t(\"max_nb_sessions\")\n+#define MRVL_PMD_DEFAULT_MAX_NB_SESSIONS\t2048\n+\n static uint8_t cryptodev_driver_id;\n \n+struct mrvl_pmd_init_params {\n+\tstruct rte_cryptodev_pmd_init_params common;\n+\tuint32_t max_nb_sessions;\n+};\n+\n+const char *mrvl_pmd_valid_params[] = {\n+\tRTE_CRYPTODEV_PMD_NAME_ARG,\n+\tRTE_CRYPTODEV_PMD_MAX_NB_QP_ARG,\n+\tRTE_CRYPTODEV_PMD_SOCKET_ID_ARG,\n+\tMRVL_PMD_MAX_NB_SESS_ARG\n+};\n+\n /**\n  * Flag if particular crypto algorithm is supported by PMD/MUSDK.\n  *\n@@ -691,14 +706,15 @@ mrvl_crypto_pmd_dequeue_burst(void *queue_pair,\n static int\n cryptodev_mrvl_crypto_create(const char *name,\n \t\tstruct rte_vdev_device *vdev,\n-\t\tstruct rte_cryptodev_pmd_init_params *init_params)\n+\t\tstruct mrvl_pmd_init_params *init_params)\n {\n \tstruct rte_cryptodev *dev;\n \tstruct mrvl_crypto_private *internals;\n \tstruct sam_init_params\tsam_params;\n \tint ret;\n \n-\tdev = rte_cryptodev_pmd_create(name, &vdev->device, init_params);\n+\tdev = rte_cryptodev_pmd_create(name, &vdev->device,\n+\t\t\t&init_params->common);\n \tif (dev == NULL) {\n \t\tMRVL_CRYPTO_LOG_ERR(\"failed to create cryptodev vdev\");\n \t\tgoto init_error;\n@@ -718,7 +734,7 @@ cryptodev_mrvl_crypto_create(const char *name,\n \t/* Set vector instructions mode supported */\n \tinternals = dev->data->dev_private;\n \n-\tinternals->max_nb_qpairs = init_params->max_nb_queue_pairs;\n+\tinternals->max_nb_qpairs = init_params->common.max_nb_queue_pairs;\n \tinternals->max_nb_sessions = init_params->max_nb_sessions;\n \n \t/*\n@@ -740,12 +756,99 @@ cryptodev_mrvl_crypto_create(const char *name,\n \n init_error:\n \tMRVL_CRYPTO_LOG_ERR(\n-\t\t\"driver %s: %s failed\", init_params->name, __func__);\n+\t\t\"driver %s: %s failed\", init_params->common.name, __func__);\n \n \tcryptodev_mrvl_crypto_uninit(vdev);\n \treturn -EFAULT;\n }\n \n+/** Parse integer from integer argument */\n+static int\n+parse_integer_arg(const char *key __rte_unused,\n+\t\tconst char *value, void *extra_args)\n+{\n+\tint *i = (int *) extra_args;\n+\n+\t*i = atoi(value);\n+\tif (*i < 0) {\n+\t\tMRVL_CRYPTO_LOG_ERR(\"Argument has to be positive.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/** Parse name */\n+static int\n+parse_name_arg(const char *key __rte_unused,\n+\t\tconst char *value, void *extra_args)\n+{\n+\tstruct rte_cryptodev_pmd_init_params *params = extra_args;\n+\n+\tif (strlen(value) >= RTE_CRYPTODEV_NAME_MAX_LEN - 1) {\n+\t\tMRVL_CRYPTO_LOG_ERR(\"Invalid name %s, should be less than \"\n+\t\t\t\t\"%u bytes.\\n\", value,\n+\t\t\t\tRTE_CRYPTODEV_NAME_MAX_LEN - 1);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tstrncpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);\n+\n+\treturn 0;\n+}\n+\n+static int\n+mrvl_pmd_parse_input_args(struct mrvl_pmd_init_params *params,\n+\t\t\t const char *input_args)\n+{\n+\tstruct rte_kvargs *kvlist = NULL;\n+\tint ret = 0;\n+\n+\tif (params == NULL)\n+\t\treturn -EINVAL;\n+\n+\tif (input_args) {\n+\t\tkvlist = rte_kvargs_parse(input_args,\n+\t\t\t\t\t  mrvl_pmd_valid_params);\n+\t\tif (kvlist == NULL)\n+\t\t\treturn -1;\n+\n+\t\t/* Common VDEV parameters */\n+\t\tret = rte_kvargs_process(kvlist,\n+\t\t\t\t\t RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG,\n+\t\t\t\t\t &parse_integer_arg,\n+\t\t\t\t\t &params->common.max_nb_queue_pairs);\n+\t\tif (ret < 0)\n+\t\t\tgoto free_kvlist;\n+\n+\t\tret = rte_kvargs_process(kvlist,\n+\t\t\t\t\t RTE_CRYPTODEV_PMD_SOCKET_ID_ARG,\n+\t\t\t\t\t &parse_integer_arg,\n+\t\t\t\t\t &params->common.socket_id);\n+\t\tif (ret < 0)\n+\t\t\tgoto free_kvlist;\n+\n+\t\tret = rte_kvargs_process(kvlist,\n+\t\t\t\t\t RTE_CRYPTODEV_PMD_NAME_ARG,\n+\t\t\t\t\t &parse_name_arg,\n+\t\t\t\t\t &params->common);\n+\t\tif (ret < 0)\n+\t\t\tgoto free_kvlist;\n+\n+\t\tret = rte_kvargs_process(kvlist,\n+\t\t\t\t\t MRVL_PMD_MAX_NB_SESS_ARG,\n+\t\t\t\t\t &parse_integer_arg,\n+\t\t\t\t\t params);\n+\t\tif (ret < 0)\n+\t\t\tgoto free_kvlist;\n+\n+\t}\n+\n+free_kvlist:\n+\trte_kvargs_free(kvlist);\n+\treturn ret;\n+}\n+\n /**\n  * Initialize the crypto device.\n  *\n@@ -755,7 +858,18 @@ cryptodev_mrvl_crypto_create(const char *name,\n static int\n cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev)\n {\n-\tstruct rte_cryptodev_pmd_init_params init_params = { };\n+\tstruct mrvl_pmd_init_params init_params = {\n+\t\t.common = {\n+\t\t\t.name = \"\",\n+\t\t\t.private_data_size =\n+\t\t\t\tsizeof(struct mrvl_crypto_private),\n+\t\t\t.max_nb_queue_pairs =\n+\t\t\t\tsam_get_num_inst() * SAM_HW_RING_NUM,\n+\t\t\t.socket_id = rte_socket_id()\n+\t\t},\n+\t\t.max_nb_sessions = MRVL_PMD_DEFAULT_MAX_NB_SESSIONS\n+\t};\n+\n \tconst char *name, *args;\n \tint ret;\n \n@@ -764,13 +878,7 @@ cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev)\n \t\treturn -EINVAL;\n \targs = rte_vdev_device_args(vdev);\n \n-\tinit_params.private_data_size = sizeof(struct mrvl_crypto_private);\n-\tinit_params.max_nb_queue_pairs = sam_get_num_inst() * SAM_HW_RING_NUM;\n-\tinit_params.max_nb_sessions =\n-\t\tRTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS;\n-\tinit_params.socket_id = rte_socket_id();\n-\n-\tret = rte_cryptodev_pmd_parse_input_args(&init_params, args);\n+\tret = mrvl_pmd_parse_input_args(&init_params, args);\n \tif (ret) {\n \t\tRTE_LOG(ERR, PMD,\n \t\t\t\"Failed to parse initialisation arguments[%s]\\n\",\n",
    "prefixes": [
        "v3",
        "07/16"
    ]
}