get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73054,
    "url": "https://patches.dpdk.org/api/patches/73054/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200703210210.40568-9-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20200703210210.40568-9-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200703210210.40568-9-ajit.khaparde@broadcom.com",
    "date": "2020-07-03T21:01:27",
    "name": "[v5,08/51] net/bnxt: modify port db to handle more info",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c9f0bf7e6e0deef5f6a7ef7533c8b54c9c717509",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200703210210.40568-9-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 10785,
            "url": "https://patches.dpdk.org/api/series/10785/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10785",
            "date": "2020-07-03T21:01:19",
            "name": "net/bnxt: add features for host-based flow management",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/10785/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73054/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/73054/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 B81C3A0524;\n\tFri,  3 Jul 2020 23:05:51 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 073451DC71;\n\tFri,  3 Jul 2020 23:05:08 +0200 (CEST)",
            "from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com\n [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 9A06B1DBED\n for <dev@dpdk.org>; Fri,  3 Jul 2020 23:04:58 +0200 (CEST)",
            "from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net\n [10.75.242.48])\n by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 8DE7130C03F;\n Fri,  3 Jul 2020 14:04:57 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.230.185.215])\n by mail-irv-17.broadcom.com (Postfix) with ESMTP id 0AE9D140069;\n Fri,  3 Jul 2020 14:04:57 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 8DE7130C03F",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1593810297;\n bh=8NtVhN3FWmlmAuafRZcQf2jR4TZBh7iz7djKqJs1+g8=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=DvR+M1wyEvroAbXfORt+QLQKBue+1lWhN4chmwW2GAdhAtwy6Rf0yoEwI6ZDqjdRp\n rhW251syGQpOnvklzyJywm5c7G88X7ajfGSZVKdKuXjCoQwiNKih4jZ/rYaMYJTgH7\n ZxnTQYHnks+rwEdsH/80w6uyj8cNQBHQtwFxjJbE=",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>,\n Somnath Kotur <somnath.kotur@broadcom.com>,\n Kishore Padmanabha <kishore.padmanabha@broadcom.com>",
        "Date": "Fri,  3 Jul 2020 14:01:27 -0700",
        "Message-Id": "<20200703210210.40568-9-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.21.1 (Apple Git-122.3)",
        "In-Reply-To": "<20200703210210.40568-1-ajit.khaparde@broadcom.com>",
        "References": "<1f5421dc-0453-6dc8-09c2-ddfff6eb4888@intel.com>\n <20200703210210.40568-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v5 08/51] net/bnxt: modify port db to handle more\n\tinfo",
        "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\nApart from func_svif, func_id & vnic, port_db now stores and\nretrieves func_spif, func_parif, phy_port_id, port_svif, port_spif,\nport_parif, port_vport. New helper functions have been added to\nsupport the same.\n\nSigned-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/tf_ulp/ulp_port_db.c | 145 +++++++++++++++++++++-----\n drivers/net/bnxt/tf_ulp/ulp_port_db.h |  72 ++++++++++---\n 2 files changed, 179 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_port_db.c b/drivers/net/bnxt/tf_ulp/ulp_port_db.c\nindex 66b584026..ea27ef41f 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_port_db.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_port_db.c\n@@ -106,13 +106,12 @@ int32_t\tulp_port_db_deinit(struct bnxt_ulp_context *ulp_ctxt)\n int32_t\tulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,\n \t\t\t\t\t struct rte_eth_dev *eth_dev)\n {\n-\tstruct bnxt_ulp_port_db *port_db;\n-\tstruct bnxt *bp = eth_dev->data->dev_private;\n \tuint32_t port_id = eth_dev->data->port_id;\n-\tuint32_t ifindex;\n+\tstruct ulp_phy_port_info *port_data;\n+\tstruct bnxt_ulp_port_db *port_db;\n \tstruct ulp_interface_info *intf;\n+\tuint32_t ifindex;\n \tint32_t rc;\n-\tstruct bnxt_vnic_info *vnic;\n \n \tport_db = bnxt_ulp_cntxt_ptr2_port_db_get(ulp_ctxt);\n \tif (!port_db) {\n@@ -133,22 +132,22 @@ int32_t\tulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,\n \n \t/* update the interface details */\n \tintf = &port_db->ulp_intf_list[ifindex];\n-\tif (BNXT_PF(bp) || BNXT_VF(bp)) {\n-\t\tif (BNXT_PF(bp)) {\n-\t\t\tintf->type = BNXT_ULP_INTF_TYPE_PF;\n-\t\t\tintf->port_svif = bp->port_svif;\n-\t\t} else {\n-\t\t\tintf->type = BNXT_ULP_INTF_TYPE_VF;\n-\t\t}\n-\t\tintf->func_id = bp->fw_fid;\n-\t\tintf->func_svif = bp->func_svif;\n-\t\tvnic = BNXT_GET_DEFAULT_VNIC(bp);\n-\t\tif (vnic)\n-\t\t\tintf->default_vnic = vnic->fw_vnic_id;\n-\t\tintf->bp = bp;\n-\t\tmemcpy(intf->mac_addr, bp->mac_addr, sizeof(intf->mac_addr));\n-\t} else {\n-\t\tBNXT_TF_DBG(ERR, \"Invalid interface type\\n\");\n+\n+\tintf->type = bnxt_get_interface_type(port_id);\n+\n+\tintf->func_id = bnxt_get_fw_func_id(port_id);\n+\tintf->func_svif = bnxt_get_svif(port_id, 1);\n+\tintf->func_spif = bnxt_get_phy_port_id(port_id);\n+\tintf->func_parif = bnxt_get_parif(port_id);\n+\tintf->default_vnic = bnxt_get_vnic_id(port_id);\n+\tintf->phy_port_id = bnxt_get_phy_port_id(port_id);\n+\n+\tif (intf->type == BNXT_ULP_INTF_TYPE_PF) {\n+\t\tport_data = &port_db->phy_port_list[intf->phy_port_id];\n+\t\tport_data->port_svif = bnxt_get_svif(port_id, 0);\n+\t\tport_data->port_spif = bnxt_get_phy_port_id(port_id);\n+\t\tport_data->port_parif = bnxt_get_parif(port_id);\n+\t\tport_data->port_vport = bnxt_get_vport(port_id);\n \t}\n \n \treturn 0;\n@@ -209,7 +208,7 @@ ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt,\n }\n \n /*\n- * Api to get the svid for a given ulp ifindex.\n+ * Api to get the svif for a given ulp ifindex.\n  *\n  * ulp_ctxt [in] Ptr to ulp context\n  * ifindex [in] ulp ifindex\n@@ -225,16 +224,88 @@ ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt,\n \t\t     uint16_t *svif)\n {\n \tstruct bnxt_ulp_port_db *port_db;\n+\tuint16_t phy_port_id;\n \n \tport_db = bnxt_ulp_cntxt_ptr2_port_db_get(ulp_ctxt);\n \tif (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) {\n \t\tBNXT_TF_DBG(ERR, \"Invalid Arguments\\n\");\n \t\treturn -EINVAL;\n \t}\n-\tif (dir == ULP_DIR_EGRESS)\n+\tif (dir == ULP_DIR_EGRESS) {\n \t\t*svif = port_db->ulp_intf_list[ifindex].func_svif;\n-\telse\n-\t\t*svif = port_db->ulp_intf_list[ifindex].port_svif;\n+\t} else {\n+\t\tphy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id;\n+\t\t*svif = port_db->phy_port_list[phy_port_id].port_svif;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/*\n+ * Api to get the spif for a given ulp ifindex.\n+ *\n+ * ulp_ctxt [in] Ptr to ulp context\n+ * ifindex [in] ulp ifindex\n+ * dir [in] the direction for the flow.\n+ * spif [out] the spif of the given ifindex.\n+ *\n+ * Returns 0 on success or negative number on failure.\n+ */\n+int32_t\n+ulp_port_db_spif_get(struct bnxt_ulp_context *ulp_ctxt,\n+\t\t     uint32_t ifindex,\n+\t\t     uint32_t dir,\n+\t\t     uint16_t *spif)\n+{\n+\tstruct bnxt_ulp_port_db *port_db;\n+\tuint16_t phy_port_id;\n+\n+\tport_db = bnxt_ulp_cntxt_ptr2_port_db_get(ulp_ctxt);\n+\tif (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid Arguments\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (dir == ULP_DIR_EGRESS) {\n+\t\t*spif = port_db->ulp_intf_list[ifindex].func_spif;\n+\t} else {\n+\t\tphy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id;\n+\t\t*spif = port_db->phy_port_list[phy_port_id].port_spif;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/*\n+ * Api to get the parif for a given ulp ifindex.\n+ *\n+ * ulp_ctxt [in] Ptr to ulp context\n+ * ifindex [in] ulp ifindex\n+ * dir [in] the direction for the flow.\n+ * parif [out] the parif of the given ifindex.\n+ *\n+ * Returns 0 on success or negative number on failure.\n+ */\n+int32_t\n+ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt,\n+\t\t     uint32_t ifindex,\n+\t\t     uint32_t dir,\n+\t\t     uint16_t *parif)\n+{\n+\tstruct bnxt_ulp_port_db *port_db;\n+\tuint16_t phy_port_id;\n+\n+\tport_db = bnxt_ulp_cntxt_ptr2_port_db_get(ulp_ctxt);\n+\tif (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid Arguments\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (dir == ULP_DIR_EGRESS) {\n+\t\t*parif = port_db->ulp_intf_list[ifindex].func_parif;\n+\t} else {\n+\t\tphy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id;\n+\t\t*parif = port_db->phy_port_list[phy_port_id].port_parif;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -262,3 +333,29 @@ ulp_port_db_default_vnic_get(struct bnxt_ulp_context *ulp_ctxt,\n \t*vnic = port_db->ulp_intf_list[ifindex].default_vnic;\n \treturn 0;\n }\n+\n+/*\n+ * Api to get the vport id for a given ulp ifindex.\n+ *\n+ * ulp_ctxt [in] Ptr to ulp context\n+ * ifindex [in] ulp ifindex\n+ * vport [out] the port of the given ifindex.\n+ *\n+ * Returns 0 on success or negative number on failure.\n+ */\n+int32_t\n+ulp_port_db_vport_get(struct bnxt_ulp_context *ulp_ctxt,\n+\t\t      uint32_t ifindex, uint16_t *vport)\n+{\n+\tstruct bnxt_ulp_port_db *port_db;\n+\tuint16_t phy_port_id;\n+\n+\tport_db = bnxt_ulp_cntxt_ptr2_port_db_get(ulp_ctxt);\n+\tif (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) {\n+\t\tBNXT_TF_DBG(ERR, \"Invalid Arguments\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tphy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id;\n+\t*vport = port_db->phy_port_list[phy_port_id].port_vport;\n+\treturn 0;\n+}\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_port_db.h b/drivers/net/bnxt/tf_ulp/ulp_port_db.h\nindex 604c4385a..87de3bcbc 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_port_db.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_port_db.h\n@@ -15,11 +15,17 @@ struct ulp_interface_info {\n \tenum bnxt_ulp_intf_type\ttype;\n \tuint16_t\t\tfunc_id;\n \tuint16_t\t\tfunc_svif;\n-\tuint16_t\t\tport_svif;\n+\tuint16_t\t\tfunc_spif;\n+\tuint16_t\t\tfunc_parif;\n \tuint16_t\t\tdefault_vnic;\n-\tuint8_t\t\t\tmac_addr[RTE_ETHER_ADDR_LEN];\n-\t/* back pointer to the bnxt driver, it is null for rep ports */\n-\tstruct bnxt\t\t*bp;\n+\tuint16_t\t\tphy_port_id;\n+};\n+\n+struct ulp_phy_port_info {\n+\tuint16_t\tport_svif;\n+\tuint16_t\tport_spif;\n+\tuint16_t\tport_parif;\n+\tuint16_t\tport_vport;\n };\n \n /* Structure for the Port database */\n@@ -29,6 +35,7 @@ struct bnxt_ulp_port_db {\n \n \t/* dpdk device external port list */\n \tuint16_t\t\t\tdev_port_list[RTE_MAX_ETHPORTS];\n+\tstruct ulp_phy_port_info\tphy_port_list[RTE_MAX_ETHPORTS];\n };\n \n /*\n@@ -74,8 +81,7 @@ int32_t\tulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,\n  */\n int32_t\n ulp_port_db_dev_port_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt,\n-\t\t\t\t  uint32_t port_id,\n-\t\t\t\t  uint32_t *ifindex);\n+\t\t\t\t  uint32_t port_id, uint32_t *ifindex);\n \n /*\n  * Api to get the function id for a given ulp ifindex.\n@@ -88,11 +94,10 @@ ulp_port_db_dev_port_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt,\n  */\n int32_t\n ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt,\n-\t\t\t    uint32_t ifindex,\n-\t\t\t    uint16_t *func_id);\n+\t\t\t    uint32_t ifindex, uint16_t *func_id);\n \n /*\n- * Api to get the svid for a given ulp ifindex.\n+ * Api to get the svif for a given ulp ifindex.\n  *\n  * ulp_ctxt [in] Ptr to ulp context\n  * ifindex [in] ulp ifindex\n@@ -103,9 +108,36 @@ ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt,\n  */\n int32_t\n ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt,\n-\t\t     uint32_t ifindex,\n-\t\t     uint32_t dir,\n-\t\t     uint16_t *svif);\n+\t\t     uint32_t ifindex, uint32_t dir, uint16_t *svif);\n+\n+/*\n+ * Api to get the spif for a given ulp ifindex.\n+ *\n+ * ulp_ctxt [in] Ptr to ulp context\n+ * ifindex [in] ulp ifindex\n+ * dir [in] the direction for the flow.\n+ * spif [out] the spif of the given ifindex.\n+ *\n+ * Returns 0 on success or negative number on failure.\n+ */\n+int32_t\n+ulp_port_db_spif_get(struct bnxt_ulp_context *ulp_ctxt,\n+\t\t     uint32_t ifindex, uint32_t dir, uint16_t *spif);\n+\n+\n+/*\n+ * Api to get the parif for a given ulp ifindex.\n+ *\n+ * ulp_ctxt [in] Ptr to ulp context\n+ * ifindex [in] ulp ifindex\n+ * dir [in] the direction for the flow.\n+ * parif [out] the parif of the given ifindex.\n+ *\n+ * Returns 0 on success or negative number on failure.\n+ */\n+int32_t\n+ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt,\n+\t\t      uint32_t ifindex, uint32_t dir, uint16_t *parif);\n \n /*\n  * Api to get the vnic id for a given ulp ifindex.\n@@ -118,7 +150,19 @@ ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt,\n  */\n int32_t\n ulp_port_db_default_vnic_get(struct bnxt_ulp_context *ulp_ctxt,\n-\t\t\t     uint32_t ifindex,\n-\t\t\t     uint16_t *vnic);\n+\t\t\t     uint32_t ifindex, uint16_t *vnic);\n+\n+/*\n+ * Api to get the vport id for a given ulp ifindex.\n+ *\n+ * ulp_ctxt [in] Ptr to ulp context\n+ * ifindex [in] ulp ifindex\n+ * vport [out] the port of the given ifindex.\n+ *\n+ * Returns 0 on success or negative number on failure.\n+ */\n+int32_t\n+ulp_port_db_vport_get(struct bnxt_ulp_context *ulp_ctxt,\n+\t\t      uint32_t ifindex,\tuint16_t *vport);\n \n #endif /* _ULP_PORT_DB_H_ */\n",
    "prefixes": [
        "v5",
        "08/51"
    ]
}