get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71400,
    "url": "http://patches.dpdk.org/api/patches/71400/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200612132934.16488-9-somnath.kotur@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": "<20200612132934.16488-9-somnath.kotur@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200612132934.16488-9-somnath.kotur@broadcom.com",
    "date": "2020-06-12T13:28:52",
    "name": "[08/50] net/bnxt: modify port_db to store & retrieve more info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c9f0bf7e6e0deef5f6a7ef7533c8b54c9c717509",
    "submitter": {
        "id": 908,
        "url": "http://patches.dpdk.org/api/people/908/?format=api",
        "name": "Somnath Kotur",
        "email": "somnath.kotur@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/20200612132934.16488-9-somnath.kotur@broadcom.com/mbox/",
    "series": [
        {
            "id": 10436,
            "url": "http://patches.dpdk.org/api/series/10436/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=10436",
            "date": "2020-06-12T13:28:44",
            "name": "add features for host-based flow management",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/10436/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/71400/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/71400/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 A59DBA00BE;\n\tFri, 12 Jun 2020 15:37:04 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C6EC41BF74;\n\tFri, 12 Jun 2020 15:34:17 +0200 (CEST)",
            "from relay.smtp.broadcom.com (unknown [192.19.232.149])\n by dpdk.org (Postfix) with ESMTP id 6571D1BF54\n for <dev@dpdk.org>; Fri, 12 Jun 2020 15:34:15 +0200 (CEST)",
            "from dhcp-10-123-153-55.dhcp.broadcom.net\n (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55])\n by relay.smtp.broadcom.com (Postfix) with ESMTP id 1AB891BD7AC;\n Fri, 12 Jun 2020 06:34:13 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 1AB891BD7AC",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1591968855;\n bh=DPbnKUPnIOPWYFDe/fTtOQUzcuGAOxJfWdgqYhN5ekI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=Lrh2aflsx4CO1GbE4914HQtuFAPmWJM03BSdr62v6pfT8ia7O39WzH/SdtAWQfHKs\n PbK3CvJVnTfdwXeEr8BMtrFns3PSRJ0JyMdiDYzUjpaizoTFm+0Mi4YwdSGql0229E\n Q0/RU9Mdly9zXuQ0VoSJ4soMyNr1uADkl+phlG08=",
        "From": "Somnath Kotur <somnath.kotur@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com",
        "Date": "Fri, 12 Jun 2020 18:58:52 +0530",
        "Message-Id": "<20200612132934.16488-9-somnath.kotur@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1.613.g2cc2e70",
        "In-Reply-To": "<20200612132934.16488-1-somnath.kotur@broadcom.com>",
        "References": "<20200612132934.16488-1-somnath.kotur@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 08/50] net/bnxt: modify port_db to store &\n\tretrieve more info",
        "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>\nSigned-off-by: Somnath Kotur <somnath.kotur@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 66b5840..ea27ef4 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 604c438..87de3bc 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": [
        "08/50"
    ]
}