get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105367,
    "url": "http://patches.dpdk.org/api/patches/105367/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211223152519.758827-1-vladimir.medvedkin@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": "<20211223152519.758827-1-vladimir.medvedkin@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211223152519.758827-1-vladimir.medvedkin@intel.com",
    "date": "2021-12-23T15:25:17",
    "name": "app/test-fib: fix possible division by zero",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "05f79551da69122d1fde2e45e8fbb0dacb94e88a",
    "submitter": {
        "id": 1216,
        "url": "http://patches.dpdk.org/api/people/1216/?format=api",
        "name": "Vladimir Medvedkin",
        "email": "vladimir.medvedkin@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211223152519.758827-1-vladimir.medvedkin@intel.com/mbox/",
    "series": [
        {
            "id": 21017,
            "url": "http://patches.dpdk.org/api/series/21017/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21017",
            "date": "2021-12-23T15:25:17",
            "name": "app/test-fib: fix possible division by zero",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/21017/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/105367/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/105367/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 6264EA0350;\n\tThu, 23 Dec 2021 16:25:33 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DFB7240DDA;\n\tThu, 23 Dec 2021 16:25:32 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 0ECE44068C\n for <dev@dpdk.org>; Thu, 23 Dec 2021 16:25:30 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Dec 2021 07:25:29 -0800",
            "from silpixa00400072.ir.intel.com (HELO\n silpixa00400072.ger.corp.intel.com) ([10.237.222.91])\n by orsmga006.jf.intel.com with ESMTP; 23 Dec 2021 07:25:27 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1640273131; x=1671809131;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=LuLRSC0267Uu+kJtrgQ5t3H7fogJFYbhlxWyrKBG9ek=;\n b=hKUsJCp3Rs51agUok59w/HwEzug3a2VkIaeNVlAR3+FAmwqR4RSb9PhA\n aZdQAMFasfW/WTIDWM7bGZaLPVRAM1kmaRgMDZoR8mvE/e5uAjEOoQT1X\n EwGjCXxL2J9uqa1DC1IAjCMo1vAqMDpz4VmmUchbJGvxC7CTTY5bpySnR\n 8XCLr6fvYyLHhBeeBsSKIZ3ntR9PO9glTBOGXYG9z5knc1Q7Sxx4Vffp6\n weI8sS5t8w8/tC6VTZJV46VjMu4gdU0vggDpJwcsmgppb+j5k2lF97D92\n NNgXRV69Boy6cnQ8kyvK78DArxjNTd3/uATkBqEW0bOAC4O9X9RNvmi+l A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10206\"; a=\"241063411\"",
            "E=Sophos;i=\"5.88,229,1635231600\"; d=\"scan'208\";a=\"241063411\"",
            "E=Sophos;i=\"5.88,229,1635231600\"; d=\"scan'208\";a=\"468566698\""
        ],
        "X-ExtLoop1": "1",
        "From": "Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "vladimir.medvedkin@intel.com",
        "Subject": "[PATCH] app/test-fib: fix possible division by zero",
        "Date": "Thu, 23 Dec 2021 15:25:17 +0000",
        "Message-Id": "<20211223152519.758827-1-vladimir.medvedkin@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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"
    },
    "content": "This patch fixes the division by 0, which occurs if the number of routes is less than 10.\nCan be triggered by passing -n argument with value < 10:\n\n./dpdk-test-fib -- -n 9\n...\nFloating point exception (core dumped)\n\nFixes: 103809d032cd (\"app/test-fib: add test application for FIB\")\nCc: vladimir.medvedkin@intel.com\n\nSigned-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>\n---\n app/test-fib/main.c | 40 ++++++++++++++++++++++++----------------\n 1 file changed, 24 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/app/test-fib/main.c b/app/test-fib/main.c\nindex ecd420116a..9bc8b8a7ca 100644\n--- a/app/test-fib/main.c\n+++ b/app/test-fib/main.c\n@@ -902,8 +902,9 @@ run_v4(void)\n \t\t\t\treturn -ret;\n \t\t\t}\n \t\t}\n-\t\tprintf(\"AVG FIB add %\"PRIu64\"\\n\",\n-\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\tif (j != 0)\n+\t\t\tprintf(\"AVG FIB add %\"PRIu64\"\\n\",\n+\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\ti += j;\n \t}\n \n@@ -930,8 +931,9 @@ run_v4(void)\n \t\t\t\t\treturn -ret;\n \t\t\t\t}\n \t\t\t}\n-\t\t\tprintf(\"AVG LPM add %\"PRIu64\"\\n\",\n-\t\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\t\tif (j != 0)\n+\t\t\t\tprintf(\"AVG LPM add %\"PRIu64\"\\n\",\n+\t\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\t\ti += j;\n \t\t}\n \t}\n@@ -984,8 +986,9 @@ run_v4(void)\n \t\tfor (j = 0; j < (config.nb_routes - i) / k; j++)\n \t\t\trte_fib_delete(fib, rt[i + j].addr, rt[i + j].depth);\n \n-\t\tprintf(\"AVG FIB delete %\"PRIu64\"\\n\",\n-\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\tif (j != 0)\n+\t\t\tprintf(\"AVG FIB delete %\"PRIu64\"\\n\",\n+\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\ti += j;\n \t}\n \n@@ -996,8 +999,9 @@ run_v4(void)\n \t\t\t\trte_lpm_delete(lpm, rt[i + j].addr,\n \t\t\t\t\trt[i + j].depth);\n \n-\t\t\tprintf(\"AVG LPM delete %\"PRIu64\"\\n\",\n-\t\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\t\tif (j != 0)\n+\t\t\t\tprintf(\"AVG LPM delete %\"PRIu64\"\\n\",\n+\t\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\t\ti += j;\n \t\t}\n \t}\n@@ -1097,8 +1101,9 @@ run_v6(void)\n \t\t\t\treturn -ret;\n \t\t\t}\n \t\t}\n-\t\tprintf(\"AVG FIB add %\"PRIu64\"\\n\",\n-\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\tif (j != 0)\n+\t\t\tprintf(\"AVG FIB add %\"PRIu64\"\\n\",\n+\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\ti += j;\n \t}\n \n@@ -1125,8 +1130,9 @@ run_v6(void)\n \t\t\t\t\treturn -ret;\n \t\t\t\t}\n \t\t\t}\n-\t\t\tprintf(\"AVG LPM add %\"PRIu64\"\\n\",\n-\t\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\t\tif (j != 0)\n+\t\t\t\tprintf(\"AVG LPM add %\"PRIu64\"\\n\",\n+\t\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\t\ti += j;\n \t\t}\n \t}\n@@ -1183,8 +1189,9 @@ run_v6(void)\n \t\tfor (j = 0; j < (config.nb_routes - i) / k; j++)\n \t\t\trte_fib6_delete(fib, rt[i + j].addr, rt[i + j].depth);\n \n-\t\tprintf(\"AVG FIB delete %\"PRIu64\"\\n\",\n-\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\tif (j != 0)\n+\t\t\tprintf(\"AVG FIB delete %\"PRIu64\"\\n\",\n+\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\ti += j;\n \t}\n \n@@ -1195,8 +1202,9 @@ run_v6(void)\n \t\t\t\trte_lpm6_delete(lpm, rt[i + j].addr,\n \t\t\t\t\trt[i + j].depth);\n \n-\t\t\tprintf(\"AVG LPM delete %\"PRIu64\"\\n\",\n-\t\t\t\t(rte_rdtsc_precise() - start) / j);\n+\t\t\tif (j != 0)\n+\t\t\t\tprintf(\"AVG LPM delete %\"PRIu64\"\\n\",\n+\t\t\t\t\t(rte_rdtsc_precise() - start) / j);\n \t\t\ti += j;\n \t\t}\n \t}\n",
    "prefixes": []
}