From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0083.outbound.protection.outlook.com [104.47.34.83]) by dpdk.org (Postfix) with ESMTP id 006091BA38 for ; Mon, 9 Apr 2018 23:01:38 +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=jdClyWlXt4Cqd1TSZK0iITCxoQq7cc3YKWhA2OdfTvQ=; b=dBVsfvdJLrM3lHF1PC9QFBPQOgOPi6zAnHJ133nD1Y2j48MGL4VHDSAoQrruHCkkcJekL2+Hma7JGrUGnxhOf4i69oHPTRENT54Ug4vSh+w63AVecA5FPHVGj6mjl6xF1ZuK079rS+hXysnQC4a1+DR1kXIspG/v3GjeYm5y+4c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by MWHPR07MB3470.namprd07.prod.outlook.com (2603:10b6:301:63::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Mon, 9 Apr 2018 21:01:35 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 10 Apr 2018 02:30:31 +0530 Message-Id: <20180409210035.23278-8-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180409210035.23278-1-pbhagavatula@caviumnetworks.com> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180409210035.23278-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0088.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::28) To MWHPR07MB3470.namprd07.prod.outlook.com (2603:10b6:301:63::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28c194bd-7db6-49fa-0d6f-08d59e5d1587 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:MWHPR07MB3470; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 3:rSYx0WgFRq9VZGemJyHKCT+cdhQboWvMLj4dzhRlHjDNZUX40pO0SayHmhcie5DKeBUcl7IOu6AzoNMYpDsLPKuwqOFllPlZnuR3zvyIWxDHKUBEIAoxuHqO6cTKRaK4QkiriEIzU6mIy1nowIKcRO9dcJw0yec/6XrS6KJyKAdxN5t/7W6S99Q94SwcWg85n1S6OsHo/nTpAIu7VfDqian4X0xhwSJlntkOPic7lTJWmixN8NK4c/hQkp6c6hMo; 25:dn8Ija3+G7tPO6iPrfySHNSOnj1adpk1cOc+eZKbfm50PLMSEMxvjjFPCdEtjA7jQqJKi4h9qa4HtK5MPV2y0tTsvFbNlTUcnWyVEU4tjhNC8+1CL5r3CoGmwTrfnmp4wyPDOLDINmEh2NUBvKr6S2kNnGuzPE5iw5yZnhgG4LwuIM4TdyJtZr1Pvr9eyyMxYa/eH0eyG3qMa9rdXHaVVhVzoOD1MOje+6tAAVcihXXdeVZECYjoRfFlf6GnEbquwRo0Zp4B4yn4Va74/4y6vS8UVrYhZVLzka/ZsIy3gt6pyqwgO4p6WDDTLTuSZcbFcabU4eWEtL0eMhJZRslImQ==; 31:h58cnQzUWl7qkDeC9OVQf7icsFQ6m0oITdfbNyXl8AkBUaGGYxp0d+gm2tZj3ppuI8O3NaBye6Q2jj+fo5kaKkfDXHcEXY5+cRLnX2Ve5skY/p1kh0eSgArvSTo0jDe8ECsPVKRyrLTf/bHoB3aCJAC/PG/8IvHFdiKhLfOXLFEbK+XaNbuHrkytaxESKOc/P0i+K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antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501327)(52105095)(3002001)(10201501046)(93006095)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3470; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6069001)(366004)(376002)(346002)(39860400002)(396003)(39380400002)(189003)(199004)(107886003)(48376002)(446003)(1857600001)(50466002)(97736004)(575784001)(66066001)(2906002)(53936002)(6512007)(42882007)(59450400001)(81166006)(956004)(81156014)(25786009)(16526019)(6116002)(2616005)(476003)(5660300001)(6486002)(3846002)(11346002)(8936002)(26005)(50226002)(8676002)(486006)(47776003)(1076002)(6666003)(478600001)(105586002)(76176011)(68736007)(72206003)(7736002)(106356001)(5009440100003)(305945005)(4326008)(6506007)(316002)(16586007)(386003)(51416003)(52116002)(36756003)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3470; 23:H4pIZzCQL6kU25hAJyFhdHHDJQ7WYKvAaYG998HqB?= =?us-ascii?Q?a6mE1cosESS1iWprdpgi1I7fmyavK0aMkkySapQc5fTzgW8SG87R0mJFxIFK?= =?us-ascii?Q?faJud0xIi39acOqQhUiNbyvJnxgxIWL+A90EeYH00g2s2qytw1Iw4og7PgRx?= =?us-ascii?Q?Z1wyzoD4Tt1D8F/G76aOj95+mTj2enB0acwcTylmnJJ6HvCmdwjtx1G2hi51?= =?us-ascii?Q?DZXS80ULL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8QFGTcdd9jz?= =?us-ascii?Q?xXmMBLcvEKFH7ToylaAZD3oEiYXICfRL8B6AJz5QTBkOMkomsXwLVLzYsygZ?= =?us-ascii?Q?+3mZpSUgjA3puA8TnXrY6A1s1FHsvR//cb5pjjC3AQYwL9PIIDQtSxv1Ehrj?= =?us-ascii?Q?ny0EEWC+dXnIQMGamGmbkoUbCAq+lCttppKLWa11rnIgozRXoUIlTZqJb8NE?= =?us-ascii?Q?1KTRv/4dibiw1pJHBQ9p7zsD/RbsCGlBc3QavZzgFd4P6KJURgDydkISkw2J?= =?us-ascii?Q?1cYmM9snIGZEyzNejBr6YombZXR5M8JzC7j1cWfesYM/Lflq8QRbnIJvv1If?= =?us-ascii?Q?nF2HcgBKOovjCRwN5NPqOGB+ypIfkY=3D?= X-Microsoft-Antispam-Message-Info: kPho+ztnj9ewYTCTF462R1JaWqAs3w437aEgK4JHERae49n0A37lXM1Pq+A6lfSyMFYgSg2Pv+S7FgcjsxPiQP46dnrr0kpq//Qm9R5VfkW8xsqbpX3hjji2VZ+xiTcnc8Os8wQF+HPM2vrGKPqJJTgj1E8Fkg8oN5NvOAnLMQHYlXN/SmeGEfnuSJ+iHnx/ X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 6:fPMz4ZrUeO865dKd9oZoLhGkhUmU4Rk75weo70qMKYDGb2PWVrA7Yumwv5quxFPREzwh6rqloz0IvNRo37wW550IkpSYQyw65dMshn1Fw0xuuIpkaWW814FK461rtiMzmBUcGIFhlVP5087KWtNIraJJao0nMukKFLXPPst2TBZn1hyZu7Tf4a6LcH/iZ0kU97JNwF2hVivOu8e5LZC5fxc89tWZ+1vpCN1l0nQ8UoF8XEYhjIskO7m5cZriIFhnGhi6AE1l8JgmQ9aL6hCxTlVzEHK/Hj7xARtAzEcK3PiNOhro3zEhWzBaNKNxvjo3m4xE/HPqiguE60H0Uql6Y/HoT8OFv+/VSl5Beqt322Ui71yOdOLD6EbqSpchOgJJbwgqwkOOMVuBVGWflKtbWvUMO28MmXi8DEJBZd20A4YZP2hJt1YF9QhGhOuFPDGLekYZtMtBfULn2tiHFzzE2A==; 5:9NznXOXjqdQ0wI5ZYc2e2NVQW7BhJz8Y/mH3pB2BfhmwPyqBm9vQwgKsciWSmwIOqj3+Q/V6ha7Ls2Bs1ucRAp+BE1UqB3d9+I5RqezCVbpviaBSw3Aewg06VFvX4zUxbrhvinlIryjBveOU/ljP0GIVByy1qq/Ladw01s/joew=; 24:/VB28opfcONjj/rBxUCNd6sFFGFu3hQiO1yJIfFHo/q0iDAjh0gr5XIgjfO2gS/oOBsFYTVSl9uvBaBICrMJN0Q5We3JqAP1XZJIyi2VdaU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 7:HXPR3HCTsX3vQkErN2OsNLcPfKx2WD81lLNI6Ksj6u53+M/0AefayuqkBx5uYs9lCN3SIxUCOmsBz8eIg4p+IgJBhjcZKxx/coK8J+xThLQCFNlPPT2ca/awLlmTlonQy2cKG9UaMDBmQWq7no6SqnbxcYMR94VlW37gxm9fZBunVD17/vjlsnpzsyc/4GkPMgZGNVpbZB5y6tONwBeYsXkzP3tXof9m7q8lV+pDkvw4e+B5BCvjb2lOuP+QbtgT X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 21:01:35.3113 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28c194bd-7db6-49fa-0d6f-08d59e5d1587 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3470 Subject: [dpdk-dev] [PATCH v4 07/11] event/octeontx: add single producer timer arm variant 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: Mon, 09 Apr 2018 21:01:39 -0000 When application creates the timer adapter by passing `RTE_EVENT_TIMER_ADAPTER_F_SP_PUT` flag, we can optimize the arm sequence by removing the locking overhead. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/timvf_evdev.c | 19 ++++++++--- drivers/event/octeontx/timvf_evdev.h | 5 +++ drivers/event/octeontx/timvf_worker.c | 37 +++++++++++++++++++++ drivers/event/octeontx/timvf_worker.h | 47 +++++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 5 deletions(-) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index 5ffb460a8..3b698b7c8 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -180,6 +180,7 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) struct timvf_ring *timr; struct timvf_info tinfo; const char *mempool_ops; + unsigned int mp_flags = 0; if (timvf_info(&tinfo) < 0) return -ENODEV; @@ -213,6 +214,11 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) timr->nb_chunks = nb_timers / nb_chunk_slots; + if (rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) { + mp_flags = MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET; + timvf_log_info("Using single producer mode"); + } + timr->bkt = rte_zmalloc("octeontx_timvf_bucket", (timr->nb_bkts) * sizeof(struct tim_mem_bucket), 0); @@ -222,7 +228,7 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) snprintf(pool_name, 30, "timvf_chunk_pool%d", timr->tim_ring_id); timr->chunk_pool = (void *)rte_mempool_create_empty(pool_name, timr->nb_chunks, TIM_CHUNK_SIZE, 0, 0, rte_socket_id(), - 0); + mp_flags); if (!timr->chunk_pool) { rte_free(timr->bkt); @@ -306,17 +312,20 @@ timvf_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags, uint8_t enable_stats) { RTE_SET_USED(dev); - RTE_SET_USED(flags); if (enable_stats) { timvf_ops.stats_get = timvf_stats_get; timvf_ops.stats_reset = timvf_stats_reset; } - if (enable_stats) - timvf_ops.arm_burst = timvf_timer_arm_burst_mp_stats; + if (flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) + timvf_ops.arm_burst = enable_stats ? + timvf_timer_arm_burst_sp_stats : + timvf_timer_arm_burst_sp; else - timvf_ops.arm_burst = timvf_timer_arm_burst_mp; + timvf_ops.arm_burst = enable_stats ? + timvf_timer_arm_burst_mp_stats : + timvf_timer_arm_burst_mp; timvf_ops.cancel_burst = timvf_timer_cancel_burst; *caps = RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT; diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h index cae949c73..01ffac09a 100644 --- a/drivers/event/octeontx/timvf_evdev.h +++ b/drivers/event/octeontx/timvf_evdev.h @@ -197,6 +197,11 @@ int timvf_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags, uint8_t enable_stats); uint16_t timvf_timer_cancel_burst(const struct rte_event_timer_adapter *adptr, struct rte_event_timer **tim, const uint16_t nb_timers); +uint16_t timvf_timer_arm_burst_sp(const struct rte_event_timer_adapter *adptr, + struct rte_event_timer **tim, const uint16_t nb_timers); +uint16_t timvf_timer_arm_burst_sp_stats( + const struct rte_event_timer_adapter *adptr, + struct rte_event_timer **tim, const uint16_t nb_timers); uint16_t timvf_timer_arm_burst_mp(const struct rte_event_timer_adapter *adptr, struct rte_event_timer **tim, const uint16_t nb_timers); uint16_t timvf_timer_arm_burst_mp_stats( diff --git a/drivers/event/octeontx/timvf_worker.c b/drivers/event/octeontx/timvf_worker.c index 38b16d1ce..52b212c44 100644 --- a/drivers/event/octeontx/timvf_worker.c +++ b/drivers/event/octeontx/timvf_worker.c @@ -64,6 +64,43 @@ timvf_timer_cancel_burst(const struct rte_event_timer_adapter *adptr, return index; } +uint16_t +timvf_timer_arm_burst_sp(const struct rte_event_timer_adapter *adptr, + struct rte_event_timer **tim, const uint16_t nb_timers) +{ + int ret; + uint16_t index; + struct tim_mem_entry entry; + struct timvf_ring *timr = adptr->data->adapter_priv; + for (index = 0; index < nb_timers; index++) { + if (timvf_timer_reg_checks(timr, tim[index])) + break; + + timvf_format_event(tim[index], &entry); + ret = timvf_add_entry_sp(timr, tim[index]->timeout_ticks, + tim[index], &entry); + if (unlikely(ret)) { + rte_errno = -ret; + break; + } + } + + return index; +} + +uint16_t +timvf_timer_arm_burst_sp_stats(const struct rte_event_timer_adapter *adptr, + struct rte_event_timer **tim, const uint16_t nb_timers) +{ + uint16_t ret; + struct timvf_ring *timr = adptr->data->adapter_priv; + + ret = timvf_timer_arm_burst_sp(adptr, tim, nb_timers); + timr->tim_arm_cnt += ret; + + return ret; +} + uint16_t timvf_timer_arm_burst_mp(const struct rte_event_timer_adapter *adptr, struct rte_event_timer **tim, const uint16_t nb_timers) diff --git a/drivers/event/octeontx/timvf_worker.h b/drivers/event/octeontx/timvf_worker.h index c20d4d0cd..c3a669de9 100644 --- a/drivers/event/octeontx/timvf_worker.h +++ b/drivers/event/octeontx/timvf_worker.h @@ -224,6 +224,53 @@ timvf_get_target_bucket(struct timvf_ring * const timr, const uint32_t rel_bkt) return &timr->bkt[tbkt_id]; } +/* Single producer functions. */ +static inline int +timvf_add_entry_sp(struct timvf_ring * const timr, const uint32_t rel_bkt, + struct rte_event_timer * const tim, + const struct tim_mem_entry * const pent) +{ + int16_t rem; + uint64_t lock_sema; + struct tim_mem_bucket *bkt; + struct tim_mem_entry *chunk; + + + bkt = timvf_get_target_bucket(timr, rel_bkt); +__retry: + /*Get Bucket sema*/ + lock_sema = timr_bkt_fetch_sema(bkt); + /* Bucket related checks. */ + if (unlikely(timr_bkt_get_hbt(lock_sema))) + goto __retry; + + /* Insert the work. */ + rem = timr_bkt_fetch_rem(lock_sema); + + if (!rem) { + chunk = timr->refill_chunk(bkt, timr); + if (unlikely(chunk == NULL)) { + timr_bkt_set_rem(bkt, 0); + tim->impl_opaque[0] = tim->impl_opaque[1] = 0; + tim->state = RTE_EVENT_TIMER_ERROR; + return -ENOMEM; + } + bkt->current_chunk = (uintptr_t) chunk; + timr_bkt_set_rem(bkt, nb_chunk_slots - 1); + } else { + chunk = (struct tim_mem_entry *)(uintptr_t)bkt->current_chunk; + chunk += nb_chunk_slots - rem; + } + /* Copy work entry. */ + *chunk = *pent; + timr_bkt_inc_nent(bkt); + + tim->impl_opaque[0] = (uintptr_t)chunk; + tim->impl_opaque[1] = (uintptr_t)bkt; + tim->state = RTE_EVENT_TIMER_ARMED; + return 0; +} + /* Multi producer functions. */ static inline int timvf_add_entry_mp(struct timvf_ring * const timr, const uint32_t rel_bkt, -- 2.17.0