From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0088.outbound.protection.outlook.com [104.47.32.88]) by dpdk.org (Postfix) with ESMTP id A8F91FA77 for ; Fri, 3 Mar 2017 18:29:49 +0100 (CET) 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=QjuAVeoMzTPbc3h5vZikcsqAixLCnNs87+Qw/zBJTn4=; b=IMGXMWbXLhLZHVsVf3yRmnHPfryA32we9Jcp7u4TgDFPlbizO5J4YvEg/YUVvVtHoIxrLZ5UUVitBjyhJmu+D+uINe0win5akTZ/r24zCPdQx+ARiT2r5OCKlcl9u5whTT57SMdY4FaBBY6JwnNV7Fco3nJZyS/AXfqDD+5/Ijo= 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.localdomain (14.140.2.178) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 17:29:44 +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: Fri, 3 Mar 2017 22:57:55 +0530 Message-Id: <1488562101-6658-14-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488562101-6658-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: BMXPR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.174.214.159) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 645512b7-dcad-4488-c858-08d4625ae446 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:rUOPEC8qUhnET/LMRxfg5PR/eJiTTXLfclEYiv9cjcZ9peTD1IZt1PVqtIv8aiLMPU5xfFtsdRtqgZaqnMvjz1+vexsGgjtHCfgyAKcZ57WGA5Z/vaK5SA/J8QCx4IpLH1HePWtZpZ+ol8rpUHzUMx7HVy/Aqyvgqb9gSNJHz5mcQo/htSIEA5jH6B21cnBW5GHM939a9nGDipyKY9+87Obl947QqxqUi/TchSsbWOoPA1PiwITJq5J+PDgWo7o3m6Tqi5oA/R0naq1FQ7wvEw==; 25:GpeHLCrU0N/Sc9l5K4HJdONGUgXgM8IVWkaAhE6hzzPeKPz1xRFtOjQQYD+0aIGFtt+NfMGu+v44rXAPCr2hJUUykvBj+M2g08tdNGuW3JB7sG7reivgaXxwWptLWeXARm08Z/yMh3z66VijfxzRsmPBwa41sN/HcF6PMZW1W3CTMBq1s+ApVr3j3s/Xc2DTFGGbMs0VoFT614m29oMcSDrUy29DUNg0rHtCcSFQEQJ4kOTZubGH1s7q8d6HOUJMTUCAq6dchcORXmgtIQq+9B4eb7B+r9CwE3cn0Yqr+IN2kpwS39S4jWhUYRr1DH1g8fL8nRIPJPSYVCdF0MSqhroI43eXeulTtaARfzFvfIpy4TtgkIPPn4iAfgX7I8lveAKfxGWBusc9yhPcRFcjl2zFb0/XHqOaXgwtSVCRwAnMQJQYt3vcFMRkBBdRwqpyZyseXsVUJLYq5/b0o5eooA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:94bGgjfkso3n+sft7Gndw4qp8A23vTV8n9rOtvFmOVKW3BKnuGHlZmF5QEqoip3Kk9xazU8g4YHh4RDQm7rTTtP0pcy+a39NcwwGfgD7ul7X1eZrG1B9LeQs8aKEa2cC9ZAAJJGrzWTkcZdeBDpZqmnEepItqcZMQUjvA9aZg+grJUMMlhiv/WuL1GYe0Kj/k7L0mmR8O0m89z3fJ3b8H/uhMwG2yGcOphQWhJUkgOhNWHkDEAk2ZK2MeN+YkNScCjTMn/9kN9Bn1eHWxJlUug==; 20:KKc/Pmo/nbJvL9NQDKGwc00enOEZgHmV+9Ytx96kUxNF/SNSI4b4k3PMBUr9C++AMCfU5dAXoomNq4H4zA9EmikU3AWOUwm9JRnBv4bTUtU3TmgZMWwycJvbEPfe+tdrh0qcxQWz7IzRVhuwtB/ecYYrUDLyC+YIH9oswicqbvR6A3X1UJ9A8nn7nKCkHvbskIw5H+tgnbyrfKlVccf15W6b/6tqzmwSVV7RtJXB9FJbu6o826rjxMDNTWQYywNRBHu6IQVBrEWj0O6DSO22yd6hnf47eu/zWp4QsBBXHb77z04sP/bwBAsoL9oHZvbe6F4T1DVjgvCpxVG1s2aWU8RStjUTkRgMfmzop2FRr7uqKcj5ZeOXmjjRJwfY9F5Gx/MH62hIvgKjNjVib8Yx6M/DCus7FHllvIpIyEWdF5KG5/mGwmXmv5TzIU5JhALcrE/FMPUb6++FxQ7U7NqZKOzvI5Zykbjll562J6BZoTrlz3AxUNogaHknMj4gzhPRbl4Eklbb6CR7EKf+3Zv3L7rxdhy2iQPXDBrBMWFKlgwvWBVNAg/ELmfG5Qz8VWodAfcFLCTuku/+ynMdNIaSlk4TMn76ET65QKnsx5zBZYM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:S+9xTk+P4Mi/tS6BRKRob4Pd8OmwjmuPyhUTlt5utmWmLphns92AoAZvtd8gXMCSwun+hDsYsp3qRxKa8WUvyyTIq19Bw/28eRiegKH52xNStEeKt5M3y7aj5Z0tJqFT5sK57NXPSgj3iII5qM2K+zbdpKaWYfcXb87v8/YN2lp7HP2lkWSs35SzVG+uBLibCit9irLBJizd46Rzyu8uR83gvtbUCtFoDPOQJ608naju0yEE3V6pWYiZXB/LYsMDFqKkTPg4sX/EuRM/YZr6xmRIcS7MIDLKxgl+nc6XQ8xDCpXd8VzhjwRx6/LckVVNO/85q3iv5V9PT67oJaKAoaF4G82YmG4L95hvdKSOoXfSx00U80Zj0Mb+jKWjkFGo3vbZEzQC9Kvyz9mZcpZTtKEEyAPgHbxe4dzmvfOhpJuer2YqfKqyAcuuGN59lbR/fNaFb0GhimzzB8NgkFgGjOu8RVUsvYbSOC4GFh1ElaH1pdQ/TKvrZf4iHEjXg40U8A2Ur6vDIgxXGj/shZuQjOyyV2bgoY8QQAAkZv9jHelogI+Eurer+8QboGTWlgIcP2r7Kt+kyP991gmLJU9aQZFkhYb1L/0CieJ4aCxPjCo= X-Forefront-PRVS: 0235CBE7D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(3846002)(50986999)(6116002)(36756003)(81166006)(6512007)(97736004)(2361001)(2351001)(6506006)(575784001)(5660300001)(42186005)(50226002)(8676002)(6666003)(106356001)(8656002)(2950100002)(2906002)(25786008)(47776003)(6486002)(76176999)(33646002)(7736002)(107886003)(42882006)(66066001)(110136004)(4326008)(38730400002)(6916009)(305945005)(48376002)(92566002)(5009440100003)(5003940100001)(50466002)(189998001)(53936002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain.localdomain; FPR:; SPF:None; ML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lmCFUhIK1h3yIJ1iTUC6vw==; 24:F9FWBNeMt3J4eNcfdpGg2vd0j9ILzSk7UeZoyc7jqfYjTwG7ZTzwhXO5ucRu84uQ5hWP6HSGh1DsTzoTPPZz0Zc1BwJtNDt789M2Jw4fB0I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:29Sp3b/WOrlfEcHfjKBrRUFr7E0VTdwEuvtyUi+gs3OerVP4tfWZCmdLOeAQupYRRsQ2p/qDtGoNkrkFrPtqCxb/b4pPWOFUeVYUPVAaBNzvpLlu7mD9D/PrxR0VlP5Vs7wE0LA+FLEAX8JUqpLRI+8R2LCc7DE5bSpnHNc+9iWaA4K5sBA/CUba32Q/k23V7/DwKQ5b5IZjYS2ASqYSjkDpzxBlLvlu6SL9+Me/+jPzVA1BhvzxB12zr1U8jH9LIJpofeg5Sp2qXT1BW5FJnOK4ulUsn7kgbT4C3I9vhu97clPfvQnUqYYOMyKB2QmHGHgx7VlMbYkm6wVSXNwl0g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:29:44.8129 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 13/39] 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, 03 Mar 2017 17:29:50 -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 --- 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 8474b90..84868f0 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -184,6 +184,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, @@ -191,6 +262,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