get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 103801,
    "url": "http://patches.dpdk.org/api/patches/103801/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211104215846.58672-17-ajit.khaparde@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": "<20211104215846.58672-17-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211104215846.58672-17-ajit.khaparde@broadcom.com",
    "date": "2021-11-04T21:58:40",
    "name": "[v5,16/22] net/bnxt: modify VF representor alloc sequence",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0d45957a317eafe1b0a5e14233dac51811312810",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@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/20211104215846.58672-17-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 20322,
            "url": "http://patches.dpdk.org/api/series/20322/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20322",
            "date": "2021-11-04T21:58:24",
            "name": "fixes and enhancements to Truflow",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/20322/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/103801/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/103801/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 C9F53A0C5E;\n\tThu,  4 Nov 2021 23:00:44 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D9D5A427F8;\n\tThu,  4 Nov 2021 22:59:19 +0100 (CET)",
            "from mail-pl1-f174.google.com (mail-pl1-f174.google.com\n [209.85.214.174])\n by mails.dpdk.org (Postfix) with ESMTP id 370CB427E4\n for <dev@dpdk.org>; Thu,  4 Nov 2021 22:59:15 +0100 (CET)",
            "by mail-pl1-f174.google.com with SMTP id u11so9588918plf.3\n for <dev@dpdk.org>; Thu, 04 Nov 2021 14:59:15 -0700 (PDT)",
            "from C02GC2QQMD6T.wifi.broadcom.net ([192.19.223.252])\n by smtp.gmail.com with ESMTPSA id pg5sm8532242pjb.26.2021.11.04.14.59.13\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 04 Nov 2021 14:59:13 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version; bh=L2DPvxO8toGeU32btKk/0dRXPFu3cw4rkgFTGickopc=;\n b=YUDKiK4mL0qPLZqbfFDaQUmxhjWN5jXqTgDvSIp6Ye6G2ZdrId/ES1R/iqukk+CULY\n ETJSwQKZVwZQvU68DDCZMq4d0HWe2mSlgpgfOXVyJoPehaLnM/IZf5yIaMuZvgv5UBQO\n bBrdKMi63+IQk+JxBr9VhcxN7uiYQ4n9028OE=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version;\n bh=L2DPvxO8toGeU32btKk/0dRXPFu3cw4rkgFTGickopc=;\n b=Ugql9FBf0wCHQf7wFSCXG9ycLTCIYLcj10wSGJdKxup2bgTcrKBZqjxppgXobm91oF\n UwF1MNF6TSgU2JaEJPu789ujR08eHCQjKMwFVlIKIs0kmwiRT3sv6c5tgYccGPd74kyT\n GybLpfS4OuUaktsO6t4/Im4mhYP/k6UyvAhFY7z1MtQUNQmwU/i7t8euZJGLQCaE9r+Y\n s7gfWDGXe7TKwGg9GwMVz4gInOyuyL6MoW1mZLOWUStwM1BHwf/2fWMF44T33eM7ajas\n z6m2pOku77NGKCM6+57/YiM+NocYLU9zGYKjgjEvme4UgavaA+yxYRE+Bu7jcAqFqnO4\n K+6w==",
        "X-Gm-Message-State": "AOAM531Q+JU48ZHQQtKT+AhcZpvRfc5ZjHHDWXsuTKdQ14gbE6AOLEbG\n ipMkrH/ZiXdLjrhHuFv4fgohrkSnFzCrfbWyVLfkyDZW1i1S/sKl8oSICmGNhL5PfF7HKWdAVyp\n jmNbuRgYuEL04plMhu2FmLIDzcqCn7olXxOgCE22Ucos3kcHwHcwWfuFbicV0s6s=",
        "X-Google-Smtp-Source": "\n ABdhPJxa+1JxUR/i9KMgXXWf7/L8ASEPcJa0bltTCRwf1uW2zrvKJVVkusml8BWGVxamyJRRk6VXzw==",
        "X-Received": "by 2002:a17:902:db01:b0:141:ea12:2176 with SMTP id\n m1-20020a170902db0100b00141ea122176mr28135195plx.44.1636063154149;\n Thu, 04 Nov 2021 14:59:14 -0700 (PDT)",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Kishore Padmanabha <kishore.padmanabha@broadcom.com>,\n Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>,\n Shahaji Bhosle <sbhosle@broadcom.com>",
        "Date": "Thu,  4 Nov 2021 14:58:40 -0700",
        "Message-Id": "<20211104215846.58672-17-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.30.1 (Apple Git-130)",
        "In-Reply-To": "<20211104215846.58672-1-ajit.khaparde@broadcom.com>",
        "References": "<20211103005251.25524-1-ajit.khaparde@broadcom.com>\n <20211104215846.58672-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/signed; protocol=\"application/pkcs7-signature\";\n micalg=sha-256; boundary=\"00000000000028268305cffda325\"",
        "X-Content-Filtered-By": "Mailman/MimeDel 2.1.29",
        "Subject": "[dpdk-dev] [PATCH v5 16/22] net/bnxt: modify VF representor alloc\n sequence",
        "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: Shahaji Bhosle <sbhosle@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@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 94a7daf632..67ed807dad 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -5994,6 +5994,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 72d486468c..f8f0556201 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -293,6 +293,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 60aaa56299..22b76b72b9 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": [
        "v5",
        "16/22"
    ]
}