get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 103413,
    "url": "http://patches.dpdk.org/api/patches/103413/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211102040556.7840-15-venkatkumar.duvvuru@broadcom.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": "<20211102040556.7840-15-venkatkumar.duvvuru@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211102040556.7840-15-venkatkumar.duvvuru@broadcom.com",
    "date": "2021-11-02T04:05:50",
    "name": "[v3,14/20] net/bnxt: delete the VF pair before VF representor alloc",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0d45957a317eafe1b0a5e14233dac51811312810",
    "submitter": {
        "id": 1635,
        "url": "http://patches.dpdk.org/api/people/1635/?format=api",
        "name": "Venkat Duvvuru",
        "email": "venkatkumar.duvvuru@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "http://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211102040556.7840-15-venkatkumar.duvvuru@broadcom.com/mbox/",
    "series": [
        {
            "id": 20191,
            "url": "http://patches.dpdk.org/api/series/20191/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20191",
            "date": "2021-11-02T04:05:36",
            "name": "fixes and enhancements to Truflow",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/20191/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/103413/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/103413/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 6C2C6A0C4D;\n\tTue,  2 Nov 2021 05:07:57 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D72A441190;\n\tTue,  2 Nov 2021 05:06:30 +0100 (CET)",
            "from relay.smtp-ext.broadcom.com (lpdvsmtp09.broadcom.com\n [192.19.166.228])\n by mails.dpdk.org (Postfix) with ESMTP id B53FE4115F\n for <dev@dpdk.org>; Tue,  2 Nov 2021 05:06:28 +0100 (CET)",
            "from S60.dhcp.broadcom.net (unknown [10.123.66.170])\n (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n (No client certificate requested)\n by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id 0548D7A21;\n Mon,  1 Nov 2021 21:06:26 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 0548D7A21",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1635825988;\n bh=Y/60mFciM+G+nfCCfDsSPc6hS36LOOYwWMjE4H+oLBw=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=mq3u6XkM4KiV16A+OvpmK7ZgT4RDMhv2RnNKjLaum4zK5PujDBbJkZilC9Zm30D+t\n CVAEe5hMpbxbEEy3BOxaD7X2mZDv+6NssnWBXIq6aUtXqep1LCQvGWCMJBhWG4TGb6\n H7wlyXvMxqoWLbP9TLm12fgvnEEKZGpJX5jxY71s=",
        "From": "Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>",
        "Date": "Tue,  2 Nov 2021 09:35:50 +0530",
        "Message-Id": "<20211102040556.7840-15-venkatkumar.duvvuru@broadcom.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20211102040556.7840-1-venkatkumar.duvvuru@broadcom.com>",
        "References": "<20211001055909.27276-1-venkatkumar.duvvuru@broadcom.com>\n <20211102040556.7840-1-venkatkumar.duvvuru@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH v3 14/20] net/bnxt: delete the VF pair before VF\n representor alloc",
        "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": "From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\n\nWhen the VF representor interface is created, the VF pair relationship\nis established between the VF and it is representor. If the pair\nalready exists then the pair needs to be deleted before allocation.\nThis could happen if the application is abruptly killed and restarted.\nIf the deletion of an existing VF rep is not done then hw pipeline is not\ncleaned and a new allocation shall leave the hw in inconsistent state.\n\nSigned-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\nReviewed-by: Shahaji Bhosle <shahaji.bhosle@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c | 28 ++++++++++++++++++++++++++++\n drivers/net/bnxt/bnxt_hwrm.h |  1 +\n drivers/net/bnxt/bnxt_reps.c |  6 ++++++\n 3 files changed, 35 insertions(+)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex c7041143a3..f8c27fe316 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -6025,6 +6025,34 @@ int bnxt_hwrm_first_vf_id_query(struct bnxt *bp, uint16_t fid,\n \treturn rc;\n }\n \n+int bnxt_hwrm_cfa_pair_exists(struct bnxt *bp, struct bnxt_representor *rep_bp)\n+{\n+\tstruct hwrm_cfa_pair_info_output *resp = bp->hwrm_cmd_resp_addr;\n+\tstruct hwrm_cfa_pair_info_input req = {0};\n+\tint rc = 0;\n+\n+\tif (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {\n+\t\tPMD_DRV_LOG(DEBUG,\n+\t\t\t    \"Not a PF or trusted VF. Command not supported\\n\");\n+\t\treturn 0;\n+\t}\n+\n+\tHWRM_PREP(&req, HWRM_CFA_PAIR_INFO, BNXT_USE_CHIMP_MB);\n+\tsnprintf(req.pair_name, sizeof(req.pair_name), \"%svfr%d\",\n+\t\t bp->eth_dev->data->name, rep_bp->vf_id);\n+\treq.flags =\n+\t\trte_cpu_to_le_32(HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);\n+\tHWRM_CHECK_RESULT();\n+\tif (rc == HWRM_ERR_CODE_SUCCESS && strlen(resp->pair_name)) {\n+\t\tHWRM_UNLOCK();\n+\t\treturn !rc;\n+\t}\n+\tHWRM_UNLOCK();\n+\treturn rc;\n+}\n+\n int bnxt_hwrm_cfa_pair_alloc(struct bnxt *bp, struct bnxt_representor *rep_bp)\n {\n \tstruct hwrm_cfa_pair_alloc_output *resp = bp->hwrm_cmd_resp_addr;\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex 6dc23b93ac..33e6ba99d5 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -294,6 +294,7 @@ int bnxt_clear_one_vnic_filter(struct bnxt *bp,\n void bnxt_free_vf_info(struct bnxt *bp);\n int bnxt_hwrm_first_vf_id_query(struct bnxt *bp, uint16_t fid,\n \t\t\t\tuint16_t *first_vf_id);\n+int bnxt_hwrm_cfa_pair_exists(struct bnxt *bp, struct bnxt_representor *rep_bp);\n int bnxt_hwrm_cfa_pair_alloc(struct bnxt *bp, struct bnxt_representor *rep);\n int bnxt_hwrm_cfa_pair_free(struct bnxt *bp, struct bnxt_representor *rep);\n int bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(struct bnxt *bp);\ndiff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c\nindex 988f5a33a7..111d226a59 100644\n--- a/drivers/net/bnxt/bnxt_reps.c\n+++ b/drivers/net/bnxt/bnxt_reps.c\n@@ -315,6 +315,12 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)\n \t\tBNXT_TF_DBG(ERR, \"Invalid arguments\\n\");\n \t\treturn 0;\n \t}\n+\t/* update the port id so you can backtrack to ethdev */\n+\tvfr->dpdk_port_id = vfr_ethdev->data->port_id;\n+\n+\t/* If pair is present, then delete the pair */\n+\tif (bnxt_hwrm_cfa_pair_exists(parent_bp, vfr))\n+\t\t(void)bnxt_hwrm_cfa_pair_free(parent_bp, vfr);\n \n \t/* Update the ULP portdata base with the new VFR interface */\n \trc = ulp_port_db_dev_port_intf_update(parent_bp->ulp_ctx, vfr_ethdev);\n",
    "prefixes": [
        "v3",
        "14/20"
    ]
}