Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126547/?format=api
http://patches.dpdk.org/api/patches/126547/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230426102259.205992-15-wenjing.qiao@intel.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": "<20230426102259.205992-15-wenjing.qiao@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230426102259.205992-15-wenjing.qiao@intel.com", "date": "2023-04-26T10:22:58", "name": "[v3,14/15] common/idpf/base: add func to clean all DESCs on controlq", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "150681768452cc979b5e744d770a2c832ba23e8c", "submitter": { "id": 2680, "url": "http://patches.dpdk.org/api/people/2680/?format=api", "name": "Wenjing Qiao", "email": "wenjing.qiao@intel.com" }, "delegate": { "id": 1540, "url": "http://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230426102259.205992-15-wenjing.qiao@intel.com/mbox/", "series": [ { "id": 27874, "url": "http://patches.dpdk.org/api/series/27874/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27874", "date": "2023-04-26T10:22:44", "name": "update idpf base code", "version": 3, "mbox": "http://patches.dpdk.org/series/27874/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/126547/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/126547/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 4417F42A02;\n\tWed, 26 Apr 2023 12:29:29 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 159EB42D13;\n\tWed, 26 Apr 2023 12:28:24 +0200 (CEST)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id AB8A442D7C\n for <dev@dpdk.org>; Wed, 26 Apr 2023 12:28:21 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Apr 2023 03:28:21 -0700", "from dpdk-wenjing-01.sh.intel.com ([10.67.118.239])\n by fmsmga005.fm.intel.com with ESMTP; 26 Apr 2023 03:28:19 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1682504901; x=1714040901;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=eAM6Cws01kD4xK3/PFvH/Ake/7Q0Lm96Gu58dzqsv3M=;\n b=OBM8c6B9SIsTZoeVANP+G74GvDYlUlbM6gOvMHhq7baa9xm3WHfVr8Yx\n DMI3feaOzth2SqxMbQ9wNCRD+whVHAvFrTAixAxBZbk46i98gdyP9y8Nu\n K6fl51yCDqJ+STakRB2z/Vcp1z+l+Weyx6m76owbHLSt+BRmo1aMYPXGv\n h8cwpv2cwpRpoaU/Fow0AmYmk3HKr+87lb/pkhiMX2UB/V1YTW+6j8SJT\n Qc5S+bR3XF3tltcgoBSiB+MTZ4Rci8NYRQwciddFd0ItU2m/fdtWYywPs\n xZteyPeu0w2cTTOGWVCBD+ECl+G+WvWzAx052CvNa27NU1t3cPml9nJqe g==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10691\"; a=\"327391587\"", "E=Sophos;i=\"5.99,227,1677571200\"; d=\"scan'208\";a=\"327391587\"", "E=McAfee;i=\"6600,9927,10691\"; a=\"1023552778\"", "E=Sophos;i=\"5.99,227,1677571200\"; d=\"scan'208\";a=\"1023552778\"" ], "X-ExtLoop1": "1", "From": "Wenjing Qiao <wenjing.qiao@intel.com>", "To": "jingjing.wu@intel.com,\n\tbeilei.xing@intel.com,\n\tqi.z.zhang@intel.com", "Cc": "dev@dpdk.org, mingxia.liu@intel.com,\n Wenjing Qiao <wenjing.qiao@intel.com>,\n NorbertX Ciosek <norbertx.ciosek@intel.com>", "Subject": "[PATCH v3 14/15] common/idpf/base: add func to clean all DESCs on\n controlq", "Date": "Wed, 26 Apr 2023 06:22:58 -0400", "Message-Id": "<20230426102259.205992-15-wenjing.qiao@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230426102259.205992-1-wenjing.qiao@intel.com>", "References": "<20230421084043.135503-2-wenjing.qiao@intel.com>\n <20230426102259.205992-1-wenjing.qiao@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Add 'idpf_ctlq_clean_sq_force' which will clean all descriptors on\ngiven control queue. It is needed in case control plane is not\nrunning and we need to do proper driver cleanup.\n\nSigned-off-by: NorbertX Ciosek <norbertx.ciosek@intel.com>\nSigned-off-by: Wenjing Qiao <wenjing.qiao@intel.com>\n---\n drivers/common/idpf/base/idpf_controlq.c | 56 ++++++++++++++++++--\n drivers/common/idpf/base/idpf_controlq_api.h | 4 ++\n 2 files changed, 55 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/common/idpf/base/idpf_controlq.c b/drivers/common/idpf/base/idpf_controlq.c\nindex 8381e4000f..9374fce71e 100644\n--- a/drivers/common/idpf/base/idpf_controlq.c\n+++ b/drivers/common/idpf/base/idpf_controlq.c\n@@ -386,13 +386,15 @@ int idpf_ctlq_send(struct idpf_hw *hw, struct idpf_ctlq_info *cq,\n }\n \n /**\n- * idpf_ctlq_clean_sq - reclaim send descriptors on HW write back for the\n- * requested queue\n+ * __idpf_ctlq_clean_sq - helper function to reclaim descriptors on HW write\n+ * back for the requested queue\n * @cq: pointer to the specific Control queue\n * @clean_count: (input|output) number of descriptors to clean as input, and\n * number of descriptors actually cleaned as output\n * @msg_status: (output) pointer to msg pointer array to be populated; needs\n * to be allocated by caller\n+ * @force: (input) clean descriptors which were not done yet. Use with caution\n+ * in kernel mode only\n *\n * Returns an array of message pointers associated with the cleaned\n * descriptors. The pointers are to the original ctlq_msgs sent on the cleaned\n@@ -400,8 +402,8 @@ int idpf_ctlq_send(struct idpf_hw *hw, struct idpf_ctlq_info *cq,\n * to send will have a non-zero status. The caller is expected to free original\n * ctlq_msgs and free or reuse the DMA buffers.\n */\n-int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n-\t\t struct idpf_ctlq_msg *msg_status[])\n+static int __idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n+\t\t\t\tstruct idpf_ctlq_msg *msg_status[], bool force)\n {\n \tstruct idpf_ctlq_desc *desc;\n \tu16 i = 0, num_to_clean;\n@@ -425,7 +427,7 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n \tfor (i = 0; i < num_to_clean; i++) {\n \t\t/* Fetch next descriptor and check if marked as done */\n \t\tdesc = IDPF_CTLQ_DESC(cq, ntc);\n-\t\tif (!(LE16_TO_CPU(desc->flags) & IDPF_CTLQ_FLAG_DD))\n+\t\tif (!force && !(LE16_TO_CPU(desc->flags) & IDPF_CTLQ_FLAG_DD))\n \t\t\tbreak;\n \n \t\tdesc_err = LE16_TO_CPU(desc->ret_val);\n@@ -435,6 +437,8 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n \t\t}\n \n \t\tmsg_status[i] = cq->bi.tx_msg[ntc];\n+\t\tif (!msg_status[i])\n+\t\t\tbreak;\n \t\tmsg_status[i]->status = desc_err;\n \n \t\tcq->bi.tx_msg[ntc] = NULL;\n@@ -457,6 +461,48 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n \treturn ret;\n }\n \n+/**\n+ * idpf_ctlq_clean_sq_force - reclaim all descriptors on HW write back for the\n+ * requested queue. Use only in kernel mode.\n+ * @cq: pointer to the specific Control queue\n+ * @clean_count: (input|output) number of descriptors to clean as input, and\n+ * number of descriptors actually cleaned as output\n+ * @msg_status: (output) pointer to msg pointer array to be populated; needs\n+ * to be allocated by caller\n+ *\n+ * Returns an array of message pointers associated with the cleaned\n+ * descriptors. The pointers are to the original ctlq_msgs sent on the cleaned\n+ * descriptors. The status will be returned for each; any messages that failed\n+ * to send will have a non-zero status. The caller is expected to free original\n+ * ctlq_msgs and free or reuse the DMA buffers.\n+ */\n+int idpf_ctlq_clean_sq_force(struct idpf_ctlq_info *cq, u16 *clean_count,\n+\t\t\t struct idpf_ctlq_msg *msg_status[])\n+{\n+\treturn __idpf_ctlq_clean_sq(cq, clean_count, msg_status, true);\n+}\n+\n+/**\n+ * idpf_ctlq_clean_sq - reclaim send descriptors on HW write back for the\n+ * requested queue\n+ * @cq: pointer to the specific Control queue\n+ * @clean_count: (input|output) number of descriptors to clean as input, and\n+ * number of descriptors actually cleaned as output\n+ * @msg_status: (output) pointer to msg pointer array to be populated; needs\n+ * to be allocated by caller\n+ *\n+ * Returns an array of message pointers associated with the cleaned\n+ * descriptors. The pointers are to the original ctlq_msgs sent on the cleaned\n+ * descriptors. The status will be returned for each; any messages that failed\n+ * to send will have a non-zero status. The caller is expected to free original\n+ * ctlq_msgs and free or reuse the DMA buffers.\n+ */\n+int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n+\t\t struct idpf_ctlq_msg *msg_status[])\n+{\n+\treturn __idpf_ctlq_clean_sq(cq, clean_count, msg_status, false);\n+}\n+\n /**\n * idpf_ctlq_post_rx_buffs - post buffers to descriptor ring\n * @hw: pointer to hw struct\ndiff --git a/drivers/common/idpf/base/idpf_controlq_api.h b/drivers/common/idpf/base/idpf_controlq_api.h\nindex 80be282b42..a00faac05f 100644\n--- a/drivers/common/idpf/base/idpf_controlq_api.h\n+++ b/drivers/common/idpf/base/idpf_controlq_api.h\n@@ -191,6 +191,10 @@ int idpf_ctlq_send(struct idpf_hw *hw,\n int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,\n \t\t struct idpf_ctlq_msg *q_msg);\n \n+/* Reclaims all descriptors on HW write back */\n+int idpf_ctlq_clean_sq_force(struct idpf_ctlq_info *cq, u16 *clean_count,\n+\t\t\t struct idpf_ctlq_msg *msg_status[]);\n+\n /* Reclaims send descriptors on HW write back */\n int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,\n \t\t struct idpf_ctlq_msg *msg_status[]);\n", "prefixes": [ "v3", "14/15" ] }{ "id": 126547, "url": "