Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/77495/?format=api
http://patches.dpdk.org/api/patches/77495/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599851920-16802-14-git-send-email-timothy.mcdaniel@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": "<1599851920-16802-14-git-send-email-timothy.mcdaniel@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1599851920-16802-14-git-send-email-timothy.mcdaniel@intel.com", "date": "2020-09-11T19:18:31", "name": "[v4,13/22] event/dlb: add port unlink and port unlinks in progress", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "bcd453ebf0d83d7e3e5497b1b720513b904b60d6", "submitter": { "id": 826, "url": "http://patches.dpdk.org/api/people/826/?format=api", "name": "Timothy McDaniel", "email": "timothy.mcdaniel@intel.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/1599851920-16802-14-git-send-email-timothy.mcdaniel@intel.com/mbox/", "series": [ { "id": 12163, "url": "http://patches.dpdk.org/api/series/12163/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12163", "date": "2020-09-11T19:18:18", "name": "Add DLB PMD", "version": 4, "mbox": "http://patches.dpdk.org/series/12163/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/77495/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/77495/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 7E9DBA04C1;\n\tFri, 11 Sep 2020 21:24:08 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E05341C1EE;\n\tFri, 11 Sep 2020 21:22:24 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id C38731C1AC\n for <dev@dpdk.org>; Fri, 11 Sep 2020 21:22:12 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Sep 2020 12:22:11 -0700", "from txasoft-yocto.an.intel.com ([10.123.72.192])\n by fmsmga005.fm.intel.com with ESMTP; 11 Sep 2020 12:22:11 -0700" ], "IronPort-SDR": [ "\n PZ8SvBC6MHGePxcf0U+lPYVVJR7lvAcXP65cqyIxrSkcDmBzUMTryDkosZxn40LOgT98fPYUDh\n kjTRUnBr7gvQ==", "\n bpSotbZh19RsJtEtSGiHWDyjkojLmvg6q6xpXQgXH516pp5pIixwHlfd03Mt2/ve7eabhltIqz\n dyD1vS2d4Csw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9741\"; a=\"138352276\"", "E=Sophos;i=\"5.76,416,1592895600\"; d=\"scan'208\";a=\"138352276\"", "E=Sophos;i=\"5.76,416,1592895600\"; d=\"scan'208\";a=\"506375684\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Timothy McDaniel <timothy.mcdaniel@intel.com>", "To": "", "Cc": "dev@dpdk.org, erik.g.carrillo@intel.com, gage.eads@intel.com,\n harry.van.haaren@intel.com, jerinj@marvell.com", "Date": "Fri, 11 Sep 2020 14:18:31 -0500", "Message-Id": "<1599851920-16802-14-git-send-email-timothy.mcdaniel@intel.com>", "X-Mailer": "git-send-email 1.7.10", "In-Reply-To": "<1599851920-16802-1-git-send-email-timothy.mcdaniel@intel.com>", "References": "<1599851920-16802-1-git-send-email-timothy.mcdaniel@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 13/22] event/dlb: add port unlink and port\n\tunlinks in progress", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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": "Add supports for the port unlink(s) eventdev entry points.\nThe unlink operation is an asynchronous operation executed by\na control thread, and the unlinks-in-progress function reads\na counter shared with the control thread.\n\nSigned-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>\n---\n drivers/event/dlb/dlb.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 166 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c\nindex c3ad2ee..4f56869 100644\n--- a/drivers/event/dlb/dlb.c\n+++ b/drivers/event/dlb/dlb.c\n@@ -566,7 +566,6 @@ dlb_eventdev_info_get(struct rte_eventdev *dev,\n \tevdev_dlb_default_info.max_event_queues += dlb->num_ldb_queues;\n \tevdev_dlb_default_info.max_num_events += dlb->num_ldb_credits;\n \n-\n \t/* In DLB A-stepping hardware, applications are limited to 128\n \t * configured ports (load-balanced or directed). The reported number of\n \t * available ports must reflect this.\n@@ -704,6 +703,169 @@ dlb_eventdev_configure(const struct rte_eventdev *dev)\n \treturn 0;\n }\n \n+static int16_t\n+dlb_hw_unmap_ldb_qid_from_port(struct dlb_hw_dev *handle,\n+\t\t\t uint32_t qm_port_id,\n+\t\t\t uint16_t qm_qid)\n+{\n+\tstruct dlb_unmap_qid_args cfg;\n+\tstruct dlb_cmd_response response;\n+\tint32_t ret;\n+\n+\tif (handle == NULL)\n+\t\treturn -EINVAL;\n+\n+\tcfg.response = (uintptr_t)&response;\n+\tcfg.port_id = qm_port_id;\n+\tcfg.qid = qm_qid;\n+\n+\tret = dlb_iface_unmap_qid(handle, &cfg);\n+\tif (ret < 0)\n+\t\tDLB_LOG_ERR(\"dlb: unmap qid error, ret=%d (driver status: %s)\\n\",\n+\t\t\t ret, dlb_error_strings[response.status]);\n+\n+\treturn ret;\n+}\n+\n+static int\n+dlb_event_queue_detach_ldb(struct dlb_eventdev *dlb,\n+\t\t\t struct dlb_eventdev_port *ev_port,\n+\t\t\t struct dlb_eventdev_queue *ev_queue)\n+{\n+\tint ret, i;\n+\n+\t/* Don't unlink until start time. */\n+\tif (dlb->run_state == DLB_RUN_STATE_STOPPED)\n+\t\treturn 0;\n+\n+\tfor (i = 0; i < DLB_MAX_NUM_QIDS_PER_LDB_CQ; i++) {\n+\t\tif (ev_port->link[i].valid &&\n+\t\t ev_port->link[i].queue_id == ev_queue->id)\n+\t\t\tbreak; /* found */\n+\t}\n+\n+\t/* This is expected with eventdev API!\n+\t * It blindly attempts to unmap all queues.\n+\t */\n+\tif (i == DLB_MAX_NUM_QIDS_PER_LDB_CQ) {\n+\t\tDLB_LOG_DBG(\"dlb: ignoring LB QID %d not mapped for qm_port %d.\\n\",\n+\t\t\t ev_queue->qm_queue.id,\n+\t\t\t ev_port->qm_port.id);\n+\t\treturn 0;\n+\t}\n+\n+\tret = dlb_hw_unmap_ldb_qid_from_port(&dlb->qm_instance,\n+\t\t\t\t\t ev_port->qm_port.id,\n+\t\t\t\t\t ev_queue->qm_queue.id);\n+\tif (!ret)\n+\t\tev_port->link[i].mapped = false;\n+\n+\treturn ret;\n+}\n+\n+static int\n+dlb_eventdev_port_unlink(struct rte_eventdev *dev, void *event_port,\n+\t\t\t uint8_t queues[], uint16_t nb_unlinks)\n+{\n+\tstruct dlb_eventdev_port *ev_port = event_port;\n+\tstruct dlb_eventdev *dlb;\n+\tint i;\n+\n+\tRTE_SET_USED(dev);\n+\n+\tif (!ev_port->setup_done) {\n+\t\tDLB_LOG_ERR(\"dlb: evport %d is not configured\\n\",\n+\t\t\t ev_port->id);\n+\t\trte_errno = -EINVAL;\n+\t\treturn 0;\n+\t}\n+\n+\tif (!queues || nb_unlinks == 0) {\n+\t\tDLB_LOG_DBG(\"dlb: queues is NULL or nb_unlinks is 0\\n\");\n+\t\treturn 0; /* Ignore and return success */\n+\t}\n+\n+\tif (ev_port->qm_port.is_directed) {\n+\t\tDLB_LOG_DBG(\"dlb: ignore unlink from dir port %d\\n\",\n+\t\t\t ev_port->id);\n+\t\trte_errno = 0;\n+\t\treturn nb_unlinks; /* as if success */\n+\t}\n+\n+\tdlb = ev_port->dlb;\n+\n+\tfor (i = 0; i < nb_unlinks; i++) {\n+\t\tstruct dlb_eventdev_queue *ev_queue;\n+\t\tint ret, j;\n+\n+\t\tif (queues[i] >= dlb->num_queues) {\n+\t\t\tDLB_LOG_ERR(\"dlb: invalid queue id %d\\n\", queues[i]);\n+\t\t\trte_errno = -EINVAL;\n+\t\t\treturn i; /* return index of offending queue */\n+\t\t}\n+\n+\t\tev_queue = &dlb->ev_queues[queues[i]];\n+\n+\t\t/* Does a link exist? */\n+\t\tfor (j = 0; j < DLB_MAX_NUM_QIDS_PER_LDB_CQ; j++)\n+\t\t\tif (ev_port->link[j].queue_id == queues[i] &&\n+\t\t\t ev_port->link[j].valid)\n+\t\t\t\tbreak;\n+\n+\t\tif (j == DLB_MAX_NUM_QIDS_PER_LDB_CQ)\n+\t\t\tcontinue;\n+\n+\t\tret = dlb_event_queue_detach_ldb(dlb, ev_port, ev_queue);\n+\t\tif (ret) {\n+\t\t\tDLB_LOG_ERR(\"unlink err=%d for port %d queue %d\\n\",\n+\t\t\t\t ret, ev_port->id, queues[i]);\n+\t\t\trte_errno = -ENOENT;\n+\t\t\treturn i; /* return index of offending queue */\n+\t\t}\n+\n+\t\tev_port->link[j].valid = false;\n+\t\tev_port->num_links--;\n+\t\tev_queue->num_links--;\n+\t}\n+\n+\treturn nb_unlinks;\n+}\n+\n+static int\n+dlb_eventdev_port_unlinks_in_progress(struct rte_eventdev *dev,\n+\t\t\t\t void *event_port)\n+{\n+\tstruct dlb_eventdev_port *ev_port = event_port;\n+\tstruct dlb_eventdev *dlb;\n+\tstruct dlb_hw_dev *handle;\n+\tstruct dlb_pending_port_unmaps_args cfg;\n+\tstruct dlb_cmd_response response;\n+\tint ret;\n+\n+\tRTE_SET_USED(dev);\n+\n+\tif (!ev_port->setup_done) {\n+\t\tDLB_LOG_ERR(\"dlb: evport %d is not configured\\n\",\n+\t\t\t ev_port->id);\n+\t\trte_errno = -EINVAL;\n+\t\treturn 0;\n+\t}\n+\n+\tcfg.port_id = ev_port->qm_port.id;\n+\tcfg.response = (uintptr_t)&response;\n+\tdlb = ev_port->dlb;\n+\thandle = &dlb->qm_instance;\n+\tret = dlb_iface_pending_port_unmaps(handle, &cfg);\n+\n+\tif (ret < 0) {\n+\t\tDLB_LOG_ERR(\"dlb: num_unlinks_in_progress ret=%d (driver status: %s)\\n\",\n+\t\t\t ret, dlb_error_strings[response.status]);\n+\t\treturn ret;\n+\t}\n+\n+\treturn response.id;\n+}\n+\n static void\n dlb_eventdev_port_default_conf_get(struct rte_eventdev *dev,\n \t\t\t\t uint8_t port_id,\n@@ -1879,6 +2041,9 @@ dlb_entry_points_init(struct rte_eventdev *dev)\n \t\t.queue_setup = dlb_eventdev_queue_setup,\n \t\t.port_setup = dlb_eventdev_port_setup,\n \t\t.port_link = dlb_eventdev_port_link,\n+\t\t.port_unlink = dlb_eventdev_port_unlink,\n+\t\t.port_unlinks_in_progress =\n+\t\t\t\t dlb_eventdev_port_unlinks_in_progress,\n \t\t.dump = dlb_eventdev_dump,\n \t\t.xstats_get = dlb_eventdev_xstats_get,\n \t\t.xstats_get_names = dlb_eventdev_xstats_get_names,\n", "prefixes": [ "v4", "13/22" ] }{ "id": 77495, "url": "