get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92084,
    "url": "http://patches.dpdk.org/api/patches/92084/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210423160952.336272-1-ferruh.yigit@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": "<20210423160952.336272-1-ferruh.yigit@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210423160952.336272-1-ferruh.yigit@intel.com",
    "date": "2021-04-23T16:09:52",
    "name": "[v2] app/testpmd: fix segment number check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c77e00055f0bf492a9902c50a02d9ebd712ee9c0",
    "submitter": {
        "id": 324,
        "url": "http://patches.dpdk.org/api/people/324/?format=api",
        "name": "Ferruh Yigit",
        "email": "ferruh.yigit@intel.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/20210423160952.336272-1-ferruh.yigit@intel.com/mbox/",
    "series": [
        {
            "id": 16637,
            "url": "http://patches.dpdk.org/api/series/16637/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16637",
            "date": "2021-04-23T16:09:52",
            "name": "[v2] app/testpmd: fix segment number check",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/16637/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/92084/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/92084/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 96A63A0547;\n\tFri, 23 Apr 2021 18:13:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 188E9410E1;\n\tFri, 23 Apr 2021 18:13:17 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 8BB9D410D8;\n Fri, 23 Apr 2021 18:13:14 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Apr 2021 09:10:08 -0700",
            "from silpixa00399752.ir.intel.com (HELO\n silpixa00399752.ger.corp.intel.com) ([10.237.222.27])\n by orsmga004.jf.intel.com with ESMTP; 23 Apr 2021 09:09:57 -0700"
        ],
        "IronPort-SDR": [
            "\n wMBk6KDx9miG3EAJ7nOY0TndK+tXoV+eVxrnyaVzF45uD9wDrou95UYKwUKITTVEYPPB5z/i5J\n 61nYvMXHfSaA==",
            "\n tF+FDygr4RoBC7lxISC8zQWi3qYxvd7gla+TYX6LUv37ArQyjxfaSCjilZrsSajosPtPYFmpos\n Zpm4rLNpq8pw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9963\"; a=\"192904926\"",
            "E=Sophos;i=\"5.82,246,1613462400\"; d=\"scan'208\";a=\"192904926\"",
            "E=Sophos;i=\"5.82,246,1613462400\"; d=\"scan'208\";a=\"535583949\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "To": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Xiaoyun Li <xiaoyun.li@intel.com>,\n \"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>,\n Chengchang Tang <tangchengchang@huawei.com>",
        "Cc": "Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org, stable@dpdk.org,\n Andrew Boyer <aboyer@pensando.io>",
        "Date": "Fri, 23 Apr 2021 17:09:52 +0100",
        "Message-Id": "<20210423160952.336272-1-ferruh.yigit@intel.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<1607699265-5238-1-git-send-email-viacheslavo@nvidia.com>",
        "References": "<1607699265-5238-1-git-send-email-viacheslavo@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2] app/testpmd: fix segment number check",
        "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: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n\nThe --txpkts command line parameter was silently ignored due to\napplication was unable to check the Tx queue ring sizes for non\nconfigured ports [1].\n\nThe \"set txpkts <len0[,len1]*>\" was also rejected if there\nwas some stopped or /unconfigured port.\n\nThis provides the following:\n\n  - If fails to get ring size from the port, this can be because port is\n    not initialized yet, ignore the check and just be sure segment size\n    won't cause an out of bound access. The port descriptor check will\n    be done during Tx setup.\n\n  - The capability to send single packet is supposed to be very basic\n    and always supported, the setting segment number to 1 is always\n    allowed, no check performed\n\n  - At the moment of Tx queue setup the descriptor number is checked\n    against configured segment number\n\nBugzilla ID: 584\nFixes: 8dae835d88b7 (\"app/testpmd: remove restriction on Tx segments set\")\nCc: stable@dpdk.org\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\nSigned-off-by: Ferruh Yigit <ferruh.yigit@intel.com>\n---\nCc: Andrew Boyer <aboyer@pensando.io>\n\nv2:\n* Become more flexible for the '--txpkts' command line, if not able to\n  get the descriptor size from port, ignore the check.\n\n  ('nb_txd' check was proposed before, this will require '--txd'\n  parameter, but also enforces a specific order on the parameters,\n  instead going with the option to flex the checks for parameter.)\n---\n app/test-pmd/cmdline.c |  4 ++++\n app/test-pmd/config.c  | 32 ++++++++++++++++++++++++--------\n 2 files changed, 28 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 12efbc0cab46..7feba8337781 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -2910,6 +2910,10 @@ cmd_setup_rxtx_queue_parsed(\n \t\tif (!numa_support || socket_id == NUMA_NO_CONFIG)\n \t\t\tsocket_id = port->socket_id;\n \n+\t\tif (port->nb_tx_desc[res->qid] < tx_pkt_nb_segs) {\n+\t\t\tprintf(\"Failed to setup TX queue: not enough descriptors\\n\");\n+\t\t\treturn;\n+\t\t}\n \t\tret = rte_eth_tx_queue_setup(res->portid,\n \t\t\t\t\t     res->qid,\n \t\t\t\t\t     port->nb_tx_desc[res->qid],\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex e189062efde8..a4445a73bfa5 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -3697,13 +3697,15 @@ nb_segs_is_invalid(unsigned int nb_segs)\n \tRTE_ETH_FOREACH_DEV(port_id) {\n \t\tfor (queue_id = 0; queue_id < nb_txq; queue_id++) {\n \t\t\tret = get_tx_ring_size(port_id, queue_id, &ring_size);\n-\n-\t\t\tif (ret)\n-\t\t\t\treturn true;\n-\n+\t\t\tif (ret) {\n+\t\t\t\t/* Port may not be initialized yet, can't say\n+\t\t\t\t * the port is invalid in this stage.\n+\t\t\t\t */\n+\t\t\t\tcontinue;\n+\t\t\t}\n \t\t\tif (ring_size < nb_segs) {\n-\t\t\t\tprintf(\"nb segments per TX packets=%u >= \"\n-\t\t\t\t       \"TX queue(%u) ring_size=%u - ignored\\n\",\n+\t\t\t\tprintf(\"nb segments per TX packets=%u >= TX \"\n+\t\t\t\t       \"queue(%u) ring_size=%u - txpkts ignored\\n\",\n \t\t\t\t       nb_segs, queue_id, ring_size);\n \t\t\t\treturn true;\n \t\t\t}\n@@ -3719,12 +3721,26 @@ set_tx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs)\n \tuint16_t tx_pkt_len;\n \tunsigned int i;\n \n-\tif (nb_segs_is_invalid(nb_segs))\n+\t/*\n+\t * For single segment settings failed check is ignored.\n+\t * It is a very basic capability to send the single segment\n+\t * packets, suppose it is always supported.\n+\t */\n+\tif (nb_segs > 1 && nb_segs_is_invalid(nb_segs)) {\n+\t\tprintf(\"Tx segment size(%u) is not supported - txpkts ignored\\n\",\n+\t\t\tnb_segs);\n \t\treturn;\n+\t}\n+\n+\tif (nb_segs > RTE_MAX_SEGS_PER_PKT) {\n+\t\tprintf(\"Tx segment size(%u) is bigger than max number of segment(%u)\\n\",\n+\t\t\tnb_segs, RTE_MAX_SEGS_PER_PKT);\n+\t\treturn;\n+\t}\n \n \t/*\n \t * Check that each segment length is greater or equal than\n-\t * the mbuf data sise.\n+\t * the mbuf data size.\n \t * Check also that the total packet length is greater or equal than the\n \t * size of an empty UDP/IP packet (sizeof(struct rte_ether_hdr) +\n \t * 20 + 8).\n",
    "prefixes": [
        "v2"
    ]
}