get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116631,
    "url": "http://patches.dpdk.org/api/patches/116631/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220922070426.788643-2-kevinx.liu@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": "<20220922070426.788643-2-kevinx.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220922070426.788643-2-kevinx.liu@intel.com",
    "date": "2022-09-22T07:04:25",
    "name": "[1/2] net/iavf: check illegal packets",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "40649fe4590d3c5a1fd74845bfe4470c6e02f62c",
    "submitter": {
        "id": 2440,
        "url": "http://patches.dpdk.org/api/people/2440/?format=api",
        "name": "Kevin Liu",
        "email": "kevinx.liu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220922070426.788643-2-kevinx.liu@intel.com/mbox/",
    "series": [
        {
            "id": 24771,
            "url": "http://patches.dpdk.org/api/series/24771/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24771",
            "date": "2022-09-22T07:04:24",
            "name": "check illegal packets",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/24771/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/116631/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/116631/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 A2D04A0543;\n\tThu, 22 Sep 2022 09:13:59 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 96A02410E8;\n\tThu, 22 Sep 2022 09:13:59 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id B7413400D7\n for <dev@dpdk.org>; Thu, 22 Sep 2022 09:13:57 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Sep 2022 00:13:48 -0700",
            "from intel-cd-odc-robin.cd.intel.com ([10.240.178.136])\n by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Sep 2022 00:13:46 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1663830838; x=1695366838;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=ww/vUj2Nn3HT9JoUJhHuYJBpNrAm58sptV5rTs9+KbE=;\n b=iQn7nA9BMqVSz7akBnuydjHXvszV3nXo8uBl+8elFTHzx/8U+I5oLRsF\n t0aqjGoOiu5seMqyUyuKcFh60fvzRuo1c6wB1PBfAQm8/DgCsAt2O2SPa\n nGaOREnAmZ8jPe5U4w3Whbr7y2ueHo4b+WdaAtcJG1lqAcjvK1FtKgw+M\n YfdZLo/usNOqO5FGEtlafQo37Mrfy8RM6kgJcpUtF1vXxKR7FETmHqmN/\n O+L1BRRMXLF3fbIVXFdO2m3I7uy8VnuxJMUkAswwq494qDMGot7LqBQCi\n cgkzptprS/DTuATaFeZVsEO9VuLDCwQ+QVtGjPCl0c6KZBs3OuRsWno6F w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10477\"; a=\"301066702\"",
            "E=Sophos;i=\"5.93,335,1654585200\"; d=\"scan'208\";a=\"301066702\"",
            "E=Sophos;i=\"5.93,335,1654585200\"; d=\"scan'208\";a=\"864746698\""
        ],
        "From": "Kevin Liu <kevinx.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com,\n beilei.xing@intel.com, jingjing.wu@intel.com,\n Kevin Liu <kevinx.liu@intel.com>",
        "Subject": "[PATCH 1/2] net/iavf: check illegal packets",
        "Date": "Thu, 22 Sep 2022 07:04:25 +0000",
        "Message-Id": "<20220922070426.788643-2-kevinx.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220922070426.788643-1-kevinx.liu@intel.com>",
        "References": "<20220922070426.788643-1-kevinx.liu@intel.com>",
        "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": "Some illegal packets will lead to TX/RX hang and\ncan't recover automatically. This patch check those\nillegal packets and protect TX/RX from hanging.\n\nFixes: a2b29a7733ef (\"net/avf: enable basic Rx Tx\")\nSigned-off-by: Kevin Liu <kevinx.liu@intel.com>\n---\n drivers/net/iavf/iavf_rxtx.c | 10 +++++++++-\n drivers/net/iavf/iavf_rxtx.h |  2 ++\n 2 files changed, 11 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c\nindex 3deabe1d7e..8ddd809f94 100644\n--- a/drivers/net/iavf/iavf_rxtx.c\n+++ b/drivers/net/iavf/iavf_rxtx.c\n@@ -2877,7 +2877,8 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \n \t\t/* Check condition for nb_segs > IAVF_TX_MAX_MTU_SEG. */\n \t\tif (!(ol_flags & RTE_MBUF_F_TX_TCP_SEG)) {\n-\t\t\tif (m->nb_segs > IAVF_TX_MAX_MTU_SEG) {\n+\t\t\tif (m->nb_segs > IAVF_TX_MAX_MTU_SEG ||\n+\t\t\t\tm->pkt_len > IAVF_FRAME_SIZE_MAX) {\n \t\t\t\trte_errno = EINVAL;\n \t\t\t\treturn i;\n \t\t\t}\n@@ -2893,6 +2894,13 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\treturn i;\n \t\t}\n \n+\t\t/* check the size of packet */\n+\t\tif (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {\n+\t\t\trte_errno = EINVAL;\n+\t\t\tPMD_DRV_LOG(ERR, \"INVALID mbuf: bad pkt_len=[%hu]\", m->pkt_len);\n+\t\t\treturn i;\n+\t\t}\n+\n #ifdef RTE_ETHDEV_DEBUG_TX\n \t\tret = rte_validate_tx_offload(m);\n \t\tif (ret != 0) {\ndiff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h\nindex 1695e43cd5..bb9083c699 100644\n--- a/drivers/net/iavf/iavf_rxtx.h\n+++ b/drivers/net/iavf/iavf_rxtx.h\n@@ -53,6 +53,8 @@\n #define IAVF_TSO_MAX_SEG          UINT8_MAX\n #define IAVF_TX_MAX_MTU_SEG       8\n \n+#define IAVF_TX_MIN_PKT_LEN 17\n+\n #define IAVF_TX_CKSUM_OFFLOAD_MASK (\t\t \\\n \t\tRTE_MBUF_F_TX_IP_CKSUM |\t\t \\\n \t\tRTE_MBUF_F_TX_L4_MASK |\t\t \\\n",
    "prefixes": [
        "1/2"
    ]
}