From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0077.outbound.protection.outlook.com [104.47.38.77]) by dpdk.org (Postfix) with ESMTP id 9D5BDFE5 for ; Fri, 31 Mar 2017 21:36:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GgjwZSDgQVYmFCSI5lDHD5+DDTmzNrfZV1vRYLDXIyY=; b=hDyGsYSJ+SSojA5B/w8l6iFk6EFWoXagoCP9D0uhi+QcW230I1G1rrgVBxgFoA2hqJiMTxMXc0A08SjtBqpL2SAnWplTVImzz9FImvnAx3m5oqgH2vJgpXuGPzN/7I+dybizx1xRHXVP8+1+JwMZMj0SEoPzxGeSzvUZx9fWCRc= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Fri, 31 Mar 2017 19:36:13 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Sat, 1 Apr 2017 01:04:37 +0530 Message-Id: <1490988905-12584-11-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1490988905-12584-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> <1490988905-12584-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MAXPR01CA0058.INDPRD01.PROD.OUTLOOK.COM (10.164.146.158) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: add3c83e-281f-4c85-ecd9-08d4786d3331 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:/eGHkOC65uDuZWx3P6jE3ldUcX2f+mKoRYDxeyebb98G0/BI1LEXum5owJHnuzAd0s9tTGbo0T3jkg78joAlV7N+xNgkoddIUdytM3d2hUpkU/McQXJblchU/oOXgj1Ni9yoN5Z4l253DKSYyjvrpSnqrCRFOfINyXnxn0YGeaGgIEdKN0zLklaoLR5GurQ86jYhmpTX3oUePdznoLGimHBJHJK3wByrpaRrQK6MZzjj24kRn2N810sz6vg8x1OWN0FBxV8ld9k3PvkBb7XGgZuNXB2jOX6DFJ4nor8c8yDoiIHFBMmdgB9euNG5i62N0mJrJRRe3hrg4FVFyFtogw==; 25:SxWdQyLejrckk4YYfwBePIMro7u3yniwriE1XQSo+Caa6ZDVCrkqcoujwfi5SxeP4AEK/GQ56j6yy9K9MPfJIrzgzGApF3iUlhceyjT/IeJSkATSDoq5uvwTQN3SkIEdo/tAwVyPbo+jKuVCA1rqLDRwEK42JaS4sm+Bawcj+0MCNmEZP4+59tGAVxkOQGzi8Hw8BEuQVvAG2cGpLUvigffAAJuAJWYtz7wEfDjixrdvHvH3RCKlO8N416ecDV+aj9qyLy7deiWUYb6z4GoKzwE4RjtnExsD7q/j8qxRPUMtRLnDgck5LDcfrp6sl3A95dBu0JsRN0nyVaVNMf4utr6chykFStFfTAR5RbHNxlZeSI9kwzyAzKCY2OcitpynkB0sL2UA+MMnp9klY586yfz31W+PmyfNadC29toNSfarf7yaqKgyx+3aQQhJMW7VZ9p7n8Td3n/iyfoSvNaQpg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:t68EOC5EOIu8RpcGkVLZUEX/Z0wxaxEdXhTq2gRQqUNlHgrU/O+1Y7P8GoYXfRtWAu03wQFBNvsFkhIZQbvtxStBFvFRGQm9Lx0i7yvDMwyE6Pq/uV+6zQ1O6dhtGzlsUgENo9m0jsSLdVgbSCep5vtdfpYfTQOefGZemdtHGTtFj18EP22upH9jbKZou/UirOdRDDFPOx0ZebaBo+cB+sSdm0NeZ7toaoDRmJfmum0=; 20:d0igBVG7eBG5uKook1JCtTuhsGfvjsp5uwr2vz0pOALIp9QbbZfr0+ULavViXV1uJ2x1OjWT8RnDPeH0nar1Wkf5zJyw4+R5UQvnSakTeMBib13iUfZ9v9GwV/ZPZLhSaWAtsYz0sPVIvQAvwR2hpZ7rdH9TOQAxU2hZV+nwCf9I6GHNjfSyoAGrVdgFteNI3Bn5wxNlB8lddW88f/d4+DL2f8OzUnfA2/DTjqWxfyupbOXJTcpn7GAfvdamVys4b/HamoaPU/SqB42Wp549o1K/Glvlw63EBjUuDGgiMoIizlb17OWdywqtwal//z1HaIu4cQYBbthI7WRUYc9x1f9aE9YYg3Hkl5HJxA/kCO9FUL7JJW9NXXiMj5tBEd4FoqkWgNd/QI/bV2bAPqL16zNgQOFKl5wcz07qgf6ptunrhBD6ucp/br/KyzxXcCBfkAc40+RDp1eIG8QRtLTOXASsL6nQw+kyDNUqOVC4RC8ZiAKf20Yt8ku4woabHOotcSYbd1v8/hcWLZ1xjJz9NJ8Y9oJLzViM1hkff+0DdimguJCgXzIFKB9wHVBeuqaIp90Vz6Aqln6pJwt8L4NTJswO8lNucvPracYvRvY6VdY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:N8+CWFxhtHHQDAqfc1B59x5haSGoHxpGPL+h+Np/l7ejl+Ni6WuOxV21mfzn6mE9/1qKfVsvc5PHFLn/qb6VK/qAfxRgpEID6MMExgEtJh+hIJJ7xNThOwS2MmEF9iiTknMFb0LRVCeQIDI++pDi9GGW13qo3P62DmxNVR+4u+eFkHtRfIYjhvct4xvGCECtVTcg99gZ1lgvenKyzSU+ikMlMHlBaMhS+yBUsFCe6RS16Wu+l7Y8W6jn7LP39mk5sFAGzINyYEdomVu1WNMaHEtd9T1kgUU72x3pTMbrKOpB4k8AEZnFDpy/wzbnshyWHjhF4Q1ZHFn2X3ap0vZ5nY6op7x2fOrsintfVYM3kchLi8nsTgYB/K03YnkxytJ6gCDtZhvA2yugYJGsSZf11jD0x6ZRLpqDXr+tDp3VpzApkt80HbgVrQV5J0C7GsQDtOPe0wENXJuqTlxIqSAJfGpc8hz58dgXAjorkVqeYYnbPJABX/BC4HIPX2xRTa3PiNX/rUzF0qRSpsk2z/DASmPazZLSm+pqiwLGCUXio0CGIxr91vCylk2kD/J9Kc6hvIZIAYo2FM9NVZ4nj/sAc2zBMVceaMFoGmC7Wrzr8qcJ+eTZo64unlSjHmhar6Fcen7mdd7bWS8BchOLPkFi0qPvt5SesQcXJhhlKy6phk4gv/XSWORdgIQ2cFzwjJRj3fUlZRcjxy0lr6Gqmls8O19vyjZG3a6cOyXug8VdUpbonKZQQQfNsraNO9nOLMdX X-Forefront-PRVS: 02638D901B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39840400002)(38730400002)(8676002)(107886003)(110136004)(50466002)(189998001)(305945005)(6506006)(36756003)(50226002)(25786009)(48376002)(6666003)(575784001)(8656002)(6486002)(7736002)(2950100002)(5660300001)(53936002)(81156014)(81166006)(3846002)(42882006)(6916009)(6116002)(6512007)(42186005)(33646002)(2361001)(2351001)(76176999)(50986999)(5003940100001)(47776003)(2906002)(5009440100003)(4326008)(66066001)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:Og32pWmfo79rXpBoScqg825fRN6hY4lAiIpGN9J?= =?us-ascii?Q?5xOqPLx6qCBcqRccWZzGw7fGs99cSeNN5KIs8X19n/1EJZs369EJB5foa53M?= =?us-ascii?Q?f2QWZtrInd2J5WNi5Pt2xue3OgZWcR+U84aNWdPuHTxhKAZLKeQRGggw6+w/?= =?us-ascii?Q?BpsiqoZlG5WiGLlskmz2o4cSU1FoFrKMMn7nJj0CV6yDWQl+rH3hvO2vUAYD?= =?us-ascii?Q?8T7VJp75Bpmqh1uGdJ568fwtwkIh8FbtPV/ucbDPquEtJSYHCblA/tapE3Kw?= =?us-ascii?Q?qkzSv/BV5DyJzoLGx98ULxJsEVC9NcOGu/KbJT0E+bCjl7sSX4erHyrCSh8D?= =?us-ascii?Q?Trh9W2Ysr1U2MtgcfdI1HsjrzmcYHTQ6TSdokzfwjsDUamLvy4u5g5RcHzxj?= =?us-ascii?Q?W4abz31C0q9/KU4fzLoZnS/4ksF2B6Hv7+n5IX0kPMOui7EAiLcMYUQnYJRG?= =?us-ascii?Q?oxwtdAZG7TJCBJW7XrvsG5lg+o5J7Cx7T42eemRnHLgUSS4KU8qh1xJ103x2?= =?us-ascii?Q?Zq0cRn5PGD/fstI8Uub390C9w8Cgibsvx6svWqLAKDNshM+Gww7lglKPeA4P?= =?us-ascii?Q?Cisre711h3EyAajK7BrTIPCb7CBeWEXzWhlK6TwN4/6mxxzBMyjdHcc0uYmc?= =?us-ascii?Q?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dcrljf6IOzAXp2NiRv8ae5TZLRA5q3+tcXW+4jlEb508d+y+iA5t0L/4kOzNQMjSJ3WVPYYA==; 5:Q7RAi+/TOKRt9J8Dnrgx1QOvGEYIumq7BtMXTmew+M2PZRFFc/6hmJ0x8YG3hgsMkNnlEgL/XpKkeu/V+NwNJqMkMr0q0bhvXLVzqyPi8HiOs76AAWX2mzNjDGacHug0ScNtfVh7jfaJL2RovAt+9kf5GdSe4k8E2dsz0judQ/E=; 24:Xo+C1XlhnJfPod8spoAQGlpTK/UzPwxrk3X9d4lrx+t9pO/vMrJ7ArB42CuGyjhlubvcHCSZ3jwkopi8lKyBqR+lgG60o+7qS8ab99w4o9E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:4KiltuHyy+xLLgIeFyyG8iP8HgbwRhNo/0jNR1kRB6ylQ7Vem7t3CHxtrj5b0kWTWmPY3ieoXe1dTQRwUU58ZmXoluf+okCK6saAZ4TEbIpyqNH8IeKJp9ImJTV98aTN7yD/u/7n9SzFOKuEiBF+NIDeSY3U1W8RlEgIQ7Sc7Fk9n3XYTYaFyBrWrwngd6aKj+leERAV5tJMputs3kkAE1XihUe80Y87g8WjQnp27PZMLt/jxENGlnN4ge2UBwiGLWGZWmn+OdXzBrA9IN+07gpIvHLCy3xiMGNgHvVcjN41lfV+MaF2qw16ciWREQUbHy56rMst2G6k4XGD2gKFJg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:36:13.7319 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 10/38] event/octeontx: add support for event ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 19:36:19 -0000 Add in the data-structures for the ports used by workers to sent events to/from the HW scheduler. Also add a function to release the resource allocated in setup Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla Acked-by: Gage Eads --- drivers/event/octeontx/ssovf_evdev.c | 74 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 11 ++++++ 2 files changed, 85 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index a6a2202..6781f00 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -189,6 +189,77 @@ ssovf_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, return ssovf_mbox_priority_set(queue_id, queue_conf->priority); } +static void +ssovf_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, + struct rte_event_port_conf *port_conf) +{ + struct ssovf_evdev *edev = ssovf_pmd_priv(dev); + + RTE_SET_USED(port_id); + port_conf->new_event_threshold = edev->max_num_events; + port_conf->dequeue_depth = 1; + port_conf->enqueue_depth = 1; +} + +static void +ssovf_port_release(void *port) +{ + rte_free(port); +} + +static int +ssovf_port_setup(struct rte_eventdev *dev, uint8_t port_id, + const struct rte_event_port_conf *port_conf) +{ + struct ssows *ws; + uint32_t reg_off; + uint8_t q; + struct ssovf_evdev *edev = ssovf_pmd_priv(dev); + + ssovf_func_trace("port=%d", port_id); + RTE_SET_USED(port_conf); + + /* Free memory prior to re-allocation if needed */ + if (dev->data->ports[port_id] != NULL) { + ssovf_port_release(dev->data->ports[port_id]); + dev->data->ports[port_id] = NULL; + } + + /* Allocate event port memory */ + ws = rte_zmalloc_socket("eventdev ssows", + sizeof(struct ssows), RTE_CACHE_LINE_SIZE, + dev->data->socket_id); + if (ws == NULL) { + ssovf_log_err("Failed to alloc memory for port=%d", port_id); + return -ENOMEM; + } + + ws->base = octeontx_ssovf_bar(OCTEONTX_SSO_HWS, port_id, 0); + if (ws->base == NULL) { + rte_free(ws); + ssovf_log_err("Failed to get hws base addr port=%d", port_id); + return -EINVAL; + } + + reg_off = SSOW_VHWS_OP_GET_WORK0; + reg_off |= 1 << 4; /* Index_ggrp_mask (Use maskset zero) */ + reg_off |= 1 << 16; /* Wait */ + ws->getwork = ws->base + reg_off; + ws->port = port_id; + + for (q = 0; q < edev->nb_event_queues; q++) { + ws->grps[q] = octeontx_ssovf_bar(OCTEONTX_SSO_GROUP, q, 2); + if (ws->grps[q] == NULL) { + rte_free(ws); + ssovf_log_err("Failed to get grp%d base addr", q); + return -EINVAL; + } + } + + dev->data->ports[port_id] = ws; + ssovf_log_dbg("port=%d ws=%p", port_id, ws); + return 0; +} /* Initialize and register event driver with DPDK Application */ static const struct rte_eventdev_ops ssovf_ops = { .dev_infos_get = ssovf_info_get, @@ -196,6 +267,9 @@ static const struct rte_eventdev_ops ssovf_ops = { .queue_def_conf = ssovf_queue_def_conf, .queue_setup = ssovf_queue_setup, .queue_release = ssovf_queue_release, + .port_def_conf = ssovf_port_def_conf, + .port_setup = ssovf_port_setup, + .port_release = ssovf_port_release, }; static int diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index d0f5d85..eda0e37 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -131,6 +131,17 @@ struct ssovf_evdev { int32_t max_num_events; } __rte_cache_aligned; +/* Event port aka HWS */ +struct ssows { + uint8_t cur_tt; + uint8_t cur_grp; + uint8_t swtag_req; + uint8_t *base; + uint8_t *getwork; + uint8_t *grps[SSO_MAX_VHGRP]; + uint8_t port; +} __rte_cache_aligned; + static inline struct ssovf_evdev * ssovf_pmd_priv(const struct rte_eventdev *eventdev) { -- 2.5.5