get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126018,
    "url": "http://patches.dpdk.org/api/patches/126018/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230413094502.1714755-17-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": "<20230413094502.1714755-17-wenjing.qiao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230413094502.1714755-17-wenjing.qiao@intel.com",
    "date": "2023-04-13T09:45:00",
    "name": "[16/18] common/idpf: add func to clean all DESCs on controlq",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "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/20230413094502.1714755-17-wenjing.qiao@intel.com/mbox/",
    "series": [
        {
            "id": 27692,
            "url": "http://patches.dpdk.org/api/series/27692/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27692",
            "date": "2023-04-13T09:44:44",
            "name": "update idpf shared code",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27692/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126018/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/126018/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 CE65942931;\n\tThu, 13 Apr 2023 11:52:08 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D555D42D8B;\n\tThu, 13 Apr 2023 11:50:45 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 4C98542D0E\n for <dev@dpdk.org>; Thu, 13 Apr 2023 11:50:44 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2023 02:50:43 -0700",
            "from dpdk-wenjing-01.sh.intel.com ([10.67.119.244])\n by FMSMGA003.fm.intel.com with ESMTP; 13 Apr 2023 02:50:41 -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=1681379444; x=1712915444;\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=Kjpy3zecOD7LK0z+IygGKhbx2KX0Jdzl6WkeRGYu0IzuEDTKRGI8OiGP\n k5OsIzuipHPsBM9PiREJcuxUw5qY4bhyXy1mY+C0HsoBgW4LOe+2X/RQx\n H7DvogsvY9QKSB8ABEhiB+vmoJ4tExSC3+bNf31ZYhog0dE1031mp75C0\n v8lPRZMJJRNR8us0odNT51mUDOqYsst07/NTJAeLIPuaLYcCHuYVRIdVF\n u/6A/yinALIALU8Xi9wW2Sl2HTO34ggUC+u1eSEm8zbbanro0mAVSrlHm\n DrR3DdsE+4WqKOBOhnVL/Dy5w1D9LgB+jBeboFEyhb9NftKkHlv2CCmfT g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10678\"; a=\"409290580\"",
            "E=Sophos;i=\"5.98,341,1673942400\"; d=\"scan'208\";a=\"409290580\"",
            "E=McAfee;i=\"6600,9927,10678\"; a=\"778699385\"",
            "E=Sophos;i=\"5.98,341,1673942400\"; d=\"scan'208\";a=\"778699385\""
        ],
        "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, Wenjing Qiao <wenjing.qiao@intel.com>,\n NorbertX Ciosek <norbertx.ciosek@intel.com>",
        "Subject": "[PATCH 16/18] common/idpf: add func to clean all DESCs on controlq",
        "Date": "Thu, 13 Apr 2023 05:45:00 -0400",
        "Message-Id": "<20230413094502.1714755-17-wenjing.qiao@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230413094502.1714755-1-wenjing.qiao@intel.com>",
        "References": "<20230413094502.1714755-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": [
        "16/18"
    ]
}