get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 16248,
    "url": "http://patches.dpdk.org/api/patches/16248/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1475169509-19247-1-git-send-email-fiona.trahe@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<1475169509-19247-1-git-send-email-fiona.trahe@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1475169509-19247-1-git-send-email-fiona.trahe@intel.com",
    "date": "2016-09-29T17:18:29",
    "name": "[dpdk-dev,v2] app/test: remove hard-coding of crypto num qps",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "93d826dcc3f9486bcc40ffbeb105c6acf71041a0",
    "submitter": {
        "id": 423,
        "url": "http://patches.dpdk.org/api/people/423/?format=api",
        "name": "Fiona Trahe",
        "email": "fiona.trahe@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patches.dpdk.org/api/users/22/?format=api",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1475169509-19247-1-git-send-email-fiona.trahe@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/16248/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/16248/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id BFA7D5597;\n\tThu, 29 Sep 2016 19:29:58 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 8221A2C39\n\tfor <dev@dpdk.org>; Thu, 29 Sep 2016 19:29:56 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP; 29 Sep 2016 10:29:55 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 29 Sep 2016 10:29:54 -0700",
            "from linux.site (sisvmlab045.ir.intel.com [10.237.216.52])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tu8THTrC4021411; Thu, 29 Sep 2016 18:29:53 +0100",
            "by linux.site (Postfix, from userid 11342333)\n\tid 64FCAE3BC3; Thu, 29 Sep 2016 18:19:03 +0100 (IST)"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.31,268,1473145200\"; d=\"scan'208\";a=\"15112257\"",
        "From": "Fiona Trahe <fiona.trahe@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com,\n\tAkhil Goyal <akhil.goyal@nxp.com>",
        "Date": "Thu, 29 Sep 2016 18:18:29 +0100",
        "Message-Id": "<1475169509-19247-1-git-send-email-fiona.trahe@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<20160926163300.22990-1-akhil.goyal@nxp.com>",
        "References": "<20160926163300.22990-1-akhil.goyal@nxp.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2] app/test: remove hard-coding of crypto num qps",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "ts_params->conf.nb_queue_pairs should not be hard coded with device\nspecific number. It should be retrieved from the device info.\nAny test which changes it should restore it to orig value.\n\nAlso related cleanup of test code setting number and size of\nqueue-pairs on a device, e.g.\n* Removed irrelevant β€œfor” loop – was hardcoded to only loop once.\n* Removed obsolete comment re inability to free and re-allocate queu memory\n  and obsolete workaround for it which used to create maximum size queues.\n\nAnd added freeing of ring memory on queue-pair release in aesni_mb PMD, \nelse releasing and setting up queue-pair of a different size fails.\n\nSigned-off-by: Akhil Goyal <akhil.goyal@nxp.com>\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\n---\n\nv2:\n  Fix for broken QAT PMD unit tests exposed by v1\n  i.e. In test_device_configure_invalid_queue_pair_ids() after running tests \n  for invalid values restore original nb_queue_pairs.\n  Also cleanup of test code setting number and size of queue-pairs on a device\n  Also fix for aesni_mb PMD not freeing ring memory on qp release\n\n app/test/test_cryptodev.c                      | 54 ++++++++++----------------\n app/test/test_cryptodev_perf.c                 | 19 +--------\n drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 10 ++++-\n 3 files changed, 30 insertions(+), 53 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex d960d72..cbcfb3f 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -307,37 +307,27 @@ testsuite_setup(void)\n \t\treturn TEST_FAILED;\n \n \t/* Set up all the qps on the first of the valid devices found */\n-\tfor (i = 0; i < 1; i++) {\n-\t\tdev_id = ts_params->valid_devs[i];\n+\tdev_id = ts_params->valid_devs[0];\n \n-\t\trte_cryptodev_info_get(dev_id, &info);\n+\trte_cryptodev_info_get(dev_id, &info);\n \n-\t\t/*\n-\t\t * Since we can't free and re-allocate queue memory always set\n-\t\t * the queues on this device up to max size first so enough\n-\t\t * memory is allocated for any later re-configures needed by\n-\t\t * other tests\n-\t\t */\n-\n-\t\tts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;\n-\t\tts_params->conf.socket_id = SOCKET_ID_ANY;\n-\t\tts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;\n+\tts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;\n+\tts_params->conf.socket_id = SOCKET_ID_ANY;\n+\tts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;\n \n-\t\tTEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,\n-\t\t\t\t&ts_params->conf),\n-\t\t\t\t\"Failed to configure cryptodev %u with %u qps\",\n-\t\t\t\tdev_id, ts_params->conf.nb_queue_pairs);\n+\tTEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,\n+\t\t\t&ts_params->conf),\n+\t\t\t\"Failed to configure cryptodev %u with %u qps\",\n+\t\t\tdev_id, ts_params->conf.nb_queue_pairs);\n \n-\t\tts_params->qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT;\n+\tts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;\n \n-\t\tfor (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {\n-\t\t\tTEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(\n-\t\t\t\t\tdev_id, qp_id, &ts_params->qp_conf,\n-\t\t\t\t\trte_cryptodev_socket_id(dev_id)),\n-\t\t\t\t\t\"Failed to setup queue pair %u on \"\n-\t\t\t\t\t\"cryptodev %u\",\n-\t\t\t\t\tqp_id, dev_id);\n-\t\t}\n+\tfor (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {\n+\t\tTEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(\n+\t\t\tdev_id, qp_id, &ts_params->qp_conf,\n+\t\t\trte_cryptodev_socket_id(dev_id)),\n+\t\t\t\"Failed to setup queue pair %u on cryptodev %u\",\n+\t\t\tqp_id, dev_id);\n \t}\n \n \treturn TEST_SUCCESS;\n@@ -372,7 +362,6 @@ ut_setup(void)\n \tmemset(ut_params, 0, sizeof(*ut_params));\n \n \t/* Reconfigure device to default parameters */\n-\tts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;\n \tts_params->conf.socket_id = SOCKET_ID_ANY;\n \tts_params->conf.session_mp.nb_objs = DEFAULT_NUM_OPS_INFLIGHT;\n \n@@ -381,12 +370,6 @@ ut_setup(void)\n \t\t\t\"Failed to configure cryptodev %u\",\n \t\t\tts_params->valid_devs[0]);\n \n-\t/*\n-\t * Now reconfigure queues to size we actually want to use in this\n-\t * test suite.\n-\t */\n-\tts_params->qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;\n-\n \tfor (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs ; qp_id++) {\n \t\tTEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(\n \t\t\tts_params->valid_devs[0], qp_id,\n@@ -396,7 +379,6 @@ ut_setup(void)\n \t\t\tqp_id, ts_params->valid_devs[0]);\n \t}\n \n-\n \trte_cryptodev_stats_reset(ts_params->valid_devs[0]);\n \n \t/* Start the device */\n@@ -490,6 +472,7 @@ static int\n test_device_configure_invalid_queue_pair_ids(void)\n {\n \tstruct crypto_testsuite_params *ts_params = &testsuite_params;\n+\tuint16_t orig_nb_qps = ts_params->conf.nb_queue_pairs;\n \n \t/* Stop the device in case it's started so it can be configured */\n \trte_cryptodev_stop(ts_params->valid_devs[0]);\n@@ -544,6 +527,9 @@ test_device_configure_invalid_queue_pair_ids(void)\n \t\t\tts_params->valid_devs[0],\n \t\t\tts_params->conf.nb_queue_pairs);\n \n+\t/* revert to original testsuite value */\n+\tts_params->conf.nb_queue_pairs = orig_nb_qps;\n+\n \treturn TEST_SUCCESS;\n }\n \ndiff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c\nindex 6af0896..323995e 100644\n--- a/app/test/test_cryptodev_perf.c\n+++ b/app/test/test_cryptodev_perf.c\n@@ -386,14 +386,12 @@ testsuite_setup(void)\n \n \t/*\n \t * Using Crypto Device Id 0 by default.\n-\t * Since we can't free and re-allocate queue memory always set the queues\n-\t * on this device up to max size first so enough memory is allocated for\n-\t * any later re-configures needed by other tests\n+\t * Set up all the qps on this device.\n \t */\n \n \trte_cryptodev_info_get(ts_params->dev_id, &info);\n \n-\tts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE;\n+\tts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs;\n \tts_params->conf.socket_id = SOCKET_ID_ANY;\n \tts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions;\n \n@@ -402,19 +400,6 @@ testsuite_setup(void)\n \t\t\t\"Failed to configure cryptodev %u\",\n \t\t\tts_params->dev_id);\n \n-\n-\tts_params->qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT;\n-\n-\tfor (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs ; qp_id++) {\n-\t\tTEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(\n-\t\t\tts_params->dev_id, qp_id,\n-\t\t\t&ts_params->qp_conf,\n-\t\t\trte_cryptodev_socket_id(ts_params->dev_id)),\n-\t\t\t\"Failed to setup queue pair %u on cryptodev %u\",\n-\t\t\tqp_id, ts_params->dev_id);\n-\t}\n-\n-\t/*Now reconfigure queues to size we actually want to use in this testsuite.*/\n \tts_params->qp_conf.nb_descriptors = PERF_NUM_OPS_INFLIGHT;\n \tfor (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs ; qp_id++) {\n \ndiff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c\nindex d3c46ac..3d49e2a 100644\n--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c\n+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c\n@@ -311,8 +311,14 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,\n static int\n aesni_mb_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)\n {\n-\tif (dev->data->queue_pairs[qp_id] != NULL) {\n-\t\trte_free(dev->data->queue_pairs[qp_id]);\n+\tstruct aesni_mb_qp *qp = dev->data->queue_pairs[qp_id];\n+\tstruct rte_ring *r = NULL;\n+\n+\tif (qp != NULL) {\n+\t\tr = rte_ring_lookup(qp->name);\n+\t\tif (r)\n+\t\t\trte_ring_free(r);\n+\t\trte_free(qp);\n \t\tdev->data->queue_pairs[qp_id] = NULL;\n \t}\n \treturn 0;\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}