Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125922/?format=api
http://patches.dpdk.org/api/patches/125922/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230411091144.1087887-17-ndabilpuram@marvell.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": "<20230411091144.1087887-17-ndabilpuram@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230411091144.1087887-17-ndabilpuram@marvell.com", "date": "2023-04-11T09:11:40", "name": "[17/21] common/cnxk: add more comments to mbox code", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "47d8dfe3515fad90761c0b09d10f085c1fb4cfe9", "submitter": { "id": 1202, "url": "http://patches.dpdk.org/api/people/1202/?format=api", "name": "Nithin Dabilpuram", "email": "ndabilpuram@marvell.com" }, "delegate": { "id": 310, "url": "http://patches.dpdk.org/api/users/310/?format=api", "username": "jerin", "first_name": "Jerin", "last_name": "Jacob", "email": "jerinj@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230411091144.1087887-17-ndabilpuram@marvell.com/mbox/", "series": [ { "id": 27660, "url": "http://patches.dpdk.org/api/series/27660/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27660", "date": "2023-04-11T09:11:24", "name": "[01/21] common/cnxk: allocate dynamic BPIDs", "version": 1, "mbox": "http://patches.dpdk.org/series/27660/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/125922/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/125922/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 5C6874291B;\n\tTue, 11 Apr 2023 11:13:55 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A3DD042D61;\n\tTue, 11 Apr 2023 11:12:54 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 1C35542D50\n for <dev@dpdk.org>; Tue, 11 Apr 2023 11:12:53 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 33B8g4Cc014870 for <dev@dpdk.org>; Tue, 11 Apr 2023 02:12:52 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3purfs94jw-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 11 Apr 2023 02:12:52 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Tue, 11 Apr 2023 02:12:50 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Tue, 11 Apr 2023 02:12:50 -0700", "from hyd1588t430.caveonetworks.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id E2E393F706F;\n Tue, 11 Apr 2023 02:12:47 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=pMe2IPo8T3ph4jGX2J317OQQDJEx08PoxAbJzmuXDno=;\n b=YOVBWoDynY7OEmLxb/Ch9hYF2EeimECxrWWTHCl9btXdKI7frJ9JQdikySuVOfrMcauw\n adjHS/Oi3Gjil+OfIoM0MgRd1M71j89KUVrx3W43dXbjHYZeFYXxtY31ReaMZVMetC3M\n f1tC1NayVvmLfWZQX5PsgBnltD/cJHjpUrZWMo7nlRrUmWNEXX/lQZzZBPkQUPXaZlMO\n KQ3SOdO1YdRjFyJ+3Lvn7cBffXchdx8cDWNHhInwxEzDy5zwZy+TeUaaEM8WjeVG/PrP\n HrcN84PcQk9o4KEYZWbNoFZKIF8NR1rNwTXC1jIAUBMdeEJiUpQ4CwJBzyE45fJhZog5 UA==", "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>", "To": "Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>", "CC": "<jerinj@marvell.com>, <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>", "Subject": "[PATCH 17/21] common/cnxk: add more comments to mbox code", "Date": "Tue, 11 Apr 2023 14:41:40 +0530", "Message-ID": "<20230411091144.1087887-17-ndabilpuram@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230411091144.1087887-1-ndabilpuram@marvell.com>", "References": "<20230411091144.1087887-1-ndabilpuram@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-ORIG-GUID": "XhU2jSK7dM5depUA0z1hS2GImRLpFgw8", "X-Proofpoint-GUID": "XhU2jSK7dM5depUA0z1hS2GImRLpFgw8", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22\n definitions=2023-04-11_05,2023-04-06_03,2023-02-09_01", "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" }, "content": "From: Harman Kalra <hkalra@marvell.com>\n\nAdding more comments to the mbox routines to understand the flow\nwell.\n\nSigned-off-by: Harman Kalra <hkalra@marvell.com>\n---\n drivers/common/cnxk/roc_dev.c | 20 +++++++++++++++++---\n drivers/common/cnxk/roc_mbox.c | 5 +++++\n 2 files changed, 22 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c\nindex e5a5cd7c10..3125f9dda2 100644\n--- a/drivers/common/cnxk/roc_dev.c\n+++ b/drivers/common/cnxk/roc_dev.c\n@@ -98,6 +98,9 @@ pf_af_sync_msg(struct dev *dev, struct mbox_msghdr **rsp)\n \treturn rc;\n }\n \n+/* PF will send the messages to AF and wait for responses and forward the\n+ * responses to VF.\n+ */\n static int\n af_pf_wait_msg(struct dev *dev, uint16_t vf, int num_msg)\n {\n@@ -115,9 +118,10 @@ af_pf_wait_msg(struct dev *dev, uint16_t vf, int num_msg)\n \t/* We need to disable PF interrupts. We are in timer interrupt */\n \tplt_write64(~0ull, dev->bar2 + RVU_PF_INT_ENA_W1C);\n \n-\t/* Send message */\n+\t/* Send message to AF */\n \tmbox_msg_send(mbox, 0);\n \n+\t/* Wait for AF response */\n \tdo {\n \t\tplt_delay_ms(sleep);\n \t\ttimeout++;\n@@ -206,6 +210,7 @@ af_pf_wait_msg(struct dev *dev, uint16_t vf, int num_msg)\n \treturn req_hdr->num_msgs;\n }\n \n+/* PF receives mbox DOWN messages from VF and forwards to AF */\n static int\n vf_pf_process_msgs(struct dev *dev, uint16_t vf)\n {\n@@ -274,6 +279,7 @@ vf_pf_process_msgs(struct dev *dev, uint16_t vf)\n \tif (routed > 0) {\n \t\tplt_base_dbg(\"pf:%d routed %d messages from vf:%d to AF\",\n \t\t\t dev->pf, routed, vf);\n+\t\t/* PF will send the messages to AF and wait for responses */\n \t\taf_pf_wait_msg(dev, vf, routed);\n \t\tmbox_reset(dev->mbox, 0);\n \t}\n@@ -289,6 +295,7 @@ vf_pf_process_msgs(struct dev *dev, uint16_t vf)\n \treturn i;\n }\n \n+/* VF sends Ack to PF's UP messages */\n static int\n vf_pf_process_up_msgs(struct dev *dev, uint16_t vf)\n {\n@@ -339,6 +346,7 @@ vf_pf_process_up_msgs(struct dev *dev, uint16_t vf)\n \treturn i;\n }\n \n+/* PF handling messages from VF */\n static void\n roc_vf_pf_mbox_handle_msg(void *param)\n {\n@@ -352,8 +360,9 @@ roc_vf_pf_mbox_handle_msg(void *param)\n \t\tif (dev->intr.bits[vf / max_bits] & BIT_ULL(vf % max_bits)) {\n \t\t\tplt_base_dbg(\"Process vf:%d request (pf:%d, vf:%d)\", vf,\n \t\t\t\t dev->pf, dev->vf);\n+\t\t\t/* VF initiated down messages */\n \t\t\tvf_pf_process_msgs(dev, vf);\n-\t\t\t/* UP messages */\n+\t\t\t/* VF replies to PF's UP messages */\n \t\t\tvf_pf_process_up_msgs(dev, vf);\n \t\t\tdev->intr.bits[vf / max_bits] &=\n \t\t\t\t~(BIT_ULL(vf % max_bits));\n@@ -362,6 +371,7 @@ roc_vf_pf_mbox_handle_msg(void *param)\n \tdev->timer_set = 0;\n }\n \n+/* IRQ to PF from VF - PF context (interrupt thread) */\n static void\n roc_vf_pf_mbox_irq(void *param)\n {\n@@ -392,6 +402,7 @@ roc_vf_pf_mbox_irq(void *param)\n \t}\n }\n \n+/* Received response from AF (PF context) / PF (VF context) */\n static void\n process_msgs(struct dev *dev, struct mbox *mbox)\n {\n@@ -451,7 +462,7 @@ process_msgs(struct dev *dev, struct mbox *mbox)\n \t}\n \n \tmbox_reset(mbox, 0);\n-\t/* Update acked if someone is waiting a message */\n+\t/* Update acked if someone is waiting a message - mbox_wait is waiting */\n \tmdev->msgs_acked = msgs_acked;\n \tplt_wmb();\n }\n@@ -597,6 +608,7 @@ mbox_process_msgs_up(struct dev *dev, struct mbox_msghdr *req)\n \treturn -ENODEV;\n }\n \n+/* Received up messages from AF (PF context) / PF (in context) */\n static void\n process_msgs_up(struct dev *dev, struct mbox *mbox)\n {\n@@ -629,6 +641,7 @@ process_msgs_up(struct dev *dev, struct mbox *mbox)\n \t}\n }\n \n+/* IRQ to VF from PF - VF context (interrupt thread) */\n static void\n roc_pf_vf_mbox_irq(void *param)\n {\n@@ -657,6 +670,7 @@ roc_pf_vf_mbox_irq(void *param)\n \tprocess_msgs_up(dev, &dev->mbox_up);\n }\n \n+/* IRQ to PF from AF - PF context (interrupt thread) */\n static void\n roc_af_pf_mbox_irq(void *param)\n {\ndiff --git a/drivers/common/cnxk/roc_mbox.c b/drivers/common/cnxk/roc_mbox.c\nindex 5338a960d9..c91fa63e83 100644\n--- a/drivers/common/cnxk/roc_mbox.c\n+++ b/drivers/common/cnxk/roc_mbox.c\n@@ -350,6 +350,11 @@ mbox_wait(struct mbox *mbox, int devid, uint32_t rst_timo)\n \tuint32_t timeout = 0, sleep = 1;\n \n \trst_timo = rst_timo * 1000; /* Milli seconds to micro seconds */\n+\n+\t/* Waiting for mdev->msgs_acked tp become equal to mdev->num_msgs,\n+\t * mdev->msgs_acked are incremented at process_msgs() in interrupt\n+\t * thread context.\n+\t */\n \twhile (mdev->num_msgs > mdev->msgs_acked) {\n \t\tplt_delay_us(sleep);\n \t\ttimeout += sleep;\n", "prefixes": [ "17/21" ] }{ "id": 125922, "url": "