get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96471,
    "url": "http://patchwork.dpdk.org/api/patches/96471/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210730160829.13597-1-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": "<20210730160829.13597-1-hkalra@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210730160829.13597-1-hkalra@marvell.com",
    "date": "2021-07-30T16:08:28",
    "name": "[1/2] common/cnxk: send link event to VF",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "96606170eff7d12970967c98a335fe43f3978e14",
    "submitter": {
        "id": 1182,
        "url": "http://patchwork.dpdk.org/api/people/1182/?format=api",
        "name": "Harman Kalra",
        "email": "hkalra@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patchwork.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210730160829.13597-1-hkalra@marvell.com/mbox/",
    "series": [
        {
            "id": 18105,
            "url": "http://patchwork.dpdk.org/api/series/18105/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18105",
            "date": "2021-07-30T16:08:28",
            "name": "[1/2] common/cnxk: send link event to VF",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/18105/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96471/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96471/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 A2496A0C40;\n\tFri, 30 Jul 2021 18:08:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8478C40141;\n\tFri, 30 Jul 2021 18:08:51 +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 6C48340141\n for <dev@dpdk.org>; Fri, 30 Jul 2021 18:08:49 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 16UG6GPM002370; Fri, 30 Jul 2021 09:08:46 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 3a4866trxw-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Fri, 30 Jul 2021 09:08:46 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Fri, 30 Jul 2021 09:08:44 -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; Fri, 30 Jul 2021 09:08:44 -0700",
            "from localhost.localdomain (unknown [10.29.52.211])\n by maili.marvell.com (Postfix) with ESMTP id AEB213F705F;\n Fri, 30 Jul 2021 09:08:42 -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 : mime-version : content-type; s=pfpt0220;\n bh=c/xgzVZRxuM/iKTrW9/VuR6qmVwMBxgWA7g8IBSDRuo=;\n b=bEj68Fcg6o8sxrt78G09AEQ3unnPDrCCo11wf1xj3BA6VRv+Ct5Jb7XMASu/sr6hJMZb\n PwJCkutTBtR6Rk9+P8vdGcOHQhA0U3FbeUG9MMq/RC3q8p/SUHEBYcmIy7cllqGXgsTb\n lVmZxws907XOro4a60TBrP5d50SPTP7t7OxT1SngnqEW53Y9HJmf5ZsgTXYJp0P+Boip\n YP0MKNybMF0ZJD05xPjNuzfb+c/w/8aRtz+dM3Q/3kNLS63oVsvpRX+KS0ZvIWv4NAE9\n OjtqNNUBnFhqdN251++fgyM4BO+Ham/GvVtINVxytOSK17XOoT1oSjJtsWxhJVWySEKQ ng==",
        "From": "Harman Kalra <hkalra@marvell.com>",
        "To": "Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>, Ray Kinsella <mdr@ashroe.eu>",
        "CC": "<dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>",
        "Date": "Fri, 30 Jul 2021 21:38:28 +0530",
        "Message-ID": "<20210730160829.13597-1-hkalra@marvell.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "cYuZTsE0NniBA9O1ktY1Nay3CcNBzoZq",
        "X-Proofpoint-ORIG-GUID": "cYuZTsE0NniBA9O1ktY1Nay3CcNBzoZq",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790\n definitions=2021-07-30_11:2021-07-30,\n 2021-07-30 signatures=0",
        "Subject": "[dpdk-dev] [PATCH 1/2] common/cnxk: send link event to VF",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Currently link event is only sent to the PF by AF as soon as it comes\nup, or in case of any physical change in link. PF will broadcast\nthese link events to all its VFs as soon as it receives it.\nBut no event is sent when a new VF comes up, hence it will not have\nthe link status.\nAdding support for sending link status to the VF once it comes up\nsuccessfully.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\n---\n drivers/common/cnxk/roc_dev.c      | 33 ++++++++++++++++++++++++++++++\n drivers/common/cnxk/roc_dev_priv.h |  5 +++++\n drivers/common/cnxk/roc_nix.h      |  7 +++++++\n drivers/common/cnxk/roc_nix_mac.c  | 23 +++++++++++++++++++++\n drivers/common/cnxk/version.map    |  2 ++\n 5 files changed, 70 insertions(+)",
    "diff": "diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c\nindex c14f189f9b..4e204373dc 100644\n--- a/drivers/common/cnxk/roc_dev.c\n+++ b/drivers/common/cnxk/roc_dev.c\n@@ -163,6 +163,39 @@ af_pf_wait_msg(struct dev *dev, uint16_t vf, int num_msg)\n \t\trsp->rc = msg->rc;\n \t\trsp->pcifunc = msg->pcifunc;\n \n+\t\t/* Whenever a PF comes up, AF sends the link status to it but\n+\t\t * when VF comes up no such event is sent to respective VF.\n+\t\t * Using MBOX_MSG_NIX_LF_START_RX response from AF for the\n+\t\t * purpose and send the link status of PF to VF.\n+\t\t */\n+\t\tif (msg->id == MBOX_MSG_NIX_LF_START_RX) {\n+\t\t\t/* Send link status to VF */\n+\t\t\tstruct cgx_link_user_info linfo;\n+\t\t\tstruct mbox_msghdr *vf_msg;\n+\t\t\tsize_t sz;\n+\n+\t\t\t/* Get the link status */\n+\t\t\tmemset(&linfo, 0, sizeof(struct cgx_link_user_info));\n+\t\t\tif (dev->ops && dev->ops->link_status_get)\n+\t\t\t\tdev->ops->link_status_get(dev->roc_nix, &linfo);\n+\n+\t\t\tsz = PLT_ALIGN(mbox_id2size(MBOX_MSG_CGX_LINK_EVENT),\n+\t\t\t\t       MBOX_MSG_ALIGN);\n+\t\t\t/* Prepare the message to be sent */\n+\t\t\tvf_msg = mbox_alloc_msg(&dev->mbox_vfpf_up, vf, sz);\n+\t\t\tif (vf_msg) {\n+\t\t\t\tmbox_req_init(MBOX_MSG_CGX_LINK_EVENT, vf_msg);\n+\t\t\t\tmemcpy((uint8_t *)vf_msg +\n+\t\t\t\t       sizeof(struct mbox_msghdr), &linfo,\n+\t\t\t\t       sizeof(struct cgx_link_user_info));\n+\n+\t\t\t\tvf_msg->rc = msg->rc;\n+\t\t\t\tvf_msg->pcifunc = msg->pcifunc;\n+\t\t\t\t/* Send to VF */\n+\t\t\t\tmbox_msg_send(&dev->mbox_vfpf_up, vf);\n+\t\t\t}\n+\t\t}\n+\n \t\toffset = mbox->rx_start + msg->next_msgoff;\n \t}\n \tplt_spinlock_unlock(&mdev->mbox_lock);\ndiff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h\nindex 9488db3c41..302dc0feb0 100644\n--- a/drivers/common/cnxk/roc_dev_priv.h\n+++ b/drivers/common/cnxk/roc_dev_priv.h\n@@ -30,9 +30,14 @@ typedef void (*link_info_t)(void *roc_nix,\n /* PTP info callback */\n typedef int (*ptp_info_t)(void *roc_nix, bool enable);\n \n+/* Link status get callback */\n+typedef void (*link_status_get_t)(void *roc_nix,\n+\t\t\t\t  struct cgx_link_user_info *link);\n+\n struct dev_ops {\n \tlink_info_t link_status_update;\n \tptp_info_t ptp_info_update;\n+\tlink_status_get_t link_status_get;\n };\n \n #define dev_is_vf(dev) ((dev)->hwcap & DEV_HWCAP_F_VF)\ndiff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h\nindex bb69027956..d7ab3c674e 100644\n--- a/drivers/common/cnxk/roc_nix.h\n+++ b/drivers/common/cnxk/roc_nix.h\n@@ -243,6 +243,10 @@ typedef void (*link_status_t)(struct roc_nix *roc_nix,\n /* PTP info update callback */\n typedef int (*ptp_info_update_t)(struct roc_nix *roc_nix, bool enable);\n \n+/* Link status get callback */\n+typedef void (*link_info_get_t)(struct roc_nix *roc_nix,\n+\t\t\t\tstruct roc_nix_link_info *link);\n+\n struct roc_nix {\n \t/* Input parameters */\n \tstruct plt_pci_device *pci_dev;\n@@ -487,6 +491,9 @@ int __roc_api roc_nix_mac_max_rx_len_set(struct roc_nix *roc_nix,\n int __roc_api roc_nix_mac_link_cb_register(struct roc_nix *roc_nix,\n \t\t\t\t\t   link_status_t link_update);\n void __roc_api roc_nix_mac_link_cb_unregister(struct roc_nix *roc_nix);\n+int __roc_api roc_nix_mac_link_info_get_cb_register(\n+\tstruct roc_nix *roc_nix, link_info_get_t link_info_get);\n+void __roc_api roc_nix_mac_link_info_get_cb_unregister(struct roc_nix *roc_nix);\n \n /* Ops */\n int __roc_api roc_nix_switch_hdr_set(struct roc_nix *roc_nix,\ndiff --git a/drivers/common/cnxk/roc_nix_mac.c b/drivers/common/cnxk/roc_nix_mac.c\nindex 682d5a7295..36259941c9 100644\n--- a/drivers/common/cnxk/roc_nix_mac.c\n+++ b/drivers/common/cnxk/roc_nix_mac.c\n@@ -296,3 +296,26 @@ roc_nix_mac_link_cb_unregister(struct roc_nix *roc_nix)\n \n \tdev->ops->link_status_update = NULL;\n }\n+\n+int\n+roc_nix_mac_link_info_get_cb_register(struct roc_nix *roc_nix,\n+\t\t\t\t      link_info_get_t link_info_get)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct dev *dev = &nix->dev;\n+\n+\tif (link_info_get == NULL)\n+\t\treturn NIX_ERR_PARAM;\n+\n+\tdev->ops->link_status_get = (link_info_t)link_info_get;\n+\treturn 0;\n+}\n+\n+void\n+roc_nix_mac_link_info_get_cb_unregister(struct roc_nix *roc_nix)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct dev *dev = &nix->dev;\n+\n+\tdev->ops->link_status_get = NULL;\n+}\ndiff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map\nindex e3af48c02e..4cc2c9652c 100644\n--- a/drivers/common/cnxk/version.map\n+++ b/drivers/common/cnxk/version.map\n@@ -105,6 +105,8 @@ INTERNAL {\n \troc_nix_mac_addr_set;\n \troc_nix_mac_link_cb_register;\n \troc_nix_mac_link_cb_unregister;\n+\troc_nix_mac_link_info_get_cb_register;\n+\troc_nix_mac_link_info_get_cb_unregister;\n \troc_nix_mac_link_event_start_stop;\n \troc_nix_mac_link_info_get;\n \troc_nix_mac_link_info_set;\n",
    "prefixes": [
        "1/2"
    ]
}