get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74914,
    "url": "http://patches.dpdk.org/api/patches/74914/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200728063439.23114-16-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": "<20200728063439.23114-16-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200728063439.23114-16-ajit.khaparde@broadcom.com",
    "date": "2020-07-28T06:34:32",
    "name": "[v4,15/22] net/bnxt: fix FW rule deletion on representor create",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "267487e1a4dbb343e3f6f29c682f150142ef3045",
    "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/20200728063439.23114-16-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 11349,
            "url": "http://patches.dpdk.org/api/series/11349/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11349",
            "date": "2020-07-28T06:34:17",
            "name": "bnxt patches",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/11349/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74914/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74914/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A4AB4A0521;\n\tTue, 28 Jul 2020 08:38:02 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 035BD1C1BF;\n\tTue, 28 Jul 2020 08:35:46 +0200 (CEST)",
            "from mail-wr1-f97.google.com (mail-wr1-f97.google.com\n [209.85.221.97]) by dpdk.org (Postfix) with ESMTP id F270A1C12B\n for <dev@dpdk.org>; Tue, 28 Jul 2020 08:35:21 +0200 (CEST)",
            "by mail-wr1-f97.google.com with SMTP id b6so17079550wrs.11\n for <dev@dpdk.org>; Mon, 27 Jul 2020 23:35:21 -0700 (PDT)",
            "from localhost.localdomain ([192.19.223.252])\n by smtp-relay.gmail.com with ESMTPS id r16sm30828wmh.29.2020.07.27.23.35.19\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Mon, 27 Jul 2020 23:35:21 -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:content-transfer-encoding;\n bh=G6iVu+I2JB7VGyILz9XCIhk2gs7Z+wZGQCPu0Xo6uuc=;\n b=F+ETlAKvd2liWKwZusLi9lAd2rgZKhkHgMWxCCkwrxog05riSfzF4VUGdap1wTLBRl\n tGavUqLS8NbJhG+r3S3sKIih14lm35UOR25VQjrXkWWI7fMUT/OUhcQhieX4ueMytZ4u\n UurJsJcuH2Bz08qnzX71jJB2mIcOEcheh/m50=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=G6iVu+I2JB7VGyILz9XCIhk2gs7Z+wZGQCPu0Xo6uuc=;\n b=dmyTv7k7Mm+U/uSoQoD3pm9UAO6hxAVcEOqFKR66lBrIjlgGQ8VHyUuL5WEAkr4kiq\n TTLpLL5g8aYn2RjV2GCCL+B6qZhXcEdjk9JYl9N05brnLY/M1Bs3xCBbNEajPy6MXgSb\n jsIgQICAy519FNzVUsfTwaRejqWGk9nCoSp8OFQyh++lxG0ZI836cWdG7G6Eg5Gruc69\n jtDpsS9GOg3n3tlR9n8ynSqstwhfKPwtt7fQcZ68u3yDBkYZO67C/vhh4u1GUuzNxino\n P0W2sE4qpw5Fz1sVCBjvZ+NVWeZd7UXhxJEHQG/EIDND2R8IXuwWJGiDKN29ZOVF15Wk\n xRJw==",
        "X-Gm-Message-State": "AOAM532fYo93CWh83GCMeEWQUvepVZhMRR3oNdvsdvbv5AnV58lveHJD\n 0/DDcfzVKNO6Ugt6AuxYxFhmV5K+5gYuUAGixm2FhmX/WDCCjO+Kx3+97y/h+JIOJl5bu4qK6eH\n W4RQeIb4FWNFIbJOoUELb9nz2issDw1k6ihynIauIsF9BrAa5ygQYqdV/RdmWLXoR4wEFHuRePh\n TbnQ==",
        "X-Google-Smtp-Source": "\n ABdhPJyFRHOgmhbYEfgpnb2zR8H/86VYwXoOjyYDTCY6z0pX+5d88wsC1CczRan0SAwcOlApcKx5KqrzG/63",
        "X-Received": "by 2002:adf:e7c9:: with SMTP id e9mr15881786wrn.10.1595918121381;\n Mon, 27 Jul 2020 23:35:21 -0700 (PDT)",
        "X-Relaying-Domain": "broadcom.com",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>,\n Somnath Kotur <somnath.kotur@broadcom.com>,\n Shahaji Bhosle <shahaji.bhosle@broadcom.com>",
        "Date": "Mon, 27 Jul 2020 23:34:32 -0700",
        "Message-Id": "<20200728063439.23114-16-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "In-Reply-To": "<20200728063439.23114-1-ajit.khaparde@broadcom.com>",
        "References": "\n <CACZ4nht+F+XvmJ0_TvYCQTfUEwan3dmCNer9wRuRQsOetFtodQ@mail.gmail.com>\n <20200728063439.23114-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 15/22] net/bnxt: fix FW rule deletion on\n\trepresentor create",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\n\nTruflow stack adds VFR to VF and VF to VFR conduits when VF\nrepresentor is created. However, in the ingress direction the\nVF's fw rules conflict with Truflow rules, resulting in not hitting\nthe Truflow VFR rules. To fix this, fw is going to remove it’s\nVF rules when vf representor is created in Truflow mode and will\nrestore the removed rules when vf representor is destroyed.\n\nThis patch invokes the vf representor alloc and free hwrm commands\nas part of which fw will do the above mentioned actions.\n\nFixes: 1e18ec58ed5c (\"net/bnxt: create default flow rules for port reprentor\")\n\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Shahaji Bhosle <shahaji.bhosle@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_hwrm.c           |  49 +++++++++\n drivers/net/bnxt/bnxt_hwrm.h           |   2 +\n drivers/net/bnxt/bnxt_reps.c           |  19 +++-\n drivers/net/bnxt/hsi_struct_def_dpdk.h | 138 +++++++++++++++++++++++++\n 4 files changed, 205 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 7ea13a8b2..f5f0dfe73 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -5486,6 +5486,55 @@ int bnxt_hwrm_cfa_counter_qstats(struct bnxt *bp,\n \treturn 0;\n }\n \n+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx)\n+{\n+\tstruct hwrm_cfa_vfr_alloc_output *resp = bp->hwrm_cmd_resp_addr;\n+\tstruct hwrm_cfa_vfr_alloc_input req = {0};\n+\tint rc;\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_VFR_ALLOC, BNXT_USE_CHIMP_MB);\n+\treq.vf_id = rte_cpu_to_le_16(vf_idx);\n+\tsnprintf(req.vfr_name, sizeof(req.vfr_name), \"%svfr%d\",\n+\t\t bp->eth_dev->data->name, vf_idx);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);\n+\tHWRM_CHECK_RESULT();\n+\n+\tHWRM_UNLOCK();\n+\tPMD_DRV_LOG(DEBUG, \"VFR %d allocated\\n\", vf_idx);\n+\treturn rc;\n+}\n+\n+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx)\n+{\n+\tstruct hwrm_cfa_vfr_free_output *resp = bp->hwrm_cmd_resp_addr;\n+\tstruct hwrm_cfa_vfr_free_input req = {0};\n+\tint rc;\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_VFR_FREE, BNXT_USE_CHIMP_MB);\n+\treq.vf_id = rte_cpu_to_le_16(vf_idx);\n+\tsnprintf(req.vfr_name, sizeof(req.vfr_name), \"%svfr%d\",\n+\t\t bp->eth_dev->data->name, vf_idx);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);\n+\tHWRM_CHECK_RESULT();\n+\tHWRM_UNLOCK();\n+\tPMD_DRV_LOG(DEBUG, \"VFR %d freed\\n\", vf_idx);\n+\treturn rc;\n+}\n+\n #ifdef RTE_LIBRTE_BNXT_PMD_SYSTEM\n int\n bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num)\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex 01201a7a4..4a2af13c9 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -278,4 +278,6 @@ int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp);\n int bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num);\n int bnxt_clear_one_vnic_filter(struct bnxt *bp,\n \t\t\t       struct bnxt_filter_info *filter);\n+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx);\n+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx);\n #endif\ndiff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c\nindex c425e69aa..2f775e0c0 100644\n--- a/drivers/net/bnxt/bnxt_reps.c\n+++ b/drivers/net/bnxt/bnxt_reps.c\n@@ -272,7 +272,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)\n \tif (rc) {\n \t\tBNXT_TF_DBG(DEBUG,\n \t\t\t    \"Default flow rule creation for VFR->VF failed!\\n\");\n-\t\treturn -EIO;\n+\t\tgoto err;\n \t}\n \n \tBNXT_TF_DBG(DEBUG, \"*** Default flow rule created for VFR->VF! ***\\n\");\n@@ -283,7 +283,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)\n \tif (rc) {\n \t\tBNXT_TF_DBG(DEBUG,\n \t\t\t    \"Failed to get action_ptr for VFR->VF dflt rule\\n\");\n-\t\treturn -EIO;\n+\t\tgoto rep2vf_free;\n \t}\n \tBNXT_TF_DBG(DEBUG, \"tx_cfa_action = %d\\n\", vfr->vfr_tx_cfa_action);\n \trc = ulp_default_flow_create(parent_dev, param_list,\n@@ -292,13 +292,24 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)\n \tif (rc) {\n \t\tBNXT_TF_DBG(DEBUG,\n \t\t\t    \"Default flow rule creation for VF->VFR failed!\\n\");\n-\t\treturn -EIO;\n+\t\tgoto rep2vf_free;\n \t}\n \n \tBNXT_TF_DBG(DEBUG, \"*** Default flow rule created for VF->VFR! ***\\n\");\n \tBNXT_TF_DBG(DEBUG, \"vfr2rep_flow_id = %d\\n\", vfr->vf2rep_flow_id);\n \n+\trc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);\n+\tif (rc)\n+\t\tgoto vf2rep_free;\n+\n \treturn 0;\n+\n+vf2rep_free:\n+\tulp_default_flow_destroy(vfr->parent_dev, vfr->vf2rep_flow_id);\n+rep2vf_free:\n+\tulp_default_flow_destroy(vfr->parent_dev, vfr->rep2vf_flow_id);\n+err:\n+\treturn -EIO;\n }\n \n static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)\n@@ -414,6 +425,8 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)\n \tvfr->vfr_tx_cfa_action = 0;\n \tvfr->rx_cfa_code = 0;\n \n+\trc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);\n+\n \treturn rc;\n }\n \ndiff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h\nindex 598da7153..fb4f712ce 100644\n--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h\n+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h\n@@ -35127,6 +35127,144 @@ struct hwrm_cfa_pair_info_output {\n \tuint8_t\tvalid;\n } __rte_packed;\n \n+/**********************\n+ * hwrm_cfa_vfr_alloc *\n+ **********************/\n+\n+\n+/* hwrm_cfa_vfr_alloc_input (size:448b/56B) */\n+struct hwrm_cfa_vfr_alloc_input {\n+\t/* The HWRM command request type. */\n+\tuint16_t\treq_type;\n+\t/*\n+\t * The completion ring to send the completion event on. This should\n+\t * be the NQ ID returned from the `nq_alloc` HWRM command.\n+\t */\n+\tuint16_t\tcmpl_ring;\n+\t/*\n+\t * The sequence ID is used by the driver for tracking multiple\n+\t * commands. This ID is treated as opaque data by the firmware and\n+\t * the value is returned in the `hwrm_resp_hdr` upon completion.\n+\t */\n+\tuint16_t\tseq_id;\n+\t/*\n+\t * The target ID of the command:\n+\t * * 0x0-0xFFF8 - The function ID\n+\t * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors\n+\t * * 0xFFFD - Reserved for user-space HWRM interface\n+\t * * 0xFFFF - HWRM\n+\t */\n+\tuint16_t\ttarget_id;\n+\t/*\n+\t * A physical address pointer pointing to a host buffer that the\n+\t * command's response data will be written. This can be either a host\n+\t * physical address (HPA) or a guest physical address (GPA) and must\n+\t * point to a physically contiguous block of memory.\n+\t */\n+\tuint64_t\tresp_addr;\n+\t/* Logical VF number (range: 0 -> MAX_VFS -1). */\n+\tuint16_t\tvf_id;\n+\t/*\n+\t * This field is reserved for the future use.\n+\t * It shall be set to 0.\n+\t */\n+\tuint16_t\treserved;\n+\tuint8_t\tunused_0[4];\n+\t/* VF Representor name (32 byte string). */\n+\tchar\tvfr_name[32];\n+} __rte_packed;\n+\n+/* hwrm_cfa_vfr_alloc_output (size:128b/16B) */\n+struct hwrm_cfa_vfr_alloc_output {\n+\t/* The specific error status for the command. */\n+\tuint16_t\terror_code;\n+\t/* The HWRM command request type. */\n+\tuint16_t\treq_type;\n+\t/* The sequence ID from the original command. */\n+\tuint16_t\tseq_id;\n+\t/* The length of the response data in number of bytes. */\n+\tuint16_t\tresp_len;\n+\t/* Rx CFA code. */\n+\tuint16_t\trx_cfa_code;\n+\t/* Tx CFA action. */\n+\tuint16_t\ttx_cfa_action;\n+\tuint8_t\tunused_0[3];\n+\t/*\n+\t * This field is used in Output records to indicate that the output\n+\t * is completely written to RAM.  This field should be read as '1'\n+\t * to indicate that the output has been completely written.\n+\t * When writing a command completion or response to an internal processor,\n+\t * the order of writes has to be such that this field is written last.\n+\t */\n+\tuint8_t\tvalid;\n+} __rte_packed;\n+\n+/*********************\n+ * hwrm_cfa_vfr_free *\n+ *********************/\n+\n+\n+/* hwrm_cfa_vfr_free_input (size:448b/56B) */\n+struct hwrm_cfa_vfr_free_input {\n+\t/* The HWRM command request type. */\n+\tuint16_t\treq_type;\n+\t/*\n+\t * The completion ring to send the completion event on. This should\n+\t * be the NQ ID returned from the `nq_alloc` HWRM command.\n+\t */\n+\tuint16_t\tcmpl_ring;\n+\t/*\n+\t * The sequence ID is used by the driver for tracking multiple\n+\t * commands. This ID is treated as opaque data by the firmware and\n+\t * the value is returned in the `hwrm_resp_hdr` upon completion.\n+\t */\n+\tuint16_t\tseq_id;\n+\t/*\n+\t * The target ID of the command:\n+\t * * 0x0-0xFFF8 - The function ID\n+\t * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors\n+\t * * 0xFFFD - Reserved for user-space HWRM interface\n+\t * * 0xFFFF - HWRM\n+\t */\n+\tuint16_t\ttarget_id;\n+\t/*\n+\t * A physical address pointer pointing to a host buffer that the\n+\t * command's response data will be written. This can be either a host\n+\t * physical address (HPA) or a guest physical address (GPA) and must\n+\t * point to a physically contiguous block of memory.\n+\t */\n+\tuint64_t\tresp_addr;\n+\t/* VF Representor name (32 byte string). */\n+\tchar\t\tvfr_name[32];\n+\t/* Logical VF number (range: 0 -> MAX_VFS -1). */\n+\tuint16_t\tvf_id;\n+\tuint16_t\treserved;\n+\tuint8_t\t\tunused_0[4];\n+} __rte_packed;\n+\n+/* hwrm_cfa_vfr_free_output (size:128b/16B) */\n+struct hwrm_cfa_vfr_free_output {\n+\t/* The specific error status for the command. */\n+\tuint16_t\terror_code;\n+\t/* The HWRM command request type. */\n+\tuint16_t\treq_type;\n+\t/* The sequence ID from the original command. */\n+\tuint16_t\tseq_id;\n+\t/* The length of the response data in number of bytes. */\n+\tuint16_t\tresp_len;\n+\tuint8_t\tunused_0[7];\n+\t/*\n+\t * This field is used in Output records to indicate that the output\n+\t * is completely written to RAM.  This field should be read as '1'\n+\t * to indicate that the output has been completely written.\n+\t * When writing a command completion or response to an internal processor,\n+\t * the order of writes has to be such that this field is written last.\n+\t */\n+\tuint8_t\tvalid;\n+} __rte_packed;\n+\n+\n+\n /***************************************\n  * hwrm_cfa_redirect_query_tunnel_type *\n  ***************************************/\n",
    "prefixes": [
        "v4",
        "15/22"
    ]
}