From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0062.outbound.protection.outlook.com [104.47.38.62]) by dpdk.org (Postfix) with ESMTP id 6256BFE5 for ; Fri, 31 Mar 2017 21:36:39 +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=n8rB+8KG8GfvZgzhNw6Yrjtmv4N/v736QDJFH3Ogwg0=; b=PQVfgAKUzVw7UBVNYenThwupjU97Uv5j3qyzaiwaEcxwq5EfAQ5gCSDtMO2vv5CJaVPUtw4eLCYwRnXoRjnrjzUU+0UNZ/egvkqH9G8XQMUkDwCFpvijURe7GskNZk4k/X28u3orVXk8kw96wpnbMYsHyFGpnvQB02VzfdJztdw= 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:34 +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:42 +0530 Message-Id: <1490988905-12584-16-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: 1f718373-83e8-4646-c39b-08d4786d3f72 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:lNia2YHvLBtAm7LDsqBd1qxD98OHJ6rVXw0MMCHvmxZp3M9fiUZGnACAOCptKG8KmQ7xzETNLFyTFgx/vv+fEzBO0rHokTmXTfp9L9k0BoQB2z7snZnWMkyST++0rjUcZG0tDpW1BJwLvVlkRsUFpgEyvtbcaVWqUIxcXumuTdsOLyJwuIaoVWcDBKpfvCmeJ/WhRTOw2OmegyRsFrhJ8lIGVxRP2ZVFBu22dffBXU9bN37yG6/TEX/G3QC8GAVLOM55xVTFNU7QIQPFgEINVIFIFCBbsyFGa/f3pJd6Bn3BEABcYFL29jE9gD1E4gPpMt5PNcvXMOYijC6/2bMIXA==; 25:dftCpYabbZg+5NvtY9YGXzUdfI++6TgpLw3hYuVlPIQF3ZKBR3RbFybqiCbATNaA2g0ztY3ejwwhBDAOiiDuUCBkaQLqUAcsRKEDvzs9x8ag9IO1EF5Lm1VTFlYuA+62yrBqajFP6nypfNa+yfAvGMksVgsVX+EiGak+Q2S3GDELiha2GaiQZTmm+ezcAkrHfoFU4KRbqIfgb6QuqdW7pb9TP949FoqKp/8/D9JAOzF8/j03wyB3BJcVjd3gb8S9NGSL7NVbarrpo9kgOhtkFk6ie421AQLR67kad1ywfJZtG2QzXtgAsG0p+U4Hyu13d4tbd6xntDvWUttX40nCMWLY1uNUR56UwWGwo+yX5GIJYOUR9lY1rEFOjWHP7uPMR7sQP404HI35IV96zCM0sG8yRPGBU8McEbWrLZP0w+3dvq8YCXg7uSRcaMylDgAwOkm3hHPKB3BrkVDTqaf6eA== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:8rrCxHF/E2QdPQqyM86yWhgg2XBQteCh1klbWlpi/vzuDjbn6t4MakdVRNxgJdVWgJr75TuUHGmWiroPAFdHpJkbniZW2REvvJzUeGgFdIMUkC4lmFvhdLmRmG20QFqIxOqBp5PgfMUaaGjM1/mCGreKr15EPbSaMoMI/YoINVagfonZJRmjktgKxqvAZmxCK9jc/d26Xtlo5Y5s1IUoq//oS9MtZnnDarH5/tvYfu5HRpHChvodWSjLSEGAHNBb; 20:Hl5JT3zEkWU5IIDBsosbfMKg5O00mJfwGzt852s2kbsUGdWALQ0//mXs5iNnUcZsdAFxUr9zE8Vjtlm1gDDRNtYT3yTkB1oaM1Bi4vffoOQa6kRAlZw34mYOG29N06COsOXg4EiOpvoYdiuqcycXgKrhSOw/ula1FTr/zXMn5WE1L4A0zr3W5wET6cv8pz7oQ3NoNvLn8RLfWJReqtflHYtw0i6kE6AiEOEXVuMa6zj+6SKG8AG5eG8WIK8/fJlXYWf/hQlC0zMQHyy/6JeusFhCCzJQEgIRt0kR0/Lib0eKiJHNg9eRZJmO9VJOVX6mqUrRzO4cdeKz6Tg6XOGS4Bh/XJ1ytFTggkQbYTOffPoj7hbNeYmHnYj9evyls8pOEMXBfYaaE0RkCDDF7wfUN9GPhTLkp0emZ6hv2ZrUlxLc0+P28487qjiY2TlNpFCG/UJTl252KnvYTpraE7PKvIgjNZR/YB3Gk6zmONvAnszpLJa7hW/6j+6lsBbRgP3+vpMri8RTEhyuE0tt1pKt6uiHggcQgPR7+kgfG0/+OASQA2U9R5a70J8gMfC4zTq55uXw08vop49DFCPVFdFTlenylwBuwBtWYR5ASfRYkEY= 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:/j3sNFEGRcDQuXKJiFoQxc9GuEZK50aDOEfUbgI0va+17OEVi47qAH+AagpHIBdk71GVuz976p4CBZQEMJW4HcDPK0SKndHUssA2Ny0jGVMT0n0ZPxZ30QmOi8uxlBTFTjICfs3jmLZipQgMrYomnBl7TirQqdmcyG71YXclGG7ouRNgdTPeCs4cxJXa4gDxSDWjSi1XCAwN2BNcRrCncMhdnOhE5Ea4nkvCDeR0Opilr9Er2nmROBVkCxdkRzXu8gjhJ+q2ZZn9mBPAPCK6tT1Szf0/UHsE9qICIW3sE4w05s3M7IP6TFryXrhUIIxq2yeGWpEaZRp/vKyAPNi3P1+Wnxp4jUAwdOOAzTekJaU5VuIt/Y5mMKAadTdkTsN6ne0DdPiPt46icuxcGkWqwQXqOc+zDotC3bZr7YHbCvA4eMKfmXfuoMzr3IIqJYt5W0qmExXaUzv7BKEDlfO25mLFiCPCMMYK0X9auwZ8nMFBFHGQrTUWPLIraeamrK6/O2sWDG0+88mra+TOEXpEXBnskePe5MR111bzimvV2TYskZRvU5Em9XOuxiIYQC6RyOx+AO5iiaUhzqwTaghOGmLh07exNI67dD2QE46/makbEbLw7YrWPu9lxr1BD7EW/V0h5A8Y3p8x5PIq+5u1uxVM0jvHIwEiR9rViL2b/BZqoSHzLrbY2rjfMjsOBzyK8P0Ad6iqbtNDKRHLoLDvE4NeH3CU5QSoM5c/viIzXA2OHXypwgKGi35THvceycWY 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)(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:lmnRikZhTQxYqS3C5tZZycdE64ggLffbxisG+8j?= =?us-ascii?Q?6DFs6jKuRcEig4EUA8IsY62dcdYcgYig8tZJSCkmmrmEPaEzM38Fl0qbRBcB?= =?us-ascii?Q?fQK9nb0OCZVmZcHzFz9W5RZpAqOQr+h0t/XrW/FpT6MqlgUiz4p3lW5DwQlQ?= =?us-ascii?Q?qCMSMrdS5uSfmAviPfoX2++Zeu0bhSgMBe1z6dmuM7hDY3NZ9F2EvNlhvfPf?= =?us-ascii?Q?CRKXS+aN15J1AUSmNTnmuPNkcnxgfcICcIt+dt4eAy33bDRrkqnhp1yCYLm5?= =?us-ascii?Q?5/FuRga9HwMGQ0obZGXvxKeNuLF5au6ziRmsNNW9EK5rNl0A5MLi4c408N+g?= =?us-ascii?Q?dMyPy1LKw3N4Ux6Q6mJe6UB73XgYAo0uVR59fjVPpkIPQI4ulkNdaaic4P5L?= =?us-ascii?Q?2p180N1R8chX0KeCCIF54W08Z/yXZH0jpi76jT9FbDedIuMCHpyzhtmPH1e9?= =?us-ascii?Q?JDIvIP/r304/nYmbnRbkBRdw/rWql9C0e3NVkhLGGnfpO3OZQ/dih+p+nt0O?= =?us-ascii?Q?1gIcnfetFZ+DjWj8df+TBqY0WNnj/tUi0itq0QBDWYn045Ewo9C29ebqInph?= =?us-ascii?Q?9mb7WebHnLLvn8W1bZAuMqNYVGr6OSMbrZq6et6j8qzK8eP2/WSgKCu286A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H0HCzgW6EerzqffUqhDxuaFfRPCLnzZc4Rc/i39ljKCxVAsjDvMzh8fvTjfDLaAXmow==; 5:blfFPR615q0FC+nSLG8Bv559Vx7/KK2SRwFGNUrSejnuvPDyRrUq5XeYgTklCUcXroqSLK2nJeIOVxg0zqTiSGfUjp2ZmFbluvpnYpNDSpA8V4Xjv3pftK70i5/skUwHKYRcezAQPbUyQfefS1VY96wUZ+e/kiNTuwc3Yhmm9WQ=; 24:60Om9uIoHLK0OveDwrDX3pMJkf1CsVxCmP9/fRK6rcqMPMNE9HPyo3lrWF0/SFbBzfX0kRh/q0brADRt2d13kceFpZltm3LJfn4mqUs0OjM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:T0yIZdJE+pwXb2+Tb3709MTFmZ5OKMMpxGQR8W/7aAbConmb4ft159+45nGLc0+hGmVLmOKI5tU1E+Y/BHJKgrMCsOjzsWb++//V87/3qC3vAOxOmY9wtCF+b7qxn9jtXZtXXh21tuS1F3NuRCwwmtduKirHby+aXiPhOX01Z5LL+0+NrsyoGi+JRc2y5jh7xJh1hXyWG2sU3yzwHn7jiA2uSDmPOuXA08rXNGIPLmgaLd6Jo2WEDgrjczCb3st3woAkuewCacimIFfkF5Fu2x5EyvD9s8+zzYD1yHs4VTUa0LwK9VqcyqhzsMqKoAofGMRzxm7jTzf3oS74ZdxjHg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:36:34.2795 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 15/38] event/octeontx: add support worker enqueue 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:40 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla Acked-by: Gage Eads --- drivers/event/octeontx/ssovf_evdev.h | 4 ++ drivers/event/octeontx/ssovf_worker.c | 116 ++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 16846b8..fac42f5 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -187,4 +187,8 @@ ssovf_pmd_priv(const struct rte_eventdev *eventdev) return eventdev->data->dev_private; } +uint16_t ssows_enq(void *port, const struct rte_event *ev); +uint16_t ssows_enq_burst(void *port, + const struct rte_event ev[], uint16_t nb_events); + #endif /* __SSOVF_EVDEV_H__ */ diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c index 052d158..33ae912 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -122,3 +122,119 @@ ssows_swtag_wait(struct ssows *ws) ; } +static force_inline void +ssows_new_event(struct ssows *ws, const struct rte_event *ev) +{ + const uint64_t event_ptr = ev->u64; + const uint32_t tag = (uint32_t)ev->event; + const uint8_t new_tt = ev->sched_type; + const uint8_t grp = ev->queue_id; + + ssows_add_work(ws, event_ptr, tag, new_tt, grp); +} + +static force_inline void +ssows_fwd_swtag(struct ssows *ws, const struct rte_event *ev, const uint8_t grp) +{ + const uint8_t cur_tt = ws->cur_tt; + const uint8_t new_tt = ev->sched_type; + const uint32_t tag = (uint32_t)ev->event; + /* + * cur_tt/new_tt SSO_SYNC_ORDERED SSO_SYNC_ATOMIC SSO_SYNC_UNTAGGED + * + * SSO_SYNC_ORDERED norm norm untag + * SSO_SYNC_ATOMIC norm norm untag + * SSO_SYNC_UNTAGGED full full NOOP + */ + if (unlikely(cur_tt == SSO_SYNC_UNTAGGED)) { + if (new_tt != SSO_SYNC_UNTAGGED) { + ssows_swtag_full(ws, ev->u64, tag, + new_tt, grp); + } + } else { + if (likely(new_tt != SSO_SYNC_UNTAGGED)) + ssows_swtag_norm(ws, tag, new_tt); + else + ssows_swtag_untag(ws); + } + ws->swtag_req = 1; +} + +#define OCT_EVENT_TYPE_GRP_FWD (RTE_EVENT_TYPE_MAX - 1) + +static force_inline void +ssows_fwd_group(struct ssows *ws, const struct rte_event *ev, const uint8_t grp) +{ + const uint64_t event_ptr = ev->u64; + const uint32_t tag = (uint32_t)ev->event; + const uint8_t cur_tt = ws->cur_tt; + const uint8_t new_tt = ev->sched_type; + + if (cur_tt == SSO_SYNC_ORDERED) { + /* Create unique tag based on custom event type and new grp */ + uint32_t newtag = OCT_EVENT_TYPE_GRP_FWD << 28; + + newtag |= grp << 20; + newtag |= tag; + ssows_swtag_norm(ws, newtag, SSO_SYNC_ATOMIC); + rte_smp_wmb(); + ssows_swtag_wait(ws); + } else { + rte_smp_wmb(); + } + ssows_add_work(ws, event_ptr, tag, new_tt, grp); +} + +static force_inline void +ssows_forward_event(struct ssows *ws, const struct rte_event *ev) +{ + const uint8_t grp = ev->queue_id; + + /* Group hasn't changed, Use SWTAG to forward the event */ + if (ws->cur_grp == grp) + ssows_fwd_swtag(ws, ev, grp); + else + /* + * Group has been changed for group based work pipelining, + * Use deschedule/add_work operation to transfer the event to + * new group/core + */ + ssows_fwd_group(ws, ev, grp); +} + +static force_inline void +ssows_release_event(struct ssows *ws) +{ + if (likely(ws->cur_tt != SSO_SYNC_UNTAGGED)) + ssows_swtag_untag(ws); +} + +force_inline uint16_t __hot +ssows_enq(void *port, const struct rte_event *ev) +{ + struct ssows *ws = port; + uint16_t ret = 1; + + switch (ev->op) { + case RTE_EVENT_OP_NEW: + ssows_new_event(ws, ev); + break; + case RTE_EVENT_OP_FORWARD: + ssows_forward_event(ws, ev); + break; + case RTE_EVENT_OP_RELEASE: + ssows_release_event(ws); + break; + default: + ret = 0; + } + return ret; +} + +uint16_t __hot +ssows_enq_burst(void *port, const struct rte_event ev[], uint16_t nb_events) +{ + RTE_SET_USED(nb_events); + return ssows_enq(port, ev); +} + -- 2.5.5