get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131099,
    "url": "http://patchwork.dpdk.org/api/patches/131099/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230903040111.126695-1-taozj888@163.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230903040111.126695-1-taozj888@163.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230903040111.126695-1-taozj888@163.com",
    "date": "2023-09-03T04:01:11",
    "name": "[v1] examples/l3fwd: relax the RSS/Offload requirement",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "21b727301a0bd3c0fd352dc99a6e1e24c4e8e803",
    "submitter": {
        "id": 3044,
        "url": "http://patchwork.dpdk.org/api/people/3044/?format=api",
        "name": "Trevor Tao",
        "email": "taozj888@163.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230903040111.126695-1-taozj888@163.com/mbox/",
    "series": [
        {
            "id": 29408,
            "url": "http://patchwork.dpdk.org/api/series/29408/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29408",
            "date": "2023-09-03T04:01:11",
            "name": "[v1] examples/l3fwd: relax the RSS/Offload requirement",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29408/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/131099/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/131099/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 601FD424DC;\n\tSun,  3 Sep 2023 06:01:32 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8C576402AE;\n\tSun,  3 Sep 2023 06:01:31 +0200 (CEST)",
            "from m12.mail.163.com (m12.mail.163.com [220.181.12.198])\n by mails.dpdk.org (Postfix) with ESMTP id 7A46940274;\n Sun,  3 Sep 2023 06:01:27 +0200 (CEST)",
            "from u2204.. (unknown [49.76.25.150])\n by zwqz-smtp-mta-g5-0 (Coremail) with SMTP id\n _____wC3PiMKBfRknkQqBA--.63655S2;\n Sun, 03 Sep 2023 12:01:21 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=xQ0eq\n a/0zVoffRlEAXhYO8wCxeglcy/iFagELkrtzbI=; b=M3mePAglx4bBz2g6r+Re8\n E5yWPO++n+GHoUSteIbI+QSbb5lyWE/7f/B/k+NtL0uphAJBOTwZgs4Y2VdZMgbM\n bOLY1cnc7yZYy20T0NrFc1bkpNB/Kfv/TKcGXG8KuX0X1fmay6eEzgldApZargf1\n mCD2Swr4l8yAwCsIFByXsg=",
        "From": "Trevor Tao <taozj888@163.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net,\n\tTrevor Tao <taozj888@163.com>,\n\tstable@dpdk.org",
        "Subject": "[PATCH v1] examples/l3fwd: relax the RSS/Offload requirement",
        "Date": "Sun,  3 Sep 2023 04:01:11 +0000",
        "Message-Id": "<20230903040111.126695-1-taozj888@163.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-CM-TRANSID": "_____wC3PiMKBfRknkQqBA--.63655S2",
        "X-Coremail-Antispam": "1Uf129KBjvJXoWxWFy8ZFy3AryrZrWDZF43Jrb_yoWrCw15pF\n srG397Xrs7XFy3XF13ZayI9r1Y9r18CFZ09F1fA343tF42yr97Ar4jkryYvFW7t3Z8GrZ2\n vrWrWrs3KF1kA3JanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRBbyQUUUUU=",
        "X-Originating-IP": "[49.76.25.150]",
        "X-CM-SenderInfo": "hwdr6yqyyyqiywtou0bp/xtbBdBXfx1gi7QUm6gAAsn",
        "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": "Now the port Rx mq_mode had been set to RTE_ETH_MQ_RX_RSS, and offload\nmode set to RTE_ETH_RX_OFFLOAD_CHECKSUM by default, but some hardware\nand/or virtual interface does not support the RSS and offload mode\npresupposed, e.g., some virtio interfaces in the cloud don't support\nRSS and may only partly support RTE_ETH_RX_OFFLOAD_UDP_CKSUM/\nRTE_ETH_RX_OFFLOAD_TCP_CKSUM,\nbut not RTE_ETH_RX_OFFLOAD_IPV4_CKSUM, and the error msg here:\n\nvirtio_dev_configure(): RSS support requested but not supported by\nthe device\nPort0 dev_configure = -95\n\nand:\nEthdev port_id=0 requested Rx offloads 0xe does not match Rx offloads\ncapabilities 0x201d in rte_eth_dev_configure()\n\nSo to enable the l3fwd running in that environment, the Rx mode requirement\ncan be relaxed to reflect the hardware feature reality here, and the l3fwd\ncan run smoothly then.\nA warning msg would be provided to user in case it happens here.\n\nOn the other side, enabling the software cksum check in case the\nhw support missing.\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Trevor Tao <taozj888@163.com>\n---\n examples/l3fwd/l3fwd.h | 12 +++++++++++-\n examples/l3fwd/main.c  | 21 +++++++++++++++++++--\n 2 files changed, 30 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h\nindex b55855c932..cc10643c4b 100644\n--- a/examples/l3fwd/l3fwd.h\n+++ b/examples/l3fwd/l3fwd.h\n@@ -115,6 +115,8 @@ extern struct acl_algorithms acl_alg[];\n \n extern uint32_t max_pkt_len;\n \n+extern struct rte_eth_conf port_conf;\n+\n /* Send burst of packets on an output interface */\n static inline int\n send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port)\n@@ -170,7 +172,15 @@ is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len)\n \t\treturn -1;\n \n \t/* 2. The IP checksum must be correct. */\n-\t/* this is checked in H/W */\n+\t/* if this is not checked in H/W, check it. */\n+\tif ((port_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_IPV4_CKSUM) == 0) {\n+\t\tuint16_t actual_cksum, expected_cksum;\n+\t\tactual_cksum = pkt->hdr_checksum;\n+\t\tpkt->hdr_checksum = 0;\n+\t\texpected_cksum = rte_ipv4_cksum(pkt);\n+\t\tif (actual_cksum != expected_cksum)\n+\t\t\treturn -2;\n+\t}\n \n \t/*\n \t * 3. The IP version number must be 4. If the version number is not 4\ndiff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c\nindex 6063eb1399..37aec64718 100644\n--- a/examples/l3fwd/main.c\n+++ b/examples/l3fwd/main.c\n@@ -117,7 +117,7 @@ static struct lcore_params * lcore_params = lcore_params_array_default;\n static uint16_t nb_lcore_params = sizeof(lcore_params_array_default) /\n \t\t\t\tsizeof(lcore_params_array_default[0]);\n \n-static struct rte_eth_conf port_conf = {\n+struct rte_eth_conf port_conf = {\n \t.rxmode = {\n \t\t.mq_mode = RTE_ETH_MQ_RX_RSS,\n \t\t.offloads = RTE_ETH_RX_OFFLOAD_CHECKSUM,\n@@ -1257,8 +1257,12 @@ l3fwd_poll_resource_setup(void)\n \t\tlocal_port_conf.rx_adv_conf.rss_conf.rss_hf &=\n \t\t\tdev_info.flow_type_rss_offloads;\n \n-\t\tif (dev_info.max_rx_queues == 1)\n+\t\t/* relax the rx rss requirement */\n+\t\tif (dev_info.max_rx_queues == 1 || !local_port_conf.rx_adv_conf.rss_conf.rss_hf) {\n+\t\t\tprintf(\"warning: modified the rx mq_mode to RTE_ETH_MQ_RX_NONE base on\"\n+\t\t\t\t\" device capability\\n\");\n \t\t\tlocal_port_conf.rxmode.mq_mode = RTE_ETH_MQ_RX_NONE;\n+\t\t}\n \n \t\tif (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=\n \t\t\t\tport_conf.rx_adv_conf.rss_conf.rss_hf) {\n@@ -1269,6 +1273,19 @@ l3fwd_poll_resource_setup(void)\n \t\t\t\tlocal_port_conf.rx_adv_conf.rss_conf.rss_hf);\n \t\t}\n \n+\t\t/* relax the rx offload requirement */\n+\t\tif ((local_port_conf.rxmode.offloads & dev_info.rx_offload_capa) !=\n+\t\t\tlocal_port_conf.rxmode.offloads) {\n+\t\t\tprintf(\"Port %u requested Rx offloads 0x%\"PRIx64\" does not\"\n+\t\t\t\t\" match Rx offloads capabilities 0x%\"PRIx64\"\\n\",\n+\t\t\t\tportid, local_port_conf.rxmode.offloads,\n+\t\t\t\tdev_info.rx_offload_capa);\n+\t\t\tlocal_port_conf.rxmode.offloads &= dev_info.rx_offload_capa;\n+\t\t\tport_conf.rxmode.offloads = local_port_conf.rxmode.offloads;\n+\t\t\tprintf(\"warning: modified the rx offload to 0x%\"PRIx64\" based on device\"\n+\t\t\t\t\" capability\\n\", local_port_conf.rxmode.offloads);\n+\t\t}\n+\n \t\tret = rte_eth_dev_configure(portid, nb_rx_queue,\n \t\t\t\t\t(uint16_t)n_tx_queue, &local_port_conf);\n \t\tif (ret < 0)\n",
    "prefixes": [
        "v1"
    ]
}