get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105885,
    "url": "http://patches.dpdk.org/api/patches/105885/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220117024302.16006-2-humin29@huawei.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": "<20220117024302.16006-2-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220117024302.16006-2-humin29@huawei.com",
    "date": "2022-01-17T02:43:00",
    "name": "[1/3] net/hns3: fix Rx/Tx when fast path operation introduced",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "af8828ab6637a25b0ba6def0e0b3dd5a4a358dc9",
    "submitter": {
        "id": 1944,
        "url": "http://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.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/20220117024302.16006-2-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 21189,
            "url": "http://patches.dpdk.org/api/series/21189/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21189",
            "date": "2022-01-17T02:43:01",
            "name": "three bugfixes for hns3 PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/21189/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/105885/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/105885/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 19E46A034F;\n\tMon, 17 Jan 2022 03:43:04 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 23D32411CB;\n\tMon, 17 Jan 2022 03:42:48 +0100 (CET)",
            "from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])\n by mails.dpdk.org (Postfix) with ESMTP id EC300410F7\n for <dev@dpdk.org>; Mon, 17 Jan 2022 03:42:43 +0100 (CET)",
            "from dggeme756-chm.china.huawei.com (unknown [172.30.72.57])\n by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Jcbh32bK6z1FCcd;\n Mon, 17 Jan 2022 10:38:59 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n 15.1.2308.21; Mon, 17 Jan 2022 10:42:41 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <thomas@monjalon.net>",
        "Subject": "[PATCH 1/3] net/hns3: fix Rx/Tx when fast path operation introduced",
        "Date": "Mon, 17 Jan 2022 10:43:00 +0800",
        "Message-ID": "<20220117024302.16006-2-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20220117024302.16006-1-humin29@huawei.com>",
        "References": "<20220117024302.16006-1-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems702-chm.china.huawei.com (10.3.19.179) To\n dggeme756-chm.china.huawei.com (10.3.19.102)",
        "X-CFilter-Loop": "Reflected",
        "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": "When fast path operation is introduced, the Rx/Tx function is done by\nobject 'rte_eth_fp_ops'. So 'rte_eth_fp_ops' should be updated if\n'fast-path functions' need to be changed, such as PMD receive function,\nprepare function and so on.\n\nThis patch fixed receiving packets bug when fast path operation is\nintroduced.\n\nFixes: bba63669831 (\"net/hns3: support Rx/Tx and related operations\")\nFixes: 168b7d79dada (\"net/hns3: support set link up/down for PF\")\nCc: stable@dpdk.org\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/hns3/hns3_mp.c   |  7 ++-----\n drivers/net/hns3/hns3_rxtx.c | 28 +++++++++++++++++++++++++++-\n 2 files changed, 29 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c\nindex 999b407f7d..e74ddea195 100644\n--- a/drivers/net/hns3/hns3_mp.c\n+++ b/drivers/net/hns3/hns3_mp.c\n@@ -74,7 +74,6 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)\n \tstruct hns3_mp_param *res = (struct hns3_mp_param *)mp_res.param;\n \tconst struct hns3_mp_param *param =\n \t\t(const struct hns3_mp_param *)mp_msg->param;\n-\teth_tx_prep_t prep = NULL;\n \tstruct rte_eth_dev *dev;\n \tint ret;\n \n@@ -98,14 +97,12 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)\n \tcase HNS3_MP_REQ_START_TX:\n \t\tPMD_INIT_LOG(INFO, \"port %u starting Tx datapath\",\n \t\t\t     dev->data->port_id);\n-\t\tdev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);\n-\t\tdev->tx_pkt_prepare = prep;\n+\t\thns3_start_tx_datapath(dev);\n \t\tbreak;\n \tcase HNS3_MP_REQ_STOP_TX:\n \t\tPMD_INIT_LOG(INFO, \"port %u stopping Tx datapath\",\n \t\t\t     dev->data->port_id);\n-\t\tdev->tx_pkt_burst = hns3_dummy_rxtx_burst;\n-\t\tdev->tx_pkt_prepare = NULL;\n+\t\thns3_stop_tx_datapath(dev);\n \t\tbreak;\n \tdefault:\n \t\trte_errno = EINVAL;\ndiff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex d240e36e6a..c86aeb2366 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -4408,7 +4408,21 @@ hns3_trace_rxtx_function(struct rte_eth_dev *dev)\n \t\t rx_mode.info, tx_mode.info);\n }\n \n-void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)\n+static void\n+hns3_eth_dev_fp_ops_config(const struct rte_eth_dev *dev)\n+{\n+\tstruct rte_eth_fp_ops *fpo = rte_eth_fp_ops;\n+\tuint16_t port_id = dev->data->port_id;\n+\n+\tfpo[port_id].rx_pkt_burst = dev->rx_pkt_burst;\n+\tfpo[port_id].tx_pkt_burst = dev->tx_pkt_burst;\n+\tfpo[port_id].tx_pkt_prepare = dev->tx_pkt_prepare;\n+\tfpo[port_id].rx_descriptor_status = dev->rx_descriptor_status;\n+\tfpo[port_id].tx_descriptor_status = dev->tx_descriptor_status;\n+}\n+\n+void\n+hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)\n {\n \tstruct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n \tstruct hns3_adapter *hns = eth_dev->data->dev_private;\n@@ -4429,6 +4443,8 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)\n \t\teth_dev->tx_pkt_burst = hns3_dummy_rxtx_burst;\n \t\teth_dev->tx_pkt_prepare = NULL;\n \t}\n+\n+\thns3_eth_dev_fp_ops_config(eth_dev);\n }\n \n void\n@@ -4729,6 +4745,11 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)\n {\n \tdev->tx_pkt_burst = hns3_dummy_rxtx_burst;\n \tdev->tx_pkt_prepare = NULL;\n+\thns3_eth_dev_fp_ops_config(dev);\n+\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY)\n+\t\treturn;\n+\n \trte_wmb();\n \t/* Disable tx datapath on secondary process. */\n \thns3_mp_req_stop_tx(dev);\n@@ -4743,5 +4764,10 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)\n \n \tdev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);\n \tdev->tx_pkt_prepare = prep;\n+\thns3_eth_dev_fp_ops_config(dev);\n+\n+\tif (rte_eal_process_type() == RTE_PROC_SECONDARY)\n+\t\treturn;\n+\n \thns3_mp_req_start_tx(dev);\n }\n",
    "prefixes": [
        "1/3"
    ]
}