get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87431,
    "url": "http://patches.dpdk.org/api/patches/87431/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210127160948.6008-25-lironh@marvell.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": "<20210127160948.6008-25-lironh@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210127160948.6008-25-lironh@marvell.com",
    "date": "2021-01-27T16:09:38",
    "name": "[v3,24/34] net/mvpp2: introduce fixup for fifo overrun",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c50218bfe1283c4b303753c6747c477f034f57fb",
    "submitter": {
        "id": 996,
        "url": "http://patches.dpdk.org/api/people/996/?format=api",
        "name": "Liron Himi",
        "email": "lironh@marvell.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210127160948.6008-25-lironh@marvell.com/mbox/",
    "series": [
        {
            "id": 14976,
            "url": "http://patches.dpdk.org/api/series/14976/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14976",
            "date": "2021-01-27T16:09:14",
            "name": "net/mvpp2: misc updates",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/14976/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/87431/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/87431/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AC83EA052A;\n\tWed, 27 Jan 2021 17:15:06 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0ACA5140F5C;\n\tWed, 27 Jan 2021 17:10:55 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 344C7140F31\n for <dev@dpdk.org>; Wed, 27 Jan 2021 17:10:50 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 10RG5dYn027128; Wed, 27 Jan 2021 08:10:49 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com with ESMTP id 368j1uc3a8-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 27 Jan 2021 08:10:49 -0800",
            "from SC-EXCH01.marvell.com (10.93.176.81) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 27 Jan 2021 08:10:48 -0800",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 27 Jan 2021 08:10:47 -0800",
            "from pt-lxl0023.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 27 Jan 2021 08:10:46 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=u9PzXxnX/tzBWsuz6RjKC+MUv6rnU6lTZ73Q6IO+qf4=;\n b=DZOg5tJQ130Mx334l+WEJMr76DKKZSR0mW5VSOJAiYnx1HK+DRnBqjfjSi2UrgI6cX0X\n nEx3lWpgF5sspaxVLes1Fy/r3myUEqZZvOQfpqyc5xPw3yfYoY51gwAn/XdVe7AXtPOj\n fT1W9+V52I+1AgSiKVTjBxBkshN1r15L5Ezw76kC6NV3FQ5XUKxxTRvfLV4YG6ORn/SG\n C80Za4Q7Rxvt9VHgbh8QziCImXM6qlY9ben7LItRTQ4L3PwVzcfXfwe6tAnt6MJd0RFX\n O9+n3/mX2kMyYVAkXbcRzybV3jBMcXh2pSn/QIvImRgKI6nFI03XO1A2v6A95Lvb/V5w TA==",
        "From": "<lironh@marvell.com>",
        "To": "<jerinj@marvell.com>, <ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, Liron Himi <lironh@marvell.com>",
        "Date": "Wed, 27 Jan 2021 18:09:38 +0200",
        "Message-ID": "<20210127160948.6008-25-lironh@marvell.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20210127160948.6008-1-lironh@marvell.com>",
        "References": "<20210122191925.24308-1-lironh@marvell.com>\n <20210127160948.6008-1-lironh@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737\n definitions=2021-01-27_05:2021-01-27,\n 2021-01-27 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v3 24/34] net/mvpp2: introduce fixup for fifo\n overrun",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "From: Liron Himi <lironh@marvell.com>\n\nCurrently the HW is configured with only one pool which its\nbuffer size may be larger than the rx-fifo-size.\nIn that situation, frame size larger than the fifo-size\nis gets dropped due to fifo overrun.\nthis is cause because the HW works in cut-through mode which\nwaits to have in the fifo at least the amount of bytes as define\nin the smallest pool's buffer size.\n\nThis patch add a dummy pool which its buffer size\nis very small (smaller than 64B frame). this tricks the HW and\nany frame size is gets passed from the FIFO to the PP2.\n\nSigned-off-by: Liron Himi <lironh@marvell.com>\n---\n drivers/net/mvpp2/mrvl_ethdev.c | 92 +++++++++++++++++++++++++++------\n drivers/net/mvpp2/mrvl_ethdev.h |  2 +\n drivers/net/mvpp2/mrvl_qos.c    |  1 +\n 3 files changed, 80 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c\nindex b7211b95fe..5f814f168f 100644\n--- a/drivers/net/mvpp2/mrvl_ethdev.c\n+++ b/drivers/net/mvpp2/mrvl_ethdev.c\n@@ -90,6 +90,8 @@ static int used_bpools[PP2_NUM_PKT_PROC] = {\n static struct pp2_bpool *mrvl_port_to_bpool_lookup[RTE_MAX_ETHPORTS];\n static int mrvl_port_bpool_size[PP2_NUM_PKT_PROC][PP2_BPOOL_NUM_POOLS][RTE_MAX_LCORE];\n static uint64_t cookie_addr_high = MRVL_COOKIE_ADDR_INVALID;\n+static int dummy_pool_id[PP2_NUM_PKT_PROC];\n+struct pp2_bpool *dummy_pool[PP2_NUM_PKT_PROC] = {0};\n \n struct mrvl_ifnames {\n \tconst char *names[PP2_NUM_ETH_PPIO * PP2_NUM_PKT_PROC];\n@@ -189,6 +191,52 @@ static struct {\n \tMRVL_XSTATS_TBL_ENTRY(tx_errors)\n };\n \n+static inline int\n+mrvl_reserve_bit(int *bitmap, int max)\n+{\n+\tint n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap);\n+\n+\tif (n >= max)\n+\t\treturn -1;\n+\n+\t*bitmap |= 1 << n;\n+\n+\treturn n;\n+}\n+\n+static int\n+mrvl_pp2_fixup_init(void)\n+{\n+\tstruct pp2_bpool_params bpool_params;\n+\tchar\t\t\tname[15];\n+\tint\t\t\terr, i;\n+\n+\tmemset(dummy_pool, 0, sizeof(dummy_pool));\n+\tfor (i = 0; i < pp2_get_num_inst(); i++) {\n+\t\tdummy_pool_id[i] = mrvl_reserve_bit(&used_bpools[i],\n+\t\t\t\t\t     PP2_BPOOL_NUM_POOLS);\n+\t\tif (dummy_pool_id[i] < 0) {\n+\t\t\tMRVL_LOG(ERR, \"Can't find free pool\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tmemset(name, 0, sizeof(name));\n+\t\tsnprintf(name, sizeof(name), \"pool-%d:%d\", i, dummy_pool_id[i]);\n+\t\tmemset(&bpool_params, 0, sizeof(bpool_params));\n+\t\tbpool_params.match = name;\n+\t\tbpool_params.buff_len = MRVL_PKT_OFFS;\n+\t\tbpool_params.dummy_short_pool = 1;\n+\t\terr = pp2_bpool_init(&bpool_params, &dummy_pool[i]);\n+\t\tif (err != 0 || !dummy_pool[i]) {\n+\t\t\tMRVL_LOG(ERR, \"BPool init failed!\\n\");\n+\t\t\tused_bpools[i] &= ~(1 << dummy_pool_id[i]);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n /**\n  * Initialize packet processor.\n  *\n@@ -198,7 +246,8 @@ static struct {\n static int\n mrvl_init_pp2(void)\n {\n-\tstruct pp2_init_params init_params;\n+\tstruct pp2_init_params\tinit_params;\n+\tint\t\t\terr;\n \n \tmemset(&init_params, 0, sizeof(init_params));\n \tinit_params.hif_reserved_map = MRVL_MUSDK_HIFS_RESERVED;\n@@ -207,7 +256,32 @@ mrvl_init_pp2(void)\n \tif (mrvl_cfg && mrvl_cfg->pp2_cfg.prs_udfs.num_udfs)\n \t\tmemcpy(&init_params.prs_udfs, &mrvl_cfg->pp2_cfg.prs_udfs,\n \t\t       sizeof(struct pp2_parse_udfs));\n-\treturn pp2_init(&init_params);\n+\terr = pp2_init(&init_params);\n+\tif (err != 0) {\n+\t\tMRVL_LOG(ERR, \"PP2 init failed\");\n+\t\treturn -1;\n+\t}\n+\n+\terr = mrvl_pp2_fixup_init();\n+\tif (err != 0) {\n+\t\tMRVL_LOG(ERR, \"PP2 fixup init failed\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static void\n+mrvl_pp2_fixup_deinit(void)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < PP2_NUM_PKT_PROC; i++) {\n+\t\tif (!dummy_pool[i])\n+\t\t\tcontinue;\n+\t\tpp2_bpool_deinit(dummy_pool[i]);\n+\t\tused_bpools[i] &= ~(1 << dummy_pool_id[i]);\n+\t}\n }\n \n /**\n@@ -219,6 +293,7 @@ mrvl_init_pp2(void)\n static void\n mrvl_deinit_pp2(void)\n {\n+\tmrvl_pp2_fixup_deinit();\n \tpp2_deinit();\n }\n \n@@ -275,19 +350,6 @@ mrvl_get_bpool_size(int pp2_id, int pool_id)\n \treturn size;\n }\n \n-static inline int\n-mrvl_reserve_bit(int *bitmap, int max)\n-{\n-\tint n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap);\n-\n-\tif (n >= max)\n-\t\treturn -1;\n-\n-\t*bitmap |= 1 << n;\n-\n-\treturn n;\n-}\n-\n static int\n mrvl_init_hif(int core_id)\n {\ndiff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethdev.h\nindex 27d34ecfe0..b0cdddd15e 100644\n--- a/drivers/net/mvpp2/mrvl_ethdev.h\n+++ b/drivers/net/mvpp2/mrvl_ethdev.h\n@@ -196,6 +196,8 @@ extern int mrvl_logtype;\n \trte_log(RTE_LOG_ ## level, mrvl_logtype, \"%s(): \" fmt \"\\n\", \\\n \t\t__func__, ##args)\n \n+extern struct pp2_bpool *dummy_pool[PP2_NUM_PKT_PROC];\n+\n /**\n  * Convert string to uint32_t with extra checks for result correctness.\n  *\ndiff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c\nindex 310fd73840..a3add540b8 100644\n--- a/drivers/net/mvpp2/mrvl_qos.c\n+++ b/drivers/net/mvpp2/mrvl_qos.c\n@@ -881,6 +881,7 @@ setup_tc(struct pp2_ppio_tc_params *param, uint8_t inqs,\n \n \tparam->pkt_offset = MRVL_PKT_OFFS;\n \tparam->pools[0][0] = bpool;\n+\tparam->pools[0][1] = dummy_pool[bpool->pp2_id];\n \tparam->default_color = color;\n \n \tinq_params = rte_zmalloc_socket(\"inq_params\",\n",
    "prefixes": [
        "v3",
        "24/34"
    ]
}