get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43217,
    "url": "https://patches.dpdk.org/api/patches/43217/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1532022005-23009-1-git-send-email-fiona.trahe@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1532022005-23009-1-git-send-email-fiona.trahe@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1532022005-23009-1-git-send-email-fiona.trahe@intel.com",
    "date": "2018-07-19T17:40:05",
    "name": "test/compress: limit max number of segments in sgl test",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fc422d4a3cd7c0dbe43faa7e028f890ec9278a18",
    "submitter": {
        "id": 423,
        "url": "https://patches.dpdk.org/api/people/423/?format=api",
        "name": "Fiona Trahe",
        "email": "fiona.trahe@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "https://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": "https://patches.dpdk.org/project/dpdk/patch/1532022005-23009-1-git-send-email-fiona.trahe@intel.com/mbox/",
    "series": [
        {
            "id": 680,
            "url": "https://patches.dpdk.org/api/series/680/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=680",
            "date": "2018-07-19T17:40:05",
            "name": "test/compress: limit max number of segments in sgl test",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/680/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/43217/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/43217/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 667ED5951;\n\tThu, 19 Jul 2018 19:40:25 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id BF687569B\n\tfor <dev@dpdk.org>; Thu, 19 Jul 2018 19:40:23 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Jul 2018 10:40:21 -0700",
            "from sivswdev01.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.45])\n\tby fmsmga007.fm.intel.com with ESMTP; 19 Jul 2018 10:40:09 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,375,1526367600\"; d=\"scan'208\";a=\"55636470\"",
        "From": "Fiona Trahe <fiona.trahe@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "pablo.de.lara.guarch@intel.com,\n\tfiona.trahe@intel.com",
        "Date": "Thu, 19 Jul 2018 18:40:05 +0100",
        "Message-Id": "<1532022005-23009-1-git-send-email-fiona.trahe@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] test/compress: limit max number of segments in\n\tsgl test",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>\n---\n test/test/test_compressdev.c | 59 ++++++++++++++++++++++++++++++--------------\n 1 file changed, 40 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c\nindex e3bfcd1..8645388 100644\n--- a/test/test/test_compressdev.c\n+++ b/test/test/test_compressdev.c\n@@ -28,7 +28,8 @@\n  */\n #define COMPRESS_BUF_SIZE_RATIO 1.3\n #define NUM_LARGE_MBUFS 16\n-#define SEG_SIZE 256\n+#define SMALL_SEG_SIZE 256\n+#define MAX_SEGS 16\n #define NUM_OPS 16\n #define NUM_MAX_XFORMS 16\n #define NUM_MAX_INFLIGHT_OPS 128\n@@ -111,12 +112,10 @@ testsuite_setup(void)\n \t}\n \n \t/* Create mempool with smaller buffers for SGL testing */\n-\tuint16_t max_segs_per_buf = DIV_CEIL(max_buf_size, SEG_SIZE);\n-\n \tts_params->small_mbuf_pool = rte_pktmbuf_pool_create(\"small_mbuf_pool\",\n-\t\t\tNUM_LARGE_MBUFS * max_segs_per_buf,\n+\t\t\tNUM_LARGE_MBUFS * MAX_SEGS,\n \t\t\tCACHE_SIZE, 0,\n-\t\t\tSEG_SIZE + RTE_PKTMBUF_HEADROOM,\n+\t\t\tSMALL_SEG_SIZE + RTE_PKTMBUF_HEADROOM,\n \t\t\trte_socket_id());\n \tif (ts_params->small_mbuf_pool == NULL) {\n \t\tRTE_LOG(ERR, USER1, \"Small mbuf pool could not be created\\n\");\n@@ -528,30 +527,35 @@ decompress_zlib(struct rte_comp_op *op,\n static int\n prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,\n \t\tuint32_t total_data_size,\n-\t\tstruct rte_mempool *pool)\n+\t\tstruct rte_mempool *small_mbuf_pool,\n+\t\tstruct rte_mempool *large_mbuf_pool,\n+\t\tuint8_t limit_segs_in_sgl)\n {\n \tuint32_t remaining_data = total_data_size;\n-\tuint16_t num_remaining_segs =\n-\t\t\tDIV_CEIL(remaining_data, SEG_SIZE);\n+\tuint16_t num_remaining_segs = DIV_CEIL(remaining_data, SMALL_SEG_SIZE);\n+\tstruct rte_mempool *pool;\n \tstruct rte_mbuf *next_seg;\n \tuint32_t data_size;\n \tchar *buf_ptr;\n \tconst char *data_ptr = test_buf;\n-\tunsigned int i;\n+\tuint16_t i;\n \tint ret;\n \n+\tif (limit_segs_in_sgl != 0 && num_remaining_segs > limit_segs_in_sgl)\n+\t\tnum_remaining_segs = limit_segs_in_sgl - 1;\n+\n \t/*\n \t * Allocate data in the first segment (header) and\n \t * copy data if test buffer is provided\n \t */\n-\tif (remaining_data < SEG_SIZE)\n+\tif (remaining_data < SMALL_SEG_SIZE)\n \t\tdata_size = remaining_data;\n \telse\n-\t\tdata_size = SEG_SIZE;\n+\t\tdata_size = SMALL_SEG_SIZE;\n \tbuf_ptr = rte_pktmbuf_append(head_buf, data_size);\n \tif (buf_ptr == NULL) {\n \t\tRTE_LOG(ERR, USER1,\n-\t\t\t\"Not enough space in the buffer\\n\");\n+\t\t\t\"Not enough space in the 1st buffer\\n\");\n \t\treturn -1;\n \t}\n \n@@ -561,12 +565,26 @@ prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,\n \t\tdata_ptr += data_size;\n \t}\n \tremaining_data -= data_size;\n+\tnum_remaining_segs--;\n \n \t/*\n \t * Allocate the rest of the segments,\n \t * copy the rest of the data and chain the segments.\n \t */\n \tfor (i = 0; i < num_remaining_segs; i++) {\n+\n+\t\tif (i == (num_remaining_segs - 1)) {\n+\t\t\t/* last segment */\n+\t\t\tif (remaining_data > SMALL_SEG_SIZE)\n+\t\t\t\tpool = large_mbuf_pool;\n+\t\t\telse\n+\t\t\t\tpool = small_mbuf_pool;\n+\t\t\tdata_size = remaining_data;\n+\t\t} else {\n+\t\t\tdata_size = SMALL_SEG_SIZE;\n+\t\t\tpool = small_mbuf_pool;\n+\t\t}\n+\n \t\tnext_seg = rte_pktmbuf_alloc(pool);\n \t\tif (next_seg == NULL) {\n \t\t\tRTE_LOG(ERR, USER1,\n@@ -574,10 +592,6 @@ prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,\n \t\t\t\t\"from the mempool\\n\");\n \t\t\treturn -1;\n \t\t}\n-\t\tif (remaining_data < SEG_SIZE)\n-\t\t\tdata_size = remaining_data;\n-\t\telse\n-\t\t\tdata_size = SEG_SIZE;\n \t\tbuf_ptr = rte_pktmbuf_append(next_seg, data_size);\n \t\tif (buf_ptr == NULL) {\n \t\t\tRTE_LOG(ERR, USER1,\n@@ -665,7 +679,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],\n \t\t\tdata_size = strlen(test_bufs[i]) + 1;\n \t\t\tif (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],\n \t\t\t\t\tdata_size,\n-\t\t\t\t\tbuf_pool) < 0)\n+\t\t\t\t\tts_params->small_mbuf_pool,\n+\t\t\t\t\tts_params->large_mbuf_pool,\n+\t\t\t\t\tMAX_SEGS) < 0)\n \t\t\t\tgoto exit;\n \t\t}\n \t} else {\n@@ -691,7 +707,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],\n \t\t\t\tCOMPRESS_BUF_SIZE_RATIO;\n \t\t\tif (prepare_sgl_bufs(NULL, comp_bufs[i],\n \t\t\t\t\tdata_size,\n-\t\t\t\t\tbuf_pool) < 0)\n+\t\t\t\t\tts_params->small_mbuf_pool,\n+\t\t\t\t\tts_params->large_mbuf_pool,\n+\t\t\t\t\tMAX_SEGS) < 0)\n \t\t\t\tgoto exit;\n \t\t}\n \n@@ -880,7 +898,10 @@ test_deflate_comp_decomp(const char * const test_bufs[],\n \t\t\t\t\t(ops_processed[i] + 1);\n \t\t\tdata_size = strlen(test_bufs[priv_data->orig_idx]) + 1;\n \t\t\tif (prepare_sgl_bufs(NULL, uncomp_bufs[i],\n-\t\t\t\t\tdata_size, buf_pool) < 0)\n+\t\t\t\t\tdata_size,\n+\t\t\t\t\tts_params->small_mbuf_pool,\n+\t\t\t\t\tts_params->large_mbuf_pool,\n+\t\t\t\t\tMAX_SEGS) < 0)\n \t\t\t\tgoto exit;\n \t\t}\n \n",
    "prefixes": []
}