get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105252,
    "url": "http://patches.dpdk.org/api/patches/105252/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/9770b350bfc497935e3df4b5b98982d572c02014.1639636621.git.songyl@ramaxel.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": "<9770b350bfc497935e3df4b5b98982d572c02014.1639636621.git.songyl@ramaxel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/9770b350bfc497935e3df4b5b98982d572c02014.1639636621.git.songyl@ramaxel.com",
    "date": "2021-12-18T02:51:41",
    "name": "[v1,14/25] net/spnic: add port/vport enable",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e10aceed0a93f7922a15e1a1544a67390fd1ebea",
    "submitter": {
        "id": 2455,
        "url": "http://patches.dpdk.org/api/people/2455/?format=api",
        "name": "Yanling Song",
        "email": "songyl@ramaxel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/9770b350bfc497935e3df4b5b98982d572c02014.1639636621.git.songyl@ramaxel.com/mbox/",
    "series": [
        {
            "id": 20973,
            "url": "http://patches.dpdk.org/api/series/20973/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20973",
            "date": "2021-12-18T02:51:28",
            "name": "Net/SPNIC: support SPNIC into DPDK 22.03",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/20973/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/105252/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/105252/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 712B6A04A4;\n\tSat, 18 Dec 2021 03:54:03 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9328C41152;\n\tSat, 18 Dec 2021 03:52:39 +0100 (CET)",
            "from VLXDG1SPAM1.ramaxel.com (email.unionmem.com [221.4.138.186])\n by mails.dpdk.org (Postfix) with ESMTP id E8DB3411E6\n for <dev@dpdk.org>; Sat, 18 Dec 2021 03:52:36 +0100 (CET)",
            "from V12DG1MBS01.ramaxel.local (v12dg1mbs01.ramaxel.local\n [172.26.18.31])\n by VLXDG1SPAM1.ramaxel.com with ESMTPS id 1BI2q1C1010343\n (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);\n Sat, 18 Dec 2021 10:52:01 +0800 (GMT-8)\n (envelope-from songyl@ramaxel.com)",
            "from localhost.localdomain (10.64.9.47) by V12DG1MBS01.ramaxel.local\n (172.26.18.31) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Sat, 18\n Dec 2021 10:52:00 +0800"
        ],
        "From": "Yanling Song <songyl@ramaxel.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<songyl@ramaxel.com>, <yanling.song@linux.dev>, <yanggan@ramaxel.com>,\n <ferruh.yigit@intel.com>",
        "Subject": "[PATCH v1 14/25] net/spnic: add port/vport enable",
        "Date": "Sat, 18 Dec 2021 10:51:41 +0800",
        "Message-ID": "\n <9770b350bfc497935e3df4b5b98982d572c02014.1639636621.git.songyl@ramaxel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<cover.1639636621.git.songyl@ramaxel.com>",
        "References": "<cover.1639636621.git.songyl@ramaxel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.64.9.47]",
        "X-ClientProxiedBy": "V12DG1MBS01.ramaxel.local (172.26.18.31) To\n V12DG1MBS01.ramaxel.local (172.26.18.31)",
        "X-DNSRBL": "",
        "X-MAIL": "VLXDG1SPAM1.ramaxel.com 1BI2q1C1010343",
        "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": "This patch adds interface to enable port/vport so that the hardware\nwould receive packets to host.\n\nSigned-off-by: Yanling Song <songyl@ramaxel.com>\n---\n drivers/net/spnic/spnic_ethdev.c | 46 ++++++++++++++++++++++++++++++++\n 1 file changed, 46 insertions(+)",
    "diff": "diff --git a/drivers/net/spnic/spnic_ethdev.c b/drivers/net/spnic/spnic_ethdev.c\nindex db16d4038d..826a34f7fc 100644\n--- a/drivers/net/spnic/spnic_ethdev.c\n+++ b/drivers/net/spnic/spnic_ethdev.c\n@@ -855,8 +855,10 @@ static void spnic_deinit_sw_rxtxqs(struct spnic_nic_dev *nic_dev)\n static int spnic_dev_start(struct rte_eth_dev *eth_dev)\n {\n \tstruct spnic_nic_dev *nic_dev;\n+\tstruct spnic_rxq *rxq = NULL;\n \tu64 nic_features;\n \tint err;\n+\tu16 i;\n \n \tnic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);\n \n@@ -916,6 +918,22 @@ static int spnic_dev_start(struct rte_eth_dev *eth_dev)\n \n \tspnic_start_all_sqs(eth_dev);\n \n+\t/* Open virtual port and ready to start packet receiving */\n+\terr = spnic_set_vport_enable(nic_dev->hwdev, true);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"Enable vport failed, dev_name: %s\",\n+\t\t\t    eth_dev->data->name);\n+\t\tgoto en_vport_fail;\n+\t}\n+\n+\t/* Open physical port and start packet receiving */\n+\terr = spnic_set_port_enable(nic_dev->hwdev, true);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"Enable physical port failed, dev_name: %s\",\n+\t\t\t    eth_dev->data->name);\n+\t\tgoto en_port_fail;\n+\t}\n+\n \t/* Update eth_dev link status */\n \tif (eth_dev->data->dev_conf.intr_conf.lsc != 0)\n \t\t(void)spnic_link_update(eth_dev, 0);\n@@ -924,6 +942,20 @@ static int spnic_dev_start(struct rte_eth_dev *eth_dev)\n \n \treturn 0;\n \n+en_port_fail:\n+\t(void)spnic_set_vport_enable(nic_dev->hwdev, false);\n+\n+en_vport_fail:\n+\t/* Flush tx && rx chip resources in case of setting vport fake fail */\n+\t(void)spnic_flush_qps_res(nic_dev->hwdev);\n+\trte_delay_ms(100);\n+\tfor (i = 0; i < nic_dev->num_rqs; i++) {\n+\t\trxq = nic_dev->rxqs[i];\n+\t\tspnic_remove_rq_from_rx_queue_list(nic_dev, rxq->q_id);\n+\t\tspnic_free_rxq_mbufs(rxq);\n+\t\teth_dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t\teth_dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t}\n start_rqs_fail:\n \tspnic_remove_rxtx_configure(eth_dev);\n \n@@ -951,6 +983,7 @@ static int spnic_dev_stop(struct rte_eth_dev *dev)\n {\n \tstruct spnic_nic_dev *nic_dev;\n \tstruct rte_eth_link link;\n+\tint err;\n \n \tnic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n \tif (!rte_bit_relaxed_test_and_clear32(SPNIC_DEV_START, &nic_dev->dev_status)) {\n@@ -959,6 +992,19 @@ static int spnic_dev_stop(struct rte_eth_dev *dev)\n \t\treturn 0;\n \t}\n \n+\t/* Stop phy port and vport */\n+\terr = spnic_set_port_enable(nic_dev->hwdev, false);\n+\tif (err)\n+\t\tPMD_DRV_LOG(WARNING, \"Disable phy port failed, error: %d, \"\n+\t\t\t    \"dev_name: %s, port_id: %d\", err, dev->data->name,\n+\t\t\t    dev->data->port_id);\n+\n+\terr = spnic_set_vport_enable(nic_dev->hwdev, false);\n+\tif (err)\n+\t\tPMD_DRV_LOG(WARNING, \"Disable vport failed, error: %d, \"\n+\t\t\t    \"dev_name: %s, port_id: %d\", err, dev->data->name,\n+\t\t\t    dev->data->port_id);\n+\n \t/* Clear recorded link status */\n \tmemset(&link, 0, sizeof(link));\n \t(void)rte_eth_linkstatus_set(dev, &link);\n",
    "prefixes": [
        "v1",
        "14/25"
    ]
}