From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0079.outbound.protection.outlook.com [104.47.32.79]) by dpdk.org (Postfix) with ESMTP id EE5ADFA5F for ; Fri, 3 Mar 2017 18:30:18 +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=/hw2fVeGwCCc20yXVLER7XlmJaxxEoQm7nnKKl94z8o=; b=i7o456ctBcr4bB63+Xcx1bDil2XyEUpwWCVfoipPCWZlCJXqx604EHD3If7Aj0bLEWuXZnEIOBfa6QqxPrrLeElMKDUqUzDLBUjlbeA8XxXj5aTAogs09P5HDlBpV92hPkvFC/xIVI8YO173PpmBCFpxz4UTWFVNNtHIG9d2OuM= 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:30: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: Fri, 3 Mar 2017 22:58:02 +0530 Message-Id: <1488562101-6658-21-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: 15bb1cd8-dd52-4ea9-552b-08d4625af592 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:Bwe5g8QUbD9mW8C1bYYNKvSt/iKPeEOtAP4tIl0egvAlMQwsztC3ueni9wcDPZYmATzAOsCticd354ayOfQS7WNNeiDTfwZZQmq0XDSbRSJo48PycL0MGRzcRmw7YrW2mgIbqMxXZngYni4zIVUkWkOLnxvig04TtIbed2jKocWvpETYuhqt9VfZVmk3DySpKK77b3GzVyFfhA6jl9VTYE3ttDcbmnVAB7yrKlQyNLzIKbwr9zPSHlCmmp5QdB/tFwJqP5X+LU7P9MX8MgHhpQ==; 25:MCme4vbytWHMgHPUU3Dm+0R0DlWWnvzim/Nnzzx5qlsBKbYcEQuF8vFXlG28uqnlnXhmYJXQWN1JAxrDJC/f2zFCYSlf5GNISPBGVsrSrPADfx22e9w7frhzEv4N7TzOSgGF1QYNHoj33Ia+XzSCrFU8wHcCFvUEzS4hBx6AV/H+QtB9kiU6lqeVwHapRh8KOwB4ZlzX8LnhrOM4TzfKhjIUhu21gDH+LbmVi3WKL4Br1DlBHhU/M1+8iYkLY1BTOJHpHLzS2xJnU2MWZDnSFOePlPU676s+fIZEz/+zWnZ328ywXsKLv2eYGWwMMxsXmr2Sgljo7SDizu5VtqBvFDImIB7SX/zR+bKQ9dFt1iLcuj+zed4g2VOwEiIyjnmAnLWQVHnidCQaARscregeQ6jGtlfAeXhdUP0lU4NPt2PP0DKe2gN+b6ELFW7hRYVR9QAA9XDlUl6R1r81b8DH9Q== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:pe13SBlHghTaWBI04U3Nugn6Z17/istg04ZoH/yWBuJmPA2Rzv5QtCtfyZ3eKITctBUpeut3m1VDq8SXvXpNvS9ZkiMkAIs7tiH2dxQRQ7nBms+suDGzKHAOszT2fIjEU1WoAoR40d2Ro95j1LB+JLbvZhJx7UvJ9PV5HXJa6Ebda+UVKo46KbMRWUFp5FOoCE4I2QesPQfu/tdQSo5VK90OqU9R0J0L8nVteDfDzGfA0wdPl1D+7vJNV+RMyGvB; 20:Y7leT23Ukmi5mkPwxx5KIcCIALGmRubCfWGp3/BSrlqDTzR2aVQvag1DUx/5t96GpdFbDP1ZMIKTY+7YmJt0qWkWXdH8Y9KMQfqu0NLBETpHthDrfV5fU0TCERCUs7XXMPNnfqdPbJsdqisppyUA+8msN5bFs4+Mn7S/YBvStt5OX/4W5sQEriUPhebpfW7jdUQue41JEEkc5TK8sC0RyZImIBhZ1YrdFdMdS40tlWrqdgL4S8VEydAUj+rwBrhZqDQtWxn+mZEqYXFGwiwpXX6McU3vfQ1sucT0t5U0l1XpAg6uoJysv/x/ydmluwbYW1Z01XCWSBH+EjT1DJ09IZf9KudDP/XEMFtP5zZEnyfxn4tzEFepLCcsmSF3fhLYeG1uZxYMv/xvBLFNO516klVyfgTetiGeQNZH//giz47bgJO9vSvEC0mN2k4jgBsv+z9V0m4vfvnATdcPEjmbJUQGL0NEEe7WGJ+UNBJDlcSAHTzQhE/AvjWQ4/9YVVHoInxs5SIhyI5z1Mb8bJcEQXAeV3OA8LWfDNbHe1b9kY3d0CE5ljFc6nnbF9Crnn/NIcsU4zm5MvFCjnmfNKoap+zJOKztOoCT8uo8DKNR5nU= 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:MrVv2uzOXgejtb79ZLaj82zp1g9TTmGEMxUB+013I0hYcEr3gYsowKDGPHv4FJpUWVCk2UVIZnA+AXYCZYV+Ij7cWE2hLdDbLV/slfC77ZBISS/4bOzpFOhz8b/GIenbbhdiO2bGCK0AWyictYI3m6BA9MQq6a67Zvsru3t/mU5bhV/3aQPKdC//M/rkUTA94/OqENaAVJZJnCEGgoZGNfElrAA3CA0Uz5p5yadVQfbtmygKb0xCNc/9oIamytqDZvSHTEyPWB+AlMYyFl8F8RLlag2D7+I+RXjAKgYeL1orubIl+e0YeOAyelf7+xhnvXFILINp4uHJKHy//h8GsI3D9QHbN9lzpxBY2CTPBVx3hh+d7d4b9poyL632L2Ie880dldV62Pq3KrcgZlA40XTHGYQCk1AOsxyDxewT7tImT8a2N7UxKYdr0j2FwBSsdZuvf081XfCgdRgpjnTbniy0OKtAcTWFgYBPF3znG98khYqPiJcRlxFA42s730t6tGfXHizN+vOR2OyEqGfczVEjNCkHGcXUo6x2vSWXoOJyEmTdjNhGKQAReQyn3uLB/Gj1iBcXFdSRoNCCiVF3JNkBvf8bDqKuMz4Psr4hWVM= 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; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diag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6AUnD31ZbVB2sBmoCFjCy7ArJ8k7b/roow17/yy6+02fK8xmxDnc3L+mXgfhU1PyX1UOk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:slPnAI7DIAz0sKTNVHxPGN+qF9GuDEh9pP+0rEyrg00bi1ss9TZDFLMPH6Ex20eYnOfVB5mS6BCgDuTzxOfMWW+4oc54jv/TTajytcoYsVmHZNuaycKrfSxjy/OD0jFxDBoeN0NizoHKjesY8G43RVMGd8k0uCpqHCxhMwLR3eWWYZDLkPolL+DF1E0c5Md3JjlT0OYG+iFOMT3G+eMlvSqUSQSq/io3RmZuFsykXKFphfYMiXqsTvOF+bwIjsLxnG/rL5tCboYqRkcrgghU9LJ/KgBbuzSEeKgxvT0J/qrRoehA7hXyCWICH/c4Vc1fGpIyVGAvia8G9s0SSQsNqQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:13.7512 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 20/39] event/octeontx: add start function 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:30:19 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla --- drivers/event/octeontx/ssovf_evdev.c | 49 +++++++++++++++++++++++++++++++++- drivers/event/octeontx/ssovf_evdev.h | 2 ++ drivers/event/octeontx/ssovf_worker.c | 50 +++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index babd59f..26c84c8 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -149,6 +149,23 @@ ssovf_mbox_timeout_ticks(uint64_t ns, uint64_t *tmo_ticks) } static void +ssovf_fastpath_fns_set(struct rte_eventdev *dev) +{ + struct ssovf_evdev *edev = ssovf_pmd_priv(dev); + + dev->schedule = NULL; + dev->enqueue = ssows_enq; + dev->enqueue_burst = ssows_enq_burst; + dev->dequeue = ssows_deq; + dev->dequeue_burst = ssows_deq_burst; + + if (edev->is_timeout_deq) { + dev->dequeue = ssows_deq_timeout; + dev->dequeue_burst = ssows_deq_timeout_burst; + } +} + +static void ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) { struct ssovf_evdev *edev = ssovf_pmd_priv(dev); @@ -377,6 +394,33 @@ ssovf_dump(struct rte_eventdev *dev, FILE *f) ssows_dump(dev->data->ports[port], f); } +static int +ssovf_start(struct rte_eventdev *dev) +{ + struct ssovf_evdev *edev = ssovf_pmd_priv(dev); + struct ssows *ws; + uint8_t *base; + uint8_t i; + + ssovf_func_trace(); + for (i = 0; i < edev->nb_event_ports; i++) { + ws = dev->data->ports[i]; + ssows_reset(ws); + ws->swtag_req = 0; + } + + for (i = 0; i < edev->nb_event_queues; i++) { + /* Consume all the events through HWS0 */ + ssows_flush_events(dev->data->ports[0], i); + + base = octeontx_ssovf_bar(OCTEONTX_SSO_GROUP, i, 0); + base += SSO_VHGRP_QCTL; + ssovf_write64(1, base); /* Enable SSO group */ + } + + ssovf_fastpath_fns_set(dev); + return 0; +} /* Initialize and register event driver with DPDK Application */ static const struct rte_eventdev_ops ssovf_ops = { .dev_infos_get = ssovf_info_get, @@ -391,6 +435,7 @@ static const struct rte_eventdev_ops ssovf_ops = { .port_unlink = ssovf_port_unlink, .timeout_ticks = ssovf_timeout_ticks, .dump = ssovf_dump, + .dev_start = ssovf_start, }; static int @@ -420,8 +465,10 @@ ssovf_vdev_probe(const char *name, const char *params) eventdev->dev_ops = &ssovf_ops; /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + ssovf_fastpath_fns_set(eventdev); return 0; + } ret = octeontx_ssovf_info(&oinfo); if (ret) { diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 2cd9147..6e0a352 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -197,5 +197,7 @@ uint16_t ssows_deq_timeout(void *port, struct rte_event *ev, uint64_t timeout_ticks); uint16_t ssows_deq_timeout_burst(void *port, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks); +void ssows_flush_events(struct ssows *ws, uint8_t queue_id); +void ssows_reset(struct ssows *ws); #endif /* __SSOVF_EVDEV_H__ */ diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c index e0d17b9..caad769 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -306,3 +306,53 @@ ssows_enq_burst(void *port, const struct rte_event ev[], uint16_t nb_events) return ssows_enq(port, ev); } +void +ssows_flush_events(struct ssows *ws, uint8_t queue_id) +{ + uint32_t reg_off; + uint64_t aq_cnt = 1; + uint64_t cq_ds_cnt = 1; + uint64_t enable, get_work0, get_work1; + uint8_t *base = octeontx_ssovf_bar(OCTEONTX_SSO_GROUP, queue_id, 0); + + RTE_SET_USED(get_work0); + RTE_SET_USED(get_work1); + + enable = ssovf_read64(base + SSO_VHGRP_QCTL); + if (!enable) + return; + + reg_off = SSOW_VHWS_OP_GET_WORK0; + reg_off |= 1 << 17; /* Grouped */ + reg_off |= 1 << 16; /* WAIT */ + reg_off |= queue_id << 4; /* INDEX_GGRP_MASK(group number) */ + while (aq_cnt || cq_ds_cnt) { + aq_cnt = ssovf_read64(base + SSO_VHGRP_AQ_CNT); + cq_ds_cnt = ssovf_read64(base + SSO_VHGRP_INT_CNT); + /* Extract cq and ds count */ + cq_ds_cnt &= 0x1FFF1FFF0000; + ssovf_load_pair(get_work0, get_work1, ws->base + reg_off); + } +} + +void +ssows_reset(struct ssows *ws) +{ + uint64_t tag; + uint64_t pend_tag; + uint8_t pend_tt; + uint8_t tt; + + tag = ssovf_read64(ws->base + SSOW_VHWS_TAG); + pend_tag = ssovf_read64(ws->base + SSOW_VHWS_PENDTAG); + + if (pend_tag & (1ULL << 63)) { /* Tagswitch pending */ + pend_tt = (pend_tag >> 32) & 0x3; + if (pend_tt == SSO_SYNC_ORDERED || pend_tt == SSO_SYNC_ATOMIC) + ssows_desched(ws); + } else { + tt = (tag >> 32) & 0x3; + if (tt == SSO_SYNC_ORDERED || tt == SSO_SYNC_ATOMIC) + ssows_swtag_untag(ws); + } +} -- 2.5.5