Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/127427/?format=api
http://patches.dpdk.org/api/patches/127427/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230525095904.3967080-18-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": "<20230525095904.3967080-18-ndabilpuram@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230525095904.3967080-18-ndabilpuram@marvell.com", "date": "2023-05-25T09:58:50", "name": "[v3,18/32] common/cnxk: add more comments to mbox code", "commit_ref": null, "pull_url": null, "state": "accepted", "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/20230525095904.3967080-18-ndabilpuram@marvell.com/mbox/", "series": [ { "id": 28180, "url": "http://patches.dpdk.org/api/series/28180/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28180", "date": "2023-05-25T09:58:36", "name": "[v3,01/32] common/cnxk: allocate dynamic BPIDs", "version": 3, "mbox": "http://patches.dpdk.org/series/28180/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/127427/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/127427/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 46B1A42B9A;\n\tThu, 25 May 2023 12:37:39 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C0C8342D56;\n\tThu, 25 May 2023 12:37:18 +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 718BD42D52\n for <dev@dpdk.org>; Thu, 25 May 2023 12:37:16 +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 34P9Il3B025637 for <dev@dpdk.org>; Thu, 25 May 2023 03:37:15 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qsspt2cm7-12\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 25 May 2023 03:37:15 -0700", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 25 May 2023 03:37:14 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Thu, 25 May 2023 03:37:14 -0700", "from hyd1588t430.caveonetworks.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 8D31C5B6D4A;\n Thu, 25 May 2023 03:00:10 -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=c+B/fLLHSa4arzjx9si43rldDOxRwoSffyiZQkRIS91AvxNTcUlKedToexxPhTxI0Hu3\n FLgsrYPUJl45Re/sNuMnj8wE6NNunUv14uMSLNvfZ9vlIS43N5dyFuhfZWCWG7oXJn7+\n 4F85oLk1S2mt6NgaMbZyjTykKbXgeGcmK1q32xZZiFuhcTzriiM1Oea1q3Kz6mj/3cYW\n FxsYLY4xI/U3L2+BpajLJDfzhnzu+VG1NedZ6d7ErOo54E5KxFxLgR9Up3qzE60mgy8B\n FBVzTf1W8iLhNxj2sCCbSisZTKV9VKqWAjHWysEyeqdVRz4M0gcPeumRyE3okKTeH2SH oA==", "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 v3 18/32] common/cnxk: add more comments to mbox code", "Date": "Thu, 25 May 2023 15:28:50 +0530", "Message-ID": "<20230525095904.3967080-18-ndabilpuram@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230525095904.3967080-1-ndabilpuram@marvell.com>", "References": "<20230411091144.1087887-1-ndabilpuram@marvell.com>\n <20230525095904.3967080-1-ndabilpuram@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "Z8usJ59mdaGSHHFrLogFG4fp18MekW_b", "X-Proofpoint-ORIG-GUID": "Z8usJ59mdaGSHHFrLogFG4fp18MekW_b", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26\n definitions=2023-05-25_06,2023-05-24_01,2023-05-22_02", "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": [ "v3", "18/32" ] }{ "id": 127427, "url": "