get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91497,
    "url": "https://patches.dpdk.org/api/patches/91497/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1618451359-20693-15-git-send-email-timothy.mcdaniel@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1618451359-20693-15-git-send-email-timothy.mcdaniel@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618451359-20693-15-git-send-email-timothy.mcdaniel@intel.com",
    "date": "2021-04-15T01:49:06",
    "name": "[v4,14/27] event/dlb2: add v2.5 start domain",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "85753bef8c144a53f4568dc6649dbb3e526dcaef",
    "submitter": {
        "id": 826,
        "url": "https://patches.dpdk.org/api/people/826/?format=api",
        "name": "Timothy McDaniel",
        "email": "timothy.mcdaniel@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1618451359-20693-15-git-send-email-timothy.mcdaniel@intel.com/mbox/",
    "series": [
        {
            "id": 16383,
            "url": "https://patches.dpdk.org/api/series/16383/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16383",
            "date": "2021-04-15T01:48:52",
            "name": "Add DLB v2.5",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/16383/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91497/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/91497/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 F0094A0562;\n\tThu, 15 Apr 2021 03:52:21 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D2032161E77;\n\tThu, 15 Apr 2021 03:50:52 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 834EB161E21\n for <dev@dpdk.org>; Thu, 15 Apr 2021 03:50:39 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Apr 2021 18:50:39 -0700",
            "from txasoft-yocto.an.intel.com ([10.123.72.192])\n by orsmga003.jf.intel.com with ESMTP; 14 Apr 2021 18:50:38 -0700"
        ],
        "IronPort-SDR": [
            "\n eWzM5EfRRRb9/497/QxgH+ijzVUPaFvOEAy4AQUQSKQHo/m0y5SXtBzMuItOvc3DDl6H+x4uJL\n fNgAwfQhGaZA==",
            "\n afOJYY3yy8rwQhe0u+9HF6V64EjF3Tzax7T9K6X1nhYctmmNaMSOa3GtKWRfR6NW222wwIjWTR\n jvtlNP4dfWWw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9954\"; a=\"215272810\"",
            "E=Sophos;i=\"5.82,223,1613462400\"; d=\"scan'208\";a=\"215272810\"",
            "E=Sophos;i=\"5.82,223,1613462400\"; d=\"scan'208\";a=\"382569866\""
        ],
        "X-ExtLoop1": "1",
        "From": "Timothy McDaniel <timothy.mcdaniel@intel.com>",
        "To": "",
        "Cc": "dev@dpdk.org, erik.g.carrillo@intel.com, harry.van.haaren@intel.com,\n jerinj@marvell.com, thomas@monjalon.net",
        "Date": "Wed, 14 Apr 2021 20:49:06 -0500",
        "Message-Id": "<1618451359-20693-15-git-send-email-timothy.mcdaniel@intel.com>",
        "X-Mailer": "git-send-email 1.7.10",
        "In-Reply-To": "<1618451359-20693-1-git-send-email-timothy.mcdaniel@intel.com>",
        "References": "<20210316221857.2254-2-timothy.mcdaniel@intel.com>\n <1618451359-20693-1-git-send-email-timothy.mcdaniel@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 14/27] event/dlb2: add v2.5 start domain",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Update the low level HW functions responsible for\nstarting the scheduling domain. Once a domain is\nstarted, its resources can no longer be configured,\nexcept for QID remapping and port enable/disable.\nThe start domain arguments are validated, and an error\nis returned if validation fails, or if the domain is\nnot configured or has already been started.\n\nThe logic is very similar to what was done for v2.0,\nbut the new combined register map for v2.0 and v2.5\nuses new register names and bit names.  Additionally,\nnew register access macros are used so that the code\ncan perform the correct action, based on the hardware.\n\nSigned-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>\n---\n drivers/event/dlb2/pf/base/dlb2_resource.c    | 123 -----------------\n .../event/dlb2/pf/base/dlb2_resource_new.c    | 130 ++++++++++++++++++\n 2 files changed, 130 insertions(+), 123 deletions(-)",
    "diff": "diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.c b/drivers/event/dlb2/pf/base/dlb2_resource.c\nindex ab5b080c1..1e66ebf50 100644\n--- a/drivers/event/dlb2/pf/base/dlb2_resource.c\n+++ b/drivers/event/dlb2/pf/base/dlb2_resource.c\n@@ -1245,129 +1245,6 @@ dlb2_get_domain_ldb_queue(u32 id,\n \treturn NULL;\n }\n \n-static int dlb2_verify_start_domain_args(struct dlb2_hw *hw,\n-\t\t\t\t\t u32 domain_id,\n-\t\t\t\t\t struct dlb2_cmd_response *resp,\n-\t\t\t\t\t bool vdev_req,\n-\t\t\t\t\t unsigned int vdev_id)\n-{\n-\tstruct dlb2_hw_domain *domain;\n-\n-\tdomain = dlb2_get_domain_from_id(hw, domain_id, vdev_req, vdev_id);\n-\n-\tif (domain == NULL) {\n-\t\tresp->status = DLB2_ST_INVALID_DOMAIN_ID;\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tif (!domain->configured) {\n-\t\tresp->status = DLB2_ST_DOMAIN_NOT_CONFIGURED;\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tif (domain->started) {\n-\t\tresp->status = DLB2_ST_DOMAIN_STARTED;\n-\t\treturn -EINVAL;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static void dlb2_log_start_domain(struct dlb2_hw *hw,\n-\t\t\t\t  u32 domain_id,\n-\t\t\t\t  bool vdev_req,\n-\t\t\t\t  unsigned int vdev_id)\n-{\n-\tDLB2_HW_DBG(hw, \"DLB2 start domain arguments:\\n\");\n-\tif (vdev_req)\n-\t\tDLB2_HW_DBG(hw, \"(Request from vdev %d)\\n\", vdev_id);\n-\tDLB2_HW_DBG(hw, \"\\tDomain ID: %d\\n\", domain_id);\n-}\n-\n-/**\n- * dlb2_hw_start_domain() - Lock the domain configuration\n- * @hw:\tContains the current state of the DLB2 hardware.\n- * @domain_id: Domain ID\n- * @arg: User-provided arguments (unused, here for ioctl callback template).\n- * @resp: Response to user.\n- * @vdev_req: Request came from a virtual device.\n- * @vdev_id: If vdev_req is true, this contains the virtual device's ID.\n- *\n- * Return: returns < 0 on error, 0 otherwise. If the driver is unable to\n- * satisfy a request, resp->status will be set accordingly.\n- */\n-int\n-dlb2_hw_start_domain(struct dlb2_hw *hw,\n-\t\t     u32 domain_id,\n-\t\t     struct dlb2_start_domain_args *arg,\n-\t\t     struct dlb2_cmd_response *resp,\n-\t\t     bool vdev_req,\n-\t\t     unsigned int vdev_id)\n-{\n-\tstruct dlb2_list_entry *iter;\n-\tstruct dlb2_dir_pq_pair *dir_queue;\n-\tstruct dlb2_ldb_queue *ldb_queue;\n-\tstruct dlb2_hw_domain *domain;\n-\tint ret;\n-\tRTE_SET_USED(arg);\n-\tRTE_SET_USED(iter);\n-\n-\tdlb2_log_start_domain(hw, domain_id, vdev_req, vdev_id);\n-\n-\tret = dlb2_verify_start_domain_args(hw,\n-\t\t\t\t\t    domain_id,\n-\t\t\t\t\t    resp,\n-\t\t\t\t\t    vdev_req,\n-\t\t\t\t\t    vdev_id);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tdomain = dlb2_get_domain_from_id(hw, domain_id, vdev_req, vdev_id);\n-\tif (domain == NULL) {\n-\t\tDLB2_HW_ERR(hw,\n-\t\t\t    \"[%s():%d] Internal error: domain not found\\n\",\n-\t\t\t    __func__, __LINE__);\n-\t\treturn -EFAULT;\n-\t}\n-\n-\t/*\n-\t * Enable load-balanced and directed queue write permissions for the\n-\t * queues this domain owns. Without this, the DLB2 will drop all\n-\t * incoming traffic to those queues.\n-\t */\n-\tDLB2_DOM_LIST_FOR(domain->used_ldb_queues, ldb_queue, iter) {\n-\t\tunion dlb2_sys_ldb_vasqid_v r0 = { {0} };\n-\t\tunsigned int offs;\n-\n-\t\tr0.field.vasqid_v = 1;\n-\n-\t\toffs = domain->id.phys_id * DLB2_MAX_NUM_LDB_QUEUES +\n-\t\t\tldb_queue->id.phys_id;\n-\n-\t\tDLB2_CSR_WR(hw, DLB2_SYS_LDB_VASQID_V(offs), r0.val);\n-\t}\n-\n-\tDLB2_DOM_LIST_FOR(domain->used_dir_pq_pairs, dir_queue, iter) {\n-\t\tunion dlb2_sys_dir_vasqid_v r0 = { {0} };\n-\t\tunsigned int offs;\n-\n-\t\tr0.field.vasqid_v = 1;\n-\n-\t\toffs = domain->id.phys_id * DLB2_MAX_NUM_DIR_PORTS(hw->ver) +\n-\t\t\tdir_queue->id.phys_id;\n-\n-\t\tDLB2_CSR_WR(hw, DLB2_SYS_DIR_VASQID_V(offs), r0.val);\n-\t}\n-\n-\tdlb2_flush_csr(hw);\n-\n-\tdomain->started = true;\n-\n-\tresp->status = 0;\n-\n-\treturn 0;\n-}\n-\n static void dlb2_log_get_dir_queue_depth(struct dlb2_hw *hw,\n \t\t\t\t\t u32 domain_id,\n \t\t\t\t\t u32 queue_id,\ndiff --git a/drivers/event/dlb2/pf/base/dlb2_resource_new.c b/drivers/event/dlb2/pf/base/dlb2_resource_new.c\nindex 181922fe3..e806a60ac 100644\n--- a/drivers/event/dlb2/pf/base/dlb2_resource_new.c\n+++ b/drivers/event/dlb2/pf/base/dlb2_resource_new.c\n@@ -5774,3 +5774,133 @@ int dlb2_hw_pending_port_unmaps(struct dlb2_hw *hw,\n \n \treturn 0;\n }\n+\n+static int dlb2_verify_start_domain_args(struct dlb2_hw *hw,\n+\t\t\t\t\t u32 domain_id,\n+\t\t\t\t\t struct dlb2_cmd_response *resp,\n+\t\t\t\t\t bool vdev_req,\n+\t\t\t\t\t unsigned int vdev_id,\n+\t\t\t\t\t struct dlb2_hw_domain **out_domain)\n+{\n+\tstruct dlb2_hw_domain *domain;\n+\n+\tdomain = dlb2_get_domain_from_id(hw, domain_id, vdev_req, vdev_id);\n+\n+\tif (!domain) {\n+\t\tresp->status = DLB2_ST_INVALID_DOMAIN_ID;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (!domain->configured) {\n+\t\tresp->status = DLB2_ST_DOMAIN_NOT_CONFIGURED;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (domain->started) {\n+\t\tresp->status = DLB2_ST_DOMAIN_STARTED;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t*out_domain = domain;\n+\n+\treturn 0;\n+}\n+\n+static void dlb2_log_start_domain(struct dlb2_hw *hw,\n+\t\t\t\t  u32 domain_id,\n+\t\t\t\t  bool vdev_req,\n+\t\t\t\t  unsigned int vdev_id)\n+{\n+\tDLB2_HW_DBG(hw, \"DLB2 start domain arguments:\\n\");\n+\tif (vdev_req)\n+\t\tDLB2_HW_DBG(hw, \"(Request from vdev %d)\\n\", vdev_id);\n+\tDLB2_HW_DBG(hw, \"\\tDomain ID: %d\\n\", domain_id);\n+}\n+\n+/**\n+ * dlb2_hw_start_domain() - start a scheduling domain\n+ * @hw: dlb2_hw handle for a particular device.\n+ * @domain_id: domain ID.\n+ * @arg: start domain arguments.\n+ * @resp: response structure.\n+ * @vdev_req: indicates whether this request came from a vdev.\n+ * @vdev_id: If vdev_req is true, this contains the vdev's ID.\n+ *\n+ * This function starts a scheduling domain, which allows applications to send\n+ * traffic through it. Once a domain is started, its resources can no longer be\n+ * configured (besides QID remapping and port enable/disable).\n+ *\n+ * A vdev can be either an SR-IOV virtual function or a Scalable IOV virtual\n+ * device.\n+ *\n+ * Return:\n+ * Returns 0 upon success, < 0 otherwise. If an error occurs, resp->status is\n+ * assigned a detailed error code from enum dlb2_error.\n+ *\n+ * Errors:\n+ * EINVAL - the domain is not configured, or the domain is already started.\n+ */\n+int\n+dlb2_hw_start_domain(struct dlb2_hw *hw,\n+\t\t     u32 domain_id,\n+\t\t     struct dlb2_start_domain_args *args,\n+\t\t     struct dlb2_cmd_response *resp,\n+\t\t     bool vdev_req,\n+\t\t     unsigned int vdev_id)\n+{\n+\tstruct dlb2_list_entry *iter;\n+\tstruct dlb2_dir_pq_pair *dir_queue;\n+\tstruct dlb2_ldb_queue *ldb_queue;\n+\tstruct dlb2_hw_domain *domain;\n+\tint ret;\n+\tRTE_SET_USED(args);\n+\tRTE_SET_USED(iter);\n+\n+\tdlb2_log_start_domain(hw, domain_id, vdev_req, vdev_id);\n+\n+\tret = dlb2_verify_start_domain_args(hw,\n+\t\t\t\t\t    domain_id,\n+\t\t\t\t\t    resp,\n+\t\t\t\t\t    vdev_req,\n+\t\t\t\t\t    vdev_id,\n+\t\t\t\t\t    &domain);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\t/*\n+\t * Enable load-balanced and directed queue write permissions for the\n+\t * queues this domain owns. Without this, the DLB2 will drop all\n+\t * incoming traffic to those queues.\n+\t */\n+\tDLB2_DOM_LIST_FOR(domain->used_ldb_queues, ldb_queue, iter) {\n+\t\tu32 vasqid_v = 0;\n+\t\tunsigned int offs;\n+\n+\t\tDLB2_BIT_SET(vasqid_v, DLB2_SYS_LDB_VASQID_V_VASQID_V);\n+\n+\t\toffs = domain->id.phys_id * DLB2_MAX_NUM_LDB_QUEUES +\n+\t\t\tldb_queue->id.phys_id;\n+\n+\t\tDLB2_CSR_WR(hw, DLB2_SYS_LDB_VASQID_V(offs), vasqid_v);\n+\t}\n+\n+\tDLB2_DOM_LIST_FOR(domain->used_dir_pq_pairs, dir_queue, iter) {\n+\t\tu32 vasqid_v = 0;\n+\t\tunsigned int offs;\n+\n+\t\tDLB2_BIT_SET(vasqid_v, DLB2_SYS_DIR_VASQID_V_VASQID_V);\n+\n+\t\toffs = domain->id.phys_id * DLB2_MAX_NUM_DIR_PORTS(hw->ver) +\n+\t\t\tdir_queue->id.phys_id;\n+\n+\t\tDLB2_CSR_WR(hw, DLB2_SYS_DIR_VASQID_V(offs), vasqid_v);\n+\t}\n+\n+\tdlb2_flush_csr(hw);\n+\n+\tdomain->started = true;\n+\n+\tresp->status = 0;\n+\n+\treturn 0;\n+}\n",
    "prefixes": [
        "v4",
        "14/27"
    ]
}