From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id 77E13FAB7 for ; Fri, 3 Mar 2017 18:30:10 +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=W3oRV16rJkI8+EflaKdTGfXsayG5ghjI+hEmhkYIF0Y=; b=la/t0gs9GTpr3DJuoh0LL0+Y5lvbyc4K5eZd95u+GdtcHh+ninjYX2NtT7h6hPfGpPoZygFo8QCZHKvPv1nRQhvDEB56EMiDdW0LWTqfsKdR9f1q5KwtjhR4SCx5+zEpA22pN14/nIxqz63Yoxb61I7HSl+EOGrKelQ3gGSxH4Y= 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:05 +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:00 +0530 Message-Id: <1488562101-6658-19-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: cce274ae-a54a-45da-10ac-08d4625af0a5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:97K1mju1+bBSpH9kyQWKjHP8Wj1nUU/sjeYeoJ22arlEnGjuJyR7vr0n8qWtsVo5EUtOSX0XfLyz0JchiMSS4kiRYWGf2vmteLyBmeDbRsYH56eT3E9SOl5kWhjZT2quYwqL6SFksG7mJWx83jsC23Ib754oJ5/tbRS0nEh0JQQZ4GVoDZdnb16zJhXwyXZaIRbjECPRCwLc515DPFOv/XPR5RZ0n1BEYxjaCKobylmF1SE/hgpvNYXY+ZF2jHSCFOwIBLY2KkYUNaVQL1ArWQ==; 25:88Oo7UmiwGYsl5eVV2t664MdsRmodO4/7Ufmjuxl4y8hmyCtiVuLCPzAq6p+XnMBLThOUQ7RcRvv9KlqifiVamuOpSP+KeQGDE3xNr63Ymukp/S0QJ301gOHwDf8BarO6OnTVqdt9Ah+RoYN86rASYowF435jY2RIPLtsNTFExNRQkt+Pa+IS6eR7hBwkZzhr5EPWC8pp/jIeEyXqhXmbLC+5uVFJrOwx4dl55V86KyCOHpkjDMlmZR+aenPpFA5cOUnGmTOJAfGMPQbtLmAvxyNE2eEgjCFb4nfb4rnykppgAHwAHhnx5xPeGOQr3mttWOhugFyZg3Fna/6ZwcKQV/F+aBq0CNB2BJvMW6pd3itlFAMU2YmJ7JYmu2gahv5x8WznechIM3qqM6oK/mBwn7SNdxqJBG3mB34SH2ocA7yOpM9PItXX3k7MlwHiqUbI2dC30OixvC7oji64TVHAQ== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:njSAvySX0kV3qxZQp6eRar1zhGagJ69R+FjgCJoOgTn3BWfbIlUKuSESu3mpZGVknQLrRtKUF6/RfXR9gjg9CAWR92nM4z5r9ep1Lrx2sq80pkyTrQKGSL+Wjb2AnUiwnM9CD6wObzGSp2Wlez0Bl1twsryARzRoFhd6WqEHOq0rMHzMANHcRuSDmoZRJwOyevZKtr/p78d6HEck/5urSRgiv/Mct1u6ZSA+8ykf4vI=; 20:+HCH7kVOT/QtDfKAGrvZ1JhUYKFPFE9hBvd1p03FlqSKraaysInloyamUc2g663LHwDGSik96jnUI01QZUrx09FWboeMd68qZQ4abR29SouV9qSNeIHwieH0DhFGAzTAujf2W2/x/D92lqYcYv+9KkA2g4a52v6NY5VVgKzHLDH4ZEaSQxeknXISsQ/zFOTPnvp4YlWSGeuQRMSIdaCWcwj1GYGQJBE684nvbidt8DDvvU3K0k3mO5A4Dc8rL2jXjtJrjw8/nbjBcBbiSuyzBKo8Njz2dcBZY5kxst8LG/Vq4VGP8mIiWQ0/whUhNpCaCuhAdrm7sztCTVJhIJIURp9oN0ujkqWCi7OXFwIevHnwgCZ6yQuHHbQ+kmaIimyip8xUDb2JWZQREXKWD8c7jBQa8z1QhEvExI/phUn9qFGTEgjVjJLz4SyjxeKxKM3PWd6ZSaYBZYtaDYKwbvW+RwLgZM+2M2MbKjtf+j8waFXKVLYRFPfuPzbVWs9oQdPxMNJNWoQZTvvP729FruNJdvYfgFv14/Aqm44u4IqDOsqVUf5dpEcFyxw/ykG2HKI2SGoV7x6AaiA6RFGvI2b93E1OWv/dZF0pN/4k14k4mYs= 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:UxIoYLbHv8V99yDVt1eZCVJmcjardXZ47BfvWYxjx7jtD0N3i1vcGMvEH0rF3hXPgKT40NHovInYXcFWJeh2gHPYcRjXpkpYDN0Ml45xSjW/34LlaTCFVcqA1aRTvmQP9UCtWJde6/uxTwwl+T8fzNp/DoU7iT+yKrTs7CT4IEDoX0IC0NO24GrxvRx3SAlwb63QLxC5q3nA3CeoGxy2sQrDxuYgvEsCJArtNS7qB7ux81dWJgYaMeFdd71LCNdZ6QuZqTvvdIKxWPxz/MVYwOPal+1z9KHxvqakt5eKpMN69RyKkoz7eR6cAHytN7eTGxWlzsdkjRqO6PaF7fPJkdyqt3mI1+IeX90PdxmWVasgZhRIDFMZ8lg6302kjVc5Fx9MYbhik2Q+QvjF9nG/5M8U5+ybKzkejrbfyF1JU+p2Idw/tj4ECLXIJvmAqwLd38i6ODM4TakpFmKp1JpWV/02rIDKk9B/PiRnbUgQ0h7redXZCRY+aHANwoiXI98I+Y1v6vpXzg+OwqLu9KgM7dcW9W++0bVa8lc6AHstZtfizPgbYlErGQP+ruBXGwGkzdDY2cP7SARyi/0ZwCHfQdqxkvQDy4KlxPpdNo7HW9s= 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)(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-Diagnostics: =?us-ascii?Q?1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WarrxKRcvS0xnCDrU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:OIFfIIuzxx8LrXsdVbxNiAftbRD6t0TWc6UnMwRNb7xYDpaU7YhmszQmidNisd/UUTEwM5D4ousVH5u3Y30IUclVSBV+wzjlj7nUalcISab6iK4K3xpL5OuFIH23ucwsOoXOTjf5VRow2THVHpfZNugaQsUDlwa2FHFGsFll0qQMSjoTcJUf72vRmptzHrrlw8j5XZ+U0eKeyeoM+iHK+kGgU8Uv3PVfLyHonwlefJYDwfTQMUeGH8f75Z0FcZegRN7GMyJDpG9exJBKGyW2N4PJx/3L5ffD07AiN8Df7Xyj2EZkx6fPeEicxj4wDuVxq2r9+BU/lNSnnsuSbk2U/Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:05.6103 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 18/39] 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, 03 Mar 2017 17:30:10 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla --- 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 8a96076..7ec78b4 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -138,3 +138,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