get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 111251,
    "url": "http://patchwork.dpdk.org/api/patches/111251/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220517173941.189330-6-hkalra@marvell.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": "<20220517173941.189330-6-hkalra@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220517173941.189330-6-hkalra@marvell.com",
    "date": "2022-05-17T17:39:35",
    "name": "[06/12] net/thunderx: implement polling of link state change",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "507b385415f401c13eb524e54902026c1da80df8",
    "submitter": {
        "id": 1182,
        "url": "http://patchwork.dpdk.org/api/people/1182/?format=api",
        "name": "Harman Kalra",
        "email": "hkalra@marvell.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/20220517173941.189330-6-hkalra@marvell.com/mbox/",
    "series": [
        {
            "id": 22975,
            "url": "http://patchwork.dpdk.org/api/series/22975/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=22975",
            "date": "2022-05-17T17:39:30",
            "name": "[01/12] config: add thundert83 config",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/22975/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/111251/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/111251/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 CA684A0503;\n\tTue, 17 May 2022 19:40:43 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4587242B86;\n\tTue, 17 May 2022 19:40:19 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 581B342B6E\n for <dev@dpdk.org>; Tue, 17 May 2022 19:40:15 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 24HAiGt8008984\n for <dev@dpdk.org>; Tue, 17 May 2022 10:40:14 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3g4a7a1r3w-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 17 May 2022 10:40:14 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Tue, 17 May 2022 10:40:04 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Tue, 17 May 2022 10:40:04 -0700",
            "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id B43343F70E8;\n Tue, 17 May 2022 10:40:02 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=MpklmOCr7cpkj6CvGuX5hRCoWeZ54mhgRd89qqFDxlU=;\n b=K4HqXUOhpI8fRJGu3xWi6UM4i2is2RJFACRejGj5awMxLzIw70EFfSUNGwV5rhLIQGAS\n /gvrlRWVoauGSKQjMHhL1YPliH6LhyqzXKrj7a4ARaEk71tMtAg9Az34S7KefcrruQt+\n 9Wzl0rsAkEqpTPuHtuSkq97WilKn+ETH5p9qAY+XEGeiBVVbazSgYNS5ptgvY01ZADGb\n EpzO9zZ68maFTVlx907oGwtgvubatHpMrAImopZGqBHGdPvYKliWd7qcdQC1v30t+iS8\n JYn3HSkymAsPAts5Jr3IiD6cD+A/6gPqrKozpjPRXVKdMFX7YMd1YuiXUU6CSfCXHaaj aA==",
        "From": "Harman Kalra <hkalra@marvell.com>",
        "To": "<dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>, Maciej Czekaj\n <mczekaj@marvell.com>",
        "CC": "Hanumanth Pothula <hpothula@marvell.com>",
        "Subject": "[PATCH 06/12] net/thunderx: implement polling of link state change",
        "Date": "Tue, 17 May 2022 23:09:35 +0530",
        "Message-ID": "<20220517173941.189330-6-hkalra@marvell.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20220517173941.189330-1-hkalra@marvell.com>",
        "References": "<20220517173941.189330-1-hkalra@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "Kcq27_I9VIg0NwDiGo58b-CaxKgS9i3e",
        "X-Proofpoint-ORIG-GUID": "Kcq27_I9VIg0NwDiGo58b-CaxKgS9i3e",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514\n definitions=2022-05-17_03,2022-05-17_02,2022-02-23_01",
        "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": "From: Hanumanth Pothula <hpothula@marvell.com>\n\nMoving the logic of link polling to VF from PF. Now VF\nis supposed to poll for the link status, rather PF alerting\nVF about any link change.\n\nSigned-off-by: Hanumanth Pothula <hpothula@marvell.com>\n---\n drivers/net/thunderx/base/nicvf_mbox.c |  9 ++++++++\n drivers/net/thunderx/base/nicvf_mbox.h |  1 +\n drivers/net/thunderx/nicvf_ethdev.c    | 32 ++++++++++++++------------\n drivers/net/thunderx/nicvf_ethdev.h    | 10 ++++----\n 4 files changed, 33 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/thunderx/base/nicvf_mbox.c b/drivers/net/thunderx/base/nicvf_mbox.c\nindex d7209c0083..281027ccce 100644\n--- a/drivers/net/thunderx/base/nicvf_mbox.c\n+++ b/drivers/net/thunderx/base/nicvf_mbox.c\n@@ -440,3 +440,12 @@ nicvf_mbox_cfg_done(struct nicvf *nic)\n \tmbx.msg.msg = NIC_MBOX_MSG_CFG_DONE;\n \tnicvf_mbox_send_async_msg_to_pf(nic, &mbx);\n }\n+\n+void\n+nicvf_mbox_link_change(struct nicvf *nic)\n+{\n+\tstruct nic_mbx mbx = { .msg = { 0 } };\n+\n+\tmbx.msg.msg = NIC_MBOX_MSG_BGX_LINK_CHANGE;\n+\tnicvf_mbox_send_async_msg_to_pf(nic, &mbx);\n+}\ndiff --git a/drivers/net/thunderx/base/nicvf_mbox.h b/drivers/net/thunderx/base/nicvf_mbox.h\nindex d0b294362c..490bed206b 100644\n--- a/drivers/net/thunderx/base/nicvf_mbox.h\n+++ b/drivers/net/thunderx/base/nicvf_mbox.h\n@@ -222,5 +222,6 @@ int nicvf_mbox_reset_stat_counters(struct nicvf *nic, uint16_t rx_stat_mask,\n int nicvf_mbox_set_link_up_down(struct nicvf *nic, bool enable);\n void nicvf_mbox_shutdown(struct nicvf *nic);\n void nicvf_mbox_cfg_done(struct nicvf *nic);\n+void nicvf_mbox_link_change(struct nicvf *nic);\n \n #endif /* __THUNDERX_NICVF_MBOX__ */\ndiff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c\nindex fc334cf734..addbd53735 100644\n--- a/drivers/net/thunderx/nicvf_ethdev.c\n+++ b/drivers/net/thunderx/nicvf_ethdev.c\n@@ -71,6 +71,9 @@ nicvf_link_status_update(struct nicvf *nic,\n \tlink->link_autoneg = RTE_ETH_LINK_AUTONEG;\n }\n \n+/*Poll for link status change by sending NIC_MBOX_MSG_BGX_LINK_CHANGE msg\n+ * periodically to PF.\n+ */\n static void\n nicvf_interrupt(void *arg)\n {\n@@ -78,7 +81,10 @@ nicvf_interrupt(void *arg)\n \tstruct nicvf *nic = nicvf_pmd_priv(dev);\n \tstruct rte_eth_link link;\n \n-\tif (nicvf_reg_poll_interrupts(nic) == NIC_MBOX_MSG_BGX_LINK_CHANGE) {\n+\trte_eth_linkstatus_get(dev, &link);\n+\n+\tnicvf_mbox_link_change(nic);\n+\tif (nic->link_up != link.link_status) {\n \t\tif (dev->data->dev_conf.intr_conf.lsc) {\n \t\t\tnicvf_link_status_update(nic, &link);\n \t\t\trte_eth_linkstatus_set(dev, &link);\n@@ -89,7 +95,7 @@ nicvf_interrupt(void *arg)\n \t\t}\n \t}\n \n-\trte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,\n+\trte_eal_alarm_set(NICVF_INTR_LINK_POLL_INTERVAL_MS * 1000,\n \t\t\t\tnicvf_interrupt, dev);\n }\n \n@@ -1841,7 +1847,6 @@ nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, bool cleanup)\n static int\n nicvf_dev_close(struct rte_eth_dev *dev)\n {\n-\tsize_t i;\n \tstruct nicvf *nic = nicvf_pmd_priv(dev);\n \n \tPMD_INIT_FUNC_TRACE();\n@@ -1850,13 +1855,7 @@ nicvf_dev_close(struct rte_eth_dev *dev)\n \n \tnicvf_dev_stop_cleanup(dev, true);\n \tnicvf_periodic_alarm_stop(nicvf_interrupt, dev);\n-\n-\tfor (i = 0; i < nic->sqs_count; i++) {\n-\t\tif (!nic->snicvf[i])\n-\t\t\tcontinue;\n-\n-\t\tnicvf_periodic_alarm_stop(nicvf_vf_interrupt, nic->snicvf[i]);\n-\t}\n+\tnicvf_periodic_alarm_stop(nicvf_vf_interrupt, nic);\n \n \trte_intr_instance_free(nic->intr_handle);\n \n@@ -2169,6 +2168,14 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)\n \n \tnicvf_disable_all_interrupts(nic);\n \n+\t/* To read mbox messages */\n+\tret = nicvf_periodic_alarm_start(nicvf_vf_interrupt, nic);\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to start period alarm\");\n+\t\tgoto fail;\n+\t}\n+\n+\t/* To poll link status change*/\n \tret = nicvf_periodic_alarm_start(nicvf_interrupt, eth_dev);\n \tif (ret) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to start period alarm\");\n@@ -2203,11 +2210,6 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)\n \t\teth_dev->data->dev_private = NULL;\n \n \t\tnicvf_periodic_alarm_stop(nicvf_interrupt, eth_dev);\n-\t\tret = nicvf_periodic_alarm_start(nicvf_vf_interrupt, nic);\n-\t\tif (ret) {\n-\t\t\tPMD_INIT_LOG(ERR, \"Failed to start period alarm\");\n-\t\t\tgoto fail;\n-\t\t}\n \n \t\t/* Detach port by returning positive error number */\n \t\treturn ENOTSUP;\ndiff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h\nindex cb474e26b8..a947b55fd4 100644\n--- a/drivers/net/thunderx/nicvf_ethdev.h\n+++ b/drivers/net/thunderx/nicvf_ethdev.h\n@@ -10,10 +10,12 @@\n #define THUNDERX_NICVF_PMD_VERSION      \"2.0\"\n #define THUNDERX_REG_BYTES\t\t8\n \n-#define NICVF_INTR_POLL_INTERVAL_MS\t50\n-#define NICVF_HALF_DUPLEX\t\t0x00\n-#define NICVF_FULL_DUPLEX\t\t0x01\n-#define NICVF_UNKNOWN_DUPLEX\t\t0xff\n+#define NICVF_INTR_POLL_INTERVAL_MS\t\t50\n+/* Poll for link state for every 2 sec */\n+#define NICVF_INTR_LINK_POLL_INTERVAL_MS\t2000\n+#define NICVF_HALF_DUPLEX\t\t\t0x00\n+#define NICVF_FULL_DUPLEX\t\t\t0x01\n+#define NICVF_UNKNOWN_DUPLEX\t\t\t0xff\n \n #define NICVF_RSS_OFFLOAD_PASS1 ( \\\n \tRTE_ETH_RSS_PORT | \\\n",
    "prefixes": [
        "06/12"
    ]
}