From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0057.outbound.protection.outlook.com [104.47.40.57]) by dpdk.org (Postfix) with ESMTP id 654B9FE5 for ; Fri, 31 Mar 2017 21:36:47 +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=8z9m8o/cwPoGyZDyG54bZbfytbxSRC3r24HMdsqSmK4=; b=lrY4phggeGE/qXWHU76nBgVJMCtfmVsDi6GtZD3X073SGKwNsNnHiE1wafmQuXqFTMVQe3ClNIrCVstDkJ4IEjw5sRRsmdfbfUXtK8W+X0766j7Dgk1gGJLh/jHENL4ZPRWHPD6XLj6ycX6PhJLRPQffRGedbi2S/M/DyUsr4og= 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:42 +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:44 +0530 Message-Id: <1490988905-12584-18-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: 6ac9e1f4-24ac-4136-7010-08d4786d4401 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:JBfJugeGQYJ/NR2xtvomqadPKDufSN4Itg624eyQ+7qIiaZKOHYvrW9S1c2ly+YRBNZsIEvFwW7CPwO1k117SErb2CSFHwauZwxegQEmflpT474QjHU3PSG2hJgKGVRzxq8gINw1i6pg9+qcdr72TEko6LeYxiOxUzrfaL6qkuhYUHzEX3nDd1qWL0W40EWhUHPYk90Ru645G1UrZfuA5bKtlTauNpeCUIF5O8+r+REwHDBle+tyQp6gmUM1895zgIUlcy55twML/Lxwoag5bhAX5zkjJFFKON6lDgGtxSXJb6n7qTLIrvmh3FUx2NoMESdXzkqD616qAso5vAsKWA==; 25:nlvY9yCYKk9FbZ0kwmXkhJ1XqoEvxlVxtg3jlRXG1dnDuWMujMPoI+xqDGakn7yOI8h24mg1xLNYy3JrPYyCKg6vkohAaTeSEfer++s1/MNa2rN2/hUAwCIW6JLMsj/WlQh+M/PGBmTlEomsXvg4dSWjR5C5jOpTPRhg9hJPHalZHDfTvJxUKPPKW1/eubMLni2dsxNvzPxuVJiu1ljhlopFTq9Cdd3ZbzylNK2gA1x3xZha2O5ZZrgO03prkEOwbJMeEuHsdmS8O/4aWmDcOnQUvzTGHFUwMdKg4JYiJqxJTPt4+qrTNJMRXUr4LdAYRTyNtmGCj9MAV8BZEReXmhm3x/CU2nVtrK8nmxSYZefhwcToVZCez1ki7TS6kP0geUDniYjW+EVPPopd/+CjuO3v6ns42AIY8QEDddYeOuFj4DGjtYNKuV9mfxc/ijO2PMA+PaXpEKOGLKIdd+NWDg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:kHcy5EOWhneB+vGvJp8srdNhLZCXKBCXiJYESj41UzyCSG1vH1BkV4poCrhjXwx46G0awBxAGccQzwAm3+zOh6VA0VO+UyxguEIY83IkdZ/mYDoAyiMhp2gHnsneE9EtXYtrPxKLlYtEmyTjXryIQ4GE/IVLv+9HGqgNnoxYNDjbGgJxD86vGCQl3OPSVI0eVJzDh7X8I1dyjcKQV30c5fvIRhtXW6fOAFc+LUcvxag=; 20:hcDlcmzQSWz+kuahwsD1wUxSW1toE1mvay2uNHeAHgPgBUYWQ2XTwKZqIaKzF1Uee6t90BTsRSgYN4uq39xsyWfRTWzNEtVxuAtv9NdTd8tZBokYMOMxOMAiVtyP8vAR1y914hgEARCb1uIadkhibnVPUAJoLExjEMIKCxMvWxhEOTynSfLs1aTdZzAYauDjsA3L8Gum2KotXCrcbJk+WeudTLDUZgvm21ATG+iTP8yRQpeO+W8Zziz36qs+aeloQBCM4rcaDFFTDycbLs+lFPTH/UAg9TJO4cqGNOmyARouR1rOVb7l+KjS6Jz1DzrjXvrM5wUuqsCgLrvJwRnAVXwoRRNXPSbWaMO9TNZ7vRw+l1Sv+H8o1M72RdhRftCgFZgUSCARVyxpqSy6D1SKtnuPSH3DxgdRSfrTZPp/GbKt2PDsx2SMHUesKvctlaBG/gsjNxiQP6Duia4/w4ZRDrKqSXjgHSpmSjtptZn5+74EbhwDN5z1CdkvNVkvQWZMcEU1E4KLXtowVJHy5i9rYH0+psjdwEQfrZd6TcrMFgKoany8ezfGOsjzuNEm455gEHgr2Cos/lOHLGny347GD2cmYeEHSdMT9/qBtYKsCuE= 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:J/Qfe9BSxkyFnGHT8riCEXTj81LKn/RkBButPnbrBU/amE/fwhUtPXXfh09UCignyThq36d97D8liEzP7n3tlp17h5vn8HOIFk6GWlRzlaVnrYiQf70Ub8KtltrtOid9k9Rhq1QmTHrTJ5RE3wozg3WHd3wm6shc806VCWXnTvMUjIVxy6mG16j4djIqPjlvmWuPARRCd+mlWKcl58jKMy1UbZVCHlW4ph2fZdbm5HVqKslssKsFH4j9EAGyNEJJq0OIa4ra4akD3/5y7k9eO09RiWzfBZ61neasyAeAohxjh2rE5520/CUgAV6iBWh9PH2OSkLOCqcwGzVzPTAvXKW4tchSmQHdnVCwfxsRmLCsjSzN+cUdLdHi3XSt/nWjhfT1t+NK/qrW0Sk1/+xLDFWjFJpg7oq5X2AjuCx462iJ/9YFTPv+d68TlW0FHtnUhWw2g5mZ8IadvF481V5CqDPH/CwldKg3UBfRgNC5zbfkh5uOZFtYOc2Fq6kvwRe5rsYKnKtt4QOSOE7JPfngD6ck7/D9B5YqHNScDtfOHJDlRv3z9BlnlkW77ixBDmUNr5fdDJgvMIdgQdcOdzppeiz9gZMZ4HiPMDYjc/7ITB2MxH108E48SNLr+wNojlcLEwQIUHgCF8CxwdSBhDDvFS1yCDiEEXW+Yr5lxTnX1vqOavxku8z3Hxk2Zppo84z99LBLgHFZMbb/Y35fm1E+3XTbkAwzYtGU9G+2hgKIca3Mi0Ip3iN6RRisDuqAwY6c 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)(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:dkx0+tkgweNJceSveVdWfwDE3PUmW6+lRcofQXo?= =?us-ascii?Q?X5zxPltQVr2ihbV6kO5bV064rt/2vDBbQF3UjTPs0cP0lkeKT1XvSxniMctL?= =?us-ascii?Q?eugFmqC4VKEReNphQ0iQYQM3rNHMn2SZjQLwJ52RLizuQhIRv6Ymufl9BaUQ?= =?us-ascii?Q?hKsO+YiXRQYxChURTyq9jM0vGmGgHkbe9OIrjl8kx5PBvnl/RGH0xG0aRj7M?= =?us-ascii?Q?YAdn3dYn8tOy7nk3SiNuPEE3Iyi/YWkQGjc7ilLai7sb/m1k1ZVbmGkvUpZp?= =?us-ascii?Q?GJ6KUcsXZmNTC81D55ldf3rpG+fuyztlpKvwK7GV/6g0AJ9EA4jDMvSGcPKf?= =?us-ascii?Q?uoWXYrKkwSEdSTpa8eSfpKPZHQB0KCsk793u5nExX6EGWXSafRDwBkJRhWTy?= =?us-ascii?Q?Ik4o0kiAK7QoAPCcjCUMjcZos3EDM4PyHHqmOpmW806djhPaWKIVzjvsub+p?= =?us-ascii?Q?/x6s01h1qIhmKeDtBSjFaaF8jDO+xA1x1v0QLLbgDF9SlVDj+8xV5WJQ70e2?= =?us-ascii?Q?4R1ueUGv23FN6X3fpwxXEF9cNSCjVEC6uL9W9nP8tZ2uW48G1gzt9b7YY1EJ?= =?us-ascii?Q?BPcTJw1SJ9e+UFPd1z+25NyVRItByuCr8Wx8FrQZcQyLEvN7pMvdsesyYRPR?= =?us-ascii?Q?WDxGf31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0QyQsNyXhgEiv9u0e/K3f5uUCRC/9oMHK8JF0OhPjJ7pN3Jx7xQCA==; 5:gMBn8vabl7YeA61srYCV0JRy9wi0drJYKHN+MIfQL3Y14SyWpRCAqIAphzRKHUYRkAmPuk64KIanbwjXPz0f5ZoKd7KeYYi0qUxAw5xEB1vzl8cx09MnqNXZeX2RbHhbbWoISCUs5Oj4l0TbJoRkLNQ6/j8ZOCR/RR2e4I+BqBM=; 24:A8EZo5OluI/rxifU//0GjoMoktpBgzKV4wbYYUlm+dNF2iTDQQ3mXil0IQLx4Uy7+N46KCnyP0PNV59ei9svP7m2K7dBU+6wdXlKnLURFrg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:/L5QCfmKCAWvQ6FksTX0oEyedMd1Pj/Jv2cVid8NOWkfv+03TH9PcSRHmhWDccML53fl7ksUZx9j4x5poG/Wh+9XzAdOOPVJg0bBOly+QAtjpEEukwhsl8jPogw7+s/oIx/Amr3tei+ILIf9ObYsvZv+3Y/Nk2bT1L5GyHmnlrV+vDsivAOqeBnwlNrl7r2mTn2a6ABIhTR/umtI7skzQkkfHS8SgiZfTFvLndOKApQqsdQBqmCE8RYVCrEvUaC/CG8mkLBlR+jBblEps91lijslnvErxU5G5Wt1Fe6QtOw+eHuUs6qd7QHlovnjYeomrQ0C4IW96ekcVOVq/hFqGg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:36:42.1676 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 17/38] 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, 31 Mar 2017 19:36:48 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla Acked-by: Gage Eads --- 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 4fb515c..0db3252 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); @@ -382,6 +399,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, @@ -396,6 +440,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 @@ -425,8 +470,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 13c7823..a6925f6 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -290,3 +290,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