From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0085.outbound.protection.outlook.com [104.47.34.85]) by dpdk.org (Postfix) with ESMTP id AF4A51BA59 for ; Mon, 9 Apr 2018 23:01:46 +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=9KPcy1uyKu/hpT5aHovWNi3DgR2lZLiw537X5RKI1ak=; b=IdPTPOBVPr/bEVbCL8PxyW7DC0Vg0SjL8h48gp6o3ZzDg+uq/VUVu5ttfwLoiZmvHwCOkmn71aUUiE4BFLMsnCjbT80n0BBvdebwIWoXp5njcP/pJ3KBfoUxLl7wtW7dlV0cKCgibascv4GdB+vLlkCUyXFXQOxs/kp+UbxHGwY= 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:43 +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:34 +0530 Message-Id: <20180409210035.23278-11-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: 1e02f193-190f-481c-0843-08d59e5d1a5a 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:rErXPoOU5nkhjsdHFkpjPDd18zyF3acbcZKphe0ngHeUM45uNSfRCMXwqxg08ARRmsbs9opA2VAvgQKHq4FKRX9TgIkhz4vlp7xyOB6pGUQTxGXNbEhCGYeEN3Qej6bae9wbhQFO3BQjnnsm9q43sfXQDDqid0EiRyQ6BniySBcJ63ywFpaOVAa83S/fdb1Q/QQvvk6VXcSiI9xuUCw2HumW6OP6ji/erE5LHnqGezwQps4HesjWHPHOBDQ+GSq+; 25:EswQ2hVkh27ikvscau4p9ZKv1QIv7QXu8vcdfcbwu/7EmuJhKtY1hMfwGZuM5Cc/HgjXUHonybvr4VWdWg1ngx6tg5KpzIoWuIJbxqjF21jb+CPUkNIU+GHLCa1yLWc4g5m5oZlU2reSuhv7di+9IY9vg3u2Bt389F0MjjpQwzTgR4eSu8o3tQUMh3w33vdflSeg+RMlWbLQ6tJI7zIwwzBBogTtw1kwHd+uJTHPhwGeHU8Fo3rGeHxgli2Q1pQfOtp/zTtCyVGevmm6KDNeQHKXUkj8pqbYDTUAErMLrSmNUgoVQaSwnOF+RuG1QytJWRRuLvph8LRyopr5BUIkRA==; 31:FA6a2kZAPrxRYLKsFCZxVoRQOwouGHeSOPhIGFqNdFRt86pxdmMhAnPG+XSH6CdEugO6i6kH8wBCZAjHsDq3uX4mydTIf1fnXu6mrHkJUptyu5pleoYhIqphA0MEdzkJ/fJkQAL5j77syuV9D6E/tZKg8uG8EwAfYNX8+EXyx1eFDm5S2fF9rGjI+nKGDjM0BFpUdMUds2IvKAIA54UgKDzjVRAftv7nPGTYiKH5Rm0= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:8cBhWepZ9zA53t/Lq/lMQpk1mOzFin9zbyZCcZa1Wocu/bBRSxleGQNzLnpWbwnhOoRMwY8WveJJUfnR9BnMitu05gKQo4ixbz07hB9ufJ99+CpAWtzE5c4yYCYNKLGXFZIQnGhbus/kWZ5OYoebH/9bxtP0vvhENjP9s/6uiV/6hFttdxjly9Zj5m6mfms1OyiTX1euhlnANPGxJWAAFpxQuniodHkE1udnPGC10g+YyNQnuD4bBxBlPITNLrLOAr7HjvGTLWyoxxMbbPrsyU/OgH1DrmzKIVa+YSSrTh2iyZz28u4txXwFKsmv1PQCt6K9U5FOg+PXfIE1a9x49qjDaGG30wA29dRbxqN2rYtgHTeYwBQLI0GDgpdS8lvHmDmDPv4P91KPncGEMXqZ22kjW96QvJC5CDquLlWDtuur5/qwxlV68SOZbW8ml579Vl6wfoJ6vXmG9d8YKV6jbqKs5sXC7MumVp2/H0tl7lkV3zzSON4sg/k/Kp2f1oyRPe5uEorbus2hsHWvgdPnatglzdTHAX5si6aCOn1gamEY53b7poor2wGb1qoRtRdeUqiORfY7bFv2ZEPtMLQawr52vFnV1UF/GgULuwIrtaE=; 4:UPJv/cLQ8Ju/9x7lWkd4wwkGGQ0v1mMWpuS8Cx5oUAp0tARYP47LxAmptv3sE+jvVSCIjBx0gAYx+L1G9qNIEcmd5SyajsbtjKZ/hfDCV1fncI3I+tLxw/Br8dEZx8zpHkS1B6uME7WyVfwiIJ3PY91ZotZynCDluIEBzWCd+bhfziT8fg63JeZ/G2a5sYWGR7JoL6wvvTsdIx9RuZvttkfGkzET80Gp2Qls6HCU3LfJ7PUzNP6s/I+2AxOkWKWTtFB4McbnX69iF1lq0YmsbA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-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)(6069001)(366004)(376002)(346002)(39860400002)(396003)(39380400002)(189003)(199004)(107886003)(48376002)(446003)(1857600001)(50466002)(97736004)(66066001)(2906002)(53936002)(6512007)(42882007)(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); 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:tsvCPGJhvLiAup1gv5oi9/vHemMZJHJsjUxhGNINq?= =?us-ascii?Q?aeYIEG+RK/8/smiuNw9G8nL+WuYOBCibMJedhzO89AVkK4L3kJMmqFkX50Ch?= =?us-ascii?Q?KWIlLE+sVSLe6Uv9yaYU5Cs43WjNXUfqolke8kgKlDQWRAcEdbcLpiyRx8VV?= =?us-ascii?Q?cOtTnnLs0ygJV0B5oSmNR7182jux+UbYh9Aifvq5pNOb0uF3SBQCGZ4M0L5u?= =?us-ascii?Q?FaN5pxcf7KyFI+er0MO6bo5glT1a2VrgXGM9hCfbkS9kCSoueHZmsSQ+/d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9t/Z5hfwVu3PvAQ=; 24:oVn+UWrYbEMpddXRBd8x+u4Jn+WNQuQ/vinVwUdHDCYXBqBqSYMup2mecm/02KyanILls95eG5g4Ocn5IT6mRPaTeMaDzG4Q+v1yPo+iN3E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 7:vxF4OlBvWIn1kL7jcDsvRu7Bq4w0hI9ZHxySy9xkKDrICt9/270qMx8yQtdkePzBQqc+iGxCF81VfMafPvUDZbLUDdv/Hu09X80vVqOg6k0ncWn6N3Y6NnT1ss1NhUrdTP9OohFre0uLWROXrLS0maXcF+B6LJxIxd/qKkXdLjXk8Uhnvvm+pDUHCfhd6Cc6i6gJUiR2eLvQR5eVzq1BCdHRPYwb+yyxLXOl8BahcYhXuWDBrjdtCja9trGxWeGi X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 21:01:43.4517 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e02f193-190f-481c-0843-08d59e5d1a5a 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 10/11] event/octeontx: add option to use fpavf as chunk pool 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:47 -0000 Add compile-time configurable option to force TIMvf to use Octeontx FPAvf pool manager as its chunk pool. When FPAvf is used as pool manager the TIMvf automatically frees the chunks to FPAvf through gpool-id. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/timvf_evdev.c | 22 +++++++++++++++++++++- drivers/event/octeontx/timvf_evdev.h | 3 ++- drivers/event/octeontx/timvf_worker.c | 7 +++++-- drivers/event/octeontx/timvf_worker.h | 22 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index d6a8bb355..b20a2f1f5 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -125,7 +125,9 @@ static int timvf_ring_start(const struct rte_event_timer_adapter *adptr) { int ret; + uint8_t use_fpa = 0; uint64_t interval; + uintptr_t pool; struct timvf_ctrl_reg rctrl; struct timvf_mbox_dev_info dinfo; struct timvf_ring *timr = adptr->data->adapter_priv; @@ -155,6 +157,9 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr) return -EINVAL; } + if (!strcmp(rte_mbuf_best_mempool_ops(), "octeontx_fpavf")) + use_fpa = 1; + /*CTRL0 register.*/ rctrl.rctrl0 = interval; @@ -167,9 +172,24 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr) rctrl.rctrl2 = (uint64_t)(TIM_CHUNK_SIZE / 16) << 40; + if (use_fpa) { + pool = (uintptr_t)((struct rte_mempool *) + timr->chunk_pool)->pool_id; + ret = octeontx_fpa_bufpool_gpool(pool); + if (ret < 0) { + timvf_log_dbg("Unable to get gaura id"); + ret = -ENOMEM; + goto error; + } + timvf_write64((uint64_t)ret, + (uint8_t *)timr->vbar0 + TIM_VRING_AURA); + } else { + rctrl.rctrl1 |= 1ull << 43 /* ENA_DFB (Enable don't free) */; + } + timvf_write64((uintptr_t)timr->bkt, (uint8_t *)timr->vbar0 + TIM_VRING_BASE); - timvf_set_chunk_refill(timr); + timvf_set_chunk_refill(timr, use_fpa); if (timvf_ring_conf_set(&rctrl, timr->tim_ring_id)) { ret = -EACCES; goto error; diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h index b3fc343af..b1b2a8464 100644 --- a/drivers/event/octeontx/timvf_evdev.h +++ b/drivers/event/octeontx/timvf_evdev.h @@ -25,6 +25,7 @@ #include #include +#include #define timvf_log(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \ @@ -220,6 +221,6 @@ uint16_t timvf_timer_arm_tmo_brst_stats( const struct rte_event_timer_adapter *adptr, struct rte_event_timer **tim, const uint64_t timeout_tick, const uint16_t nb_timers); -void timvf_set_chunk_refill(struct timvf_ring * const timr); +void timvf_set_chunk_refill(struct timvf_ring * const timr, uint8_t use_fpa); #endif /* __TIMVF_EVDEV_H__ */ diff --git a/drivers/event/octeontx/timvf_worker.c b/drivers/event/octeontx/timvf_worker.c index 02e17b6f5..e681bc6b8 100644 --- a/drivers/event/octeontx/timvf_worker.c +++ b/drivers/event/octeontx/timvf_worker.c @@ -191,7 +191,10 @@ timvf_timer_arm_tmo_brst_stats(const struct rte_event_timer_adapter *adptr, } void -timvf_set_chunk_refill(struct timvf_ring * const timr) +timvf_set_chunk_refill(struct timvf_ring * const timr, uint8_t use_fpa) { - timr->refill_chunk = timvf_refill_chunk_generic; + if (use_fpa) + timr->refill_chunk = timvf_refill_chunk_fpa; + else + timr->refill_chunk = timvf_refill_chunk_generic; } diff --git a/drivers/event/octeontx/timvf_worker.h b/drivers/event/octeontx/timvf_worker.h index 93254cd39..dede1a4a4 100644 --- a/drivers/event/octeontx/timvf_worker.h +++ b/drivers/event/octeontx/timvf_worker.h @@ -213,6 +213,28 @@ timvf_refill_chunk_generic(struct tim_mem_bucket * const bkt, return chunk; } +static inline struct tim_mem_entry * +timvf_refill_chunk_fpa(struct tim_mem_bucket * const bkt, + struct timvf_ring * const timr) +{ + struct tim_mem_entry *chunk; + + if (unlikely(rte_mempool_get(timr->chunk_pool, (void **)&chunk))) + return NULL; + + *(uint64_t *)(chunk + nb_chunk_slots) = 0; + if (bkt->nb_entry) { + *(uint64_t *)(((struct tim_mem_entry *)(uintptr_t) + bkt->current_chunk) + + nb_chunk_slots) = + (uintptr_t) chunk; + } else { + bkt->first_chunk = (uintptr_t) chunk; + } + + return chunk; +} + static inline struct tim_mem_bucket * timvf_get_target_bucket(struct timvf_ring * const timr, const uint32_t rel_bkt) { -- 2.17.0