get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124878,
    "url": "http://patches.dpdk.org/api/patches/124878/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230309041101.8321-1-ivan.malov@arknetworks.am/",
    "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": "<20230309041101.8321-1-ivan.malov@arknetworks.am>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230309041101.8321-1-ivan.malov@arknetworks.am",
    "date": "2023-03-09T04:11:01",
    "name": "[1/1] net/sfc: stop misuse of Rx ingress m-port metadata on EF100",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "377ce47af133125a4e22b13cc3ea26f9ffa0e2e2",
    "submitter": {
        "id": 2962,
        "url": "http://patches.dpdk.org/api/people/2962/?format=api",
        "name": "Ivan Malov",
        "email": "ivan.malov@arknetworks.am"
    },
    "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/20230309041101.8321-1-ivan.malov@arknetworks.am/mbox/",
    "series": [
        {
            "id": 27296,
            "url": "http://patches.dpdk.org/api/series/27296/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27296",
            "date": "2023-03-09T04:11:01",
            "name": "[1/1] net/sfc: stop misuse of Rx ingress m-port metadata on EF100",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27296/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124878/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/124878/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 AB1DD41E37;\n\tThu,  9 Mar 2023 05:10:46 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6F5D74111C;\n\tThu,  9 Mar 2023 05:10:46 +0100 (CET)",
            "from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80])\n by mails.dpdk.org (Postfix) with ESMTP id 41D1340A7E;\n Thu,  9 Mar 2023 05:10:44 +0100 (CET)",
            "from localhost.localdomain (unknown [78.109.74.25])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by agw.arknetworks.am (Postfix) with ESMTPSA id 67D0BE0439;\n Thu,  9 Mar 2023 08:10:43 +0400 (+04)"
        ],
        "From": "Ivan Malov <ivan.malov@arknetworks.am>",
        "To": "dev@dpdk.org",
        "Cc": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ferruh Yigit <ferruh.yigit@amd.com>, stable@dpdk.org,\n Andy Moreton <amoreton@xilinx.com>",
        "Subject": "[PATCH 1/1] net/sfc: stop misuse of Rx ingress m-port metadata on\n EF100",
        "Date": "Thu,  9 Mar 2023 08:11:01 +0400",
        "Message-Id": "<20230309041101.8321-1-ivan.malov@arknetworks.am>",
        "X-Mailer": "git-send-email 2.30.2",
        "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": "The driver supports representor functionality. In it,\npackets coming from VFs to the dedicated back-end Rx\nqueue get demultiplexed into front-end Rx queues of\nrepresentor ethdevs as per the per-packet metadata\nindicating logical HW ingress ports. On transmit,\npackets are provided with symmetrical metadata\nby front-end Tx queues, and the back-end queue\ntransforms the data into so-called Tx override\ndescriptors. These let the packets bypass flow\nlookup and go directly to the represented VFs.\n\nHowever, in the Rx part, the driver extracts\nthe said metadata on every HW Rx queue, that\nis, not just on the one used by representors\nDoing so leads to a buggy behaviour. It is\nrevealed by operating testpmd as follows:\n\ndpdk-testpmd -a 0000:c6:00.0 -a 0000:c6:00.1 -- -i\n\ntestpmd> flow create 0 transfer pattern port_representor \\\n port_id is 0 / end actions port_representor port_id 1 / end\nFlow rule #0 created\n\ntestpmd> set fwd io\ntestpmd> start tx_first\n\ntestpmd> flow destroy 0 rule 0\nFlow rule #0 destroyed\n\ntestpmd> stop\n\n  ---------------------- Forward statistics for port 0  -----------------\n  RX-packets: 19196498       RX-dropped: 0             RX-total: 19196498\n  TX-packets: 19196535       TX-dropped: 0             TX-total: 19196535\n  -----------------------------------------------------------------------\n\n  ---------------------- Forward statistics for port 1  -----------------\n  RX-packets: 19196503       RX-dropped: 0             RX-total: 19196503\n  TX-packets: 19196530       TX-dropped: 0             TX-total: 19196530\n  -----------------------------------------------------------------------\n\nIn this scenario, two physical functions of the adapter\ndo not have any corresponding \"back-to-back\" forwarder\non peer host. Packets transmitted from port 0 can only\nbe forwarded to port 1 by means of a special flow rule.\n\nThe flow rule indeed works, but destroying it does not\nstop forwarding. Port statistics carry on incrementing.\n\nAlso, it is apparent that forwarding in the opposite\ndirection must not have worked in this case as the\nflow is meant to target only one of the directions.\n\nBecause of the bug, the first 32 mbufs received\nas a result of the flow rule operation have the\nsaid metadata present. In io mode, testpmd does\nnot tamper with mbufs and passes them directly\nto transmit path, so this data remains in them\ninstructing the PMD to override destinations\nof the packets via Tx option descriptors.\n\nExpected behaviour is as follows:\n\n  ---------------------- Forward statistics for port 0  -----------------\n  RX-packets: 0              RX-dropped: 0             RX-total: 0\n  TX-packets: 15787496       TX-dropped: 0             TX-total: 15787496\n  -----------------------------------------------------------------------\n\n  ---------------------- Forward statistics for port 1  -----------------\n  RX-packets: 15787464       RX-dropped: 0             RX-total: 15787464\n  TX-packets: 32             TX-dropped: 0             TX-total: 32\n  -----------------------------------------------------------------------\n\nThese figures show the rule work only for one direction.\nAlso, removing the flow shall cause forwarding to cease.\n\nProvided patch fixes the bug accordingly.\n\nFixes: d0f981a3efd8 (\"net/sfc: handle ingress mport in EF100 Rx prefix\")\nCc: stable@dpdk.org\n\nSigned-off-by: Ivan Malov <ivan.malov@arknetworks.am>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/net/sfc/sfc_dp_rx.h    | 3 +++\n drivers/net/sfc/sfc_ef100_rx.c | 3 ++-\n drivers/net/sfc/sfc_rx.c       | 3 +++\n 3 files changed, 8 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h\nindex 246adbd87c..51a44bd034 100644\n--- a/drivers/net/sfc/sfc_dp_rx.h\n+++ b/drivers/net/sfc/sfc_dp_rx.h\n@@ -10,6 +10,8 @@\n #ifndef _SFC_DP_RX_H\n #define _SFC_DP_RX_H\n \n+#include <stdbool.h>\n+\n #include <rte_mempool.h>\n #include <ethdev_driver.h>\n \n@@ -27,6 +29,7 @@ extern \"C\" {\n  */\n struct sfc_dp_rxq {\n \tstruct sfc_dp_queue\tdpq;\n+\tbool\t\t\tneed_ingress_mport;\n };\n \n /** Datapath receive queue descriptor number limitations */\ndiff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c\nindex 16cd8524d3..c4d256b40d 100644\n--- a/drivers/net/sfc/sfc_ef100_rx.c\n+++ b/drivers/net/sfc/sfc_ef100_rx.c\n@@ -876,7 +876,8 @@ sfc_ef100_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr,\n \telse\n \t\trxq->flags &= ~SFC_EF100_RXQ_USER_MARK;\n \n-\tif ((unsup_rx_prefix_fields &\n+\tif (dp_rxq->need_ingress_mport &&\n+\t    (unsup_rx_prefix_fields &\n \t     (1U << EFX_RX_PREFIX_FIELD_INGRESS_MPORT)) == 0)\n \t\trxq->flags |= SFC_EF100_RXQ_INGRESS_MPORT;\n \telse\ndiff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c\nindex 5ea98187c3..3d3d7d42e3 100644\n--- a/drivers/net/sfc/sfc_rx.c\n+++ b/drivers/net/sfc/sfc_rx.c\n@@ -1265,6 +1265,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index,\n \tif (rc != 0)\n \t\tgoto fail_dp_rx_qcreate;\n \n+\trxq_info->dp->need_ingress_mport =\n+\t\t((rxq_info->type_flags & EFX_RXQ_FLAG_INGRESS_MPORT) != 0);\n+\n \tevq->dp_rxq = rxq_info->dp;\n \n \trxq_info->state = SFC_RXQ_INITIALIZED;\n",
    "prefixes": [
        "1/1"
    ]
}