From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0057.outbound.protection.outlook.com [104.47.34.57]) by dpdk.org (Postfix) with ESMTP id D69B31B791 for ; Tue, 3 Apr 2018 17:05:53 +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=ooHt6+XOPw1DQcidCdA9MrxQF6vN2WYU7ud/rHm1rSk=; b=NiMfVW7QfJYpCY8PyZzgDO0xXmL9cagjJTOb4VGqNBsryPihQ2ppIVgudJqTlO1IzSJfPnB//e54QGKdogHCYMDzchqcFJ0CH1Vtd2UWvwMgSc8YKMmNtJd8x/4sVFx5gsDIMJQupyte/8uy3TBjMNBuc8MfpwK4ofD8G+i/wwE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from ltp-pvn.caveonetworks.com (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.631.10; Tue, 3 Apr 2018 15:05:50 +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, 3 Apr 2018 20:35:06 +0530 Message-Id: <20180403150514.24201-5-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR0101CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::32) To MWHPR07MB3470.namprd07.prod.outlook.com (2603:10b6:301:63::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6d21803-bce5-41cc-9f2c-08d599746492 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:EPMmhuJX3kdBVWWsy43AntJSASO0fkXl4i1yfJRv4BKtFnM7IrUD75nFqjELklCOCDwG0CWUIrfeRAN0IeiRWuqFPmZqSo8mMlOgFwZy77rS8vN5AmTwIwyGeNTp6JjtcXZiGN9Q9sQzi4C4fjY8j7Cb2MZP9gUcYh/wN9Xv2othdpE13BYIkZu8GUUcfMKQsIsZIxxJs7BtdobdEYb79YPOEXmtNz1aheGDFy9VQhvDtEq1obZiooXjVVbOY6hz; 25:fuW0Iz31EfzSquKIi/YJgdw44PfxBccMPUmqTNPpS5m285GPYZosRFPCv8YU37MwvJrGiZUUisAhb2mNn6/mMGpfXB7J/Y14WABxJ4UzHbjp3QbSjWjUDybOP+ouGUZJ61Ty/Vr1kvfYpcanEHDIuE2i0JNNiZkn/HeR8O7p2FSOmsHHNfvjQNwjAoSmGe+RWz2Z9Ws8hoObcVF4r2NeFSzYr+y61eGgl44FqSKUAuAKX2v6oHf+GQ7SicewN3MHLKVkjNTApBr8F13PyZmIifZvZnVurg1S/HNk2W+yJoTAod3vhtnb0DPcefAcryXERWyrLJwMFx8OnoSNxDH7gw==; 31:M5m3etv2XgmD7XCSIZgWAexMbMBPG7ZPV15pBpP2DlrVcNE4y+tyTFKBb2/dhJ8XxgHh0CBKgfIEt3FnHtgXaiDxA4Dnd8E4kGowhp1i8HgWv1VB6cOMmNidXXAV3Y3l7nF8xRhP+Zqsgop43azS/0ChuSEv5NP5IVBhp7yIHgiYezoSsHdK9Am2IGl22ny1NC+tMubSkWo84+za+baC0w8jFbDa+i2MvY6mzD1Ex2U= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:BzVwtEZeU8dUfg69ytGVwrDc4n3fPiOT27F+0234igK9W2tm8sFqg5QgbU+NMliuQAnDmCXjITH4rtuylOnSmortsJF5zAtTlC/DR+Z3uwIVt82XjzmUlpccAVFYku+923GcrQusB5Fs8Ruv0RAp6VwEowbXDnPVzME2vOBLyX8v9i6sRrHOXIQniJn4z1PXHSKgp6jEJ6LOx5ETE6OrkqPc4aBtM3XY5q7moZ6S145L/iwvdPrNzfVj++df2QcwxEKLX43ImM6UH5Tg6lFgH34tuZdSc7moD0Ug/tv2XZDCQa7XpPLVkTflptKx20kHfafM6AuiciPEi+KYnn0BkZlUCSE0EeUKFAWCr/PIhywej4l8oRsg2FNocKQN5bov7qOjRu8QoA4TDxiSoS8+ZFQKmet15ewPbzlLgWFyR52K7d9HBKbNfftfsTGS4+Y4CowOd24wh5fyFtox27iFeYjiJchZv1JEVI50kCQ9bgADXm7AL7JrfSssdNvxU9sjdN+OGGDMgTuzwufpnlPIA+x1IAD7t8e/Q+R6wqwRljqUcG3xs3k69dXrtxxh3/iUqFcRBC1BY3+jPmrPrBhdJX+4TbKXrztvXws+PVKOrkQ=; 4:dNZqjr2mwvZmnHGiuNetevuzMTkPy8cwcY2QMzB5WCp5v4WDQYUfu6WfFJ2K0zwdwTHb/fMMIrUhELC5jonk8aaWN/J3Jih5R/NfUjcoDBUAXZV0sVlaAxXWZbGlZDFxT/zUqwF2t0EM6xDEofBUmDbkwpx+msMZ9+plhBugAi1j8PcupM7JObA1AbmlPBTW9PMkPnH6QIgkbRveJdCgzJrxdkjuJy2vLn+H0+C46xkY4R+wj6zlYedy5tvxUZ5itRyFrRQtKmZ9QuMXTlo8mQ== 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)(10201501046)(3002001)(93006095)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3470; X-Forefront-PRVS: 0631F0BC3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(346002)(39850400004)(376002)(366004)(189003)(199004)(47776003)(305945005)(66066001)(72206003)(386003)(6506007)(16586007)(478600001)(316002)(48376002)(7736002)(76176011)(59450400001)(36756003)(52116002)(51416003)(5009440100003)(50466002)(68736007)(106356001)(4326008)(25786009)(486005)(476003)(2906002)(107886003)(6512007)(11346002)(6116002)(2616005)(53416004)(26005)(16526019)(5660300001)(6486002)(3846002)(1076002)(81166006)(81156014)(446003)(956004)(486005)(69596002)(8676002)(6666003)(97736004)(42882007)(50226002)(105586002)(8936002)(1857600001)(53936002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:ltp-pvn.caveonetworks.com; 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:SoYmQm7gr0qPdRlv1vZD4E9Qae3Yd+u/YoyiI0f1x?= =?us-ascii?Q?Dn/ukR2fp5qE0V42WOFSI71QnkpZnywuGe6gbC85jwTTM8AGctg3Si7eJS+U?= =?us-ascii?Q?+UDF9YnzQqkIk2o4MsG2QEPRevNGhcpHaS7DJLm+X1nKz6wGx/Z/B8UPToij?= =?us-ascii?Q?SsOq9bRF4syFzNAmNlCuLJ6YKwvUc6+lifFCAHJIr4SMPLC8c2ifj858WnO4?= =?us-ascii?Q?qRYLgpkIDWhCJPmH6AxJ5/t8+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L3NVHj1HuCeNVIZrIYypaucC4mAoqvCFkHCUQCWfufyE2anRbCoyUiS5RC6F1miyg+ZgMsM7S1PB1JokXB8+sJVhI7AV8GsYJvBdxtWFJ+Ecp+wa6BpqFjXAWWvZUQBvHD5mnud6NQWcmTagbyshuj0zuw=; 24:Y3S+BWBbBw7q+PUwcZUHCYM9tNV9MgT66EUKMtp2CHfDooF8SM46LArpd23RLNhk2QIPnyF2Ba69pF+M8o/hQX2qDw7yvPOy9rsmf6TvLCs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 7:tP8Uu500MeLqVqnB5T7+6Rf0J1/StMidw9bQz/zu6vXtrP94uDll8i+iMJkJ5lI873JoXuZgtd5k+8qb1+wwLeQeDn+UbOTjipkuU7Pq2PxdHLpX/FMy/jni6upNpHJwqiZ4poQuYyhZ3hyyzM7oma0vNzAqDuR95edOlQTtnGHd9qGqmAG6/snYyldDyLyld3ue7fcrwqkqtuNcDhTMlprvloNY4EIKGYUEV9ySML4F3aUKPjwlAXm4YQ498kwT X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2018 15:05:50.7567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6d21803-bce5-41cc-9f2c-08d599746492 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 v3 04/12] event/octeontx: add support to start and stop timer device 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: Tue, 03 Apr 2018 15:05:54 -0000 When application requests to start the timer adapter through `rte_event_timer_adapter_start`, Octeontx TIMvf ring does the following: - Uses mbox to communicate TIMpf driver about, * SCLK frequency used to convert ns<->cycles. * program the ring control parameters and start the ring. * get the exact cycle at which the TIMvf ring has started which can be used to estimate the bucket position. On `rte_event_timer_adapter_stop` i.e stop, Octeontx TIMvf ring does the following: - Use mbox to communicate TIMpf driver about, * reset the ring control parameters and stop the ring. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/timvf_evdev.c | 140 +++++++++++++++++++++++++++++++++++ drivers/event/octeontx/timvf_evdev.h | 5 ++ 2 files changed, 145 insertions(+) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index 473311fa4..ccf724115 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -16,6 +16,32 @@ otx_timvf_init_log(void) rte_log_set_level(otx_logtype_timvf, RTE_LOG_NOTICE); } +struct __rte_packed timvf_mbox_dev_info { + uint64_t ring_active[4]; + uint64_t clk_freq; +}; + +/* Response messages */ +enum { + MBOX_RET_SUCCESS, + MBOX_RET_INVALID, + MBOX_RET_INTERNAL_ERR, +}; + +static int +timvf_mbox_dev_info_get(struct timvf_mbox_dev_info *info) +{ + struct octeontx_mbox_hdr hdr = {0}; + uint16_t len = sizeof(struct timvf_mbox_dev_info); + + hdr.coproc = TIM_COPROC; + hdr.msg = TIM_GET_DEV_INFO; + hdr.vfid = 0; /* TIM DEV is always 0. TIM RING ID changes. */ + + memset(info, 0, len); + return octeontx_ssovf_mbox_send(&hdr, NULL, 0, info, len); +} + static void timvf_ring_info_get(const struct rte_event_timer_adapter *adptr, struct rte_event_timer_adapter_info *adptr_info) @@ -27,6 +53,118 @@ timvf_ring_info_get(const struct rte_event_timer_adapter *adptr, sizeof(struct rte_event_timer_adapter_conf)); } +static int +timvf_ring_conf_set(struct timvf_ctrl_reg *rctl, uint8_t ring_id) +{ + struct octeontx_mbox_hdr hdr = {0}; + uint16_t len = sizeof(struct timvf_ctrl_reg); + int ret; + + hdr.coproc = TIM_COPROC; + hdr.msg = TIM_SET_RING_INFO; + hdr.vfid = ring_id; + + ret = octeontx_ssovf_mbox_send(&hdr, rctl, len, NULL, 0); + if (ret < 0 || hdr.res_code != MBOX_RET_SUCCESS) + return -EACCES; + return 0; +} + +static int +timvf_get_start_cyc(uint64_t *now, uint8_t ring_id) +{ + struct octeontx_mbox_hdr hdr = {0}; + + hdr.coproc = TIM_COPROC; + hdr.msg = TIM_RING_START_CYC_GET; + hdr.vfid = ring_id; + *now = 0; + return octeontx_ssovf_mbox_send(&hdr, NULL, 0, now, sizeof(uint64_t)); +} + +static int +timvf_ring_start(const struct rte_event_timer_adapter *adptr) +{ + int ret; + uint64_t interval = 0; + struct timvf_ctrl_reg rctrl = {0}; + struct timvf_mbox_dev_info dinfo; + struct timvf_ring *timr = adptr->data->adapter_priv; + + ret = timvf_mbox_dev_info_get(&dinfo); + if (ret < 0 || ret != sizeof(struct timvf_mbox_dev_info)) + return -EINVAL; + + /* Calculate the interval cycles according to clock source. */ + switch (timr->clk_src) { + case TIM_CLK_SRC_SCLK: + interval = NSEC2CLK(timr->tck_nsec, dinfo.clk_freq); + break; + case TIM_CLK_SRC_GPIO: + /* GPIO doesn't work on tck_nsec. */ + interval = 0; + break; + case TIM_CLK_SRC_GTI: + interval = NSEC2CLK(timr->tck_nsec, dinfo.clk_freq); + break; + case TIM_CLK_SRC_PTP: + interval = NSEC2CLK(timr->tck_nsec, dinfo.clk_freq); + break; + } + + /*CTRL0 register.*/ + rctrl.rctrl0 = interval; + + /*CTRL1 register.*/ + rctrl.rctrl1 = (uint64_t)(timr->clk_src) << 51 | + 1ull << 48 | + 1ull << 47 | + 1ull << 44 | + (timr->meta.nb_bkts - 1); + + rctrl.rctrl2 = (uint64_t)(TIM_CHUNK_SIZE / 16) << 40; + + timvf_write64((uint64_t)timr->meta.bkt, + (uint8_t *)timr->vbar0 + TIM_VRING_BASE); + if (timvf_ring_conf_set(&rctrl, timr->tim_ring_id)) { + ret = -EACCES; + goto error; + } + + if (timvf_get_start_cyc(&timr->meta.ring_start_cyc, + timr->tim_ring_id) < 0) { + ret = -EACCES; + goto error; + } + timr->meta.tck_int = NSEC2CLK(timr->tck_nsec, rte_get_timer_hz()); + timr->meta.fast_div = rte_reciprocal_value_u64(timr->meta.tck_int); + timvf_log_info("nb_bkts %d min_ns %"PRIu64" min_cyc %"PRIu64"" + " maxtmo %"PRIu64"\n", + timr->meta.nb_bkts, timr->tck_nsec, interval, + timr->max_tout); + + return 0; +error: + rte_free(timr->meta.bkt); + rte_mempool_free(timr->meta.chunk_pool); + return ret; +} + +static int +timvf_ring_stop(const struct rte_event_timer_adapter *adptr) +{ + struct timvf_ring *timr = adptr->data->adapter_priv; + struct timvf_ctrl_reg rctrl = {0}; + rctrl.rctrl0 = timvf_read64((uint8_t *)timr->vbar0 + TIM_VRING_CTL0); + rctrl.rctrl1 = timvf_read64((uint8_t *)timr->vbar0 + TIM_VRING_CTL1); + rctrl.rctrl1 &= ~(1ull << 47); /* Disable */ + rctrl.rctrl2 = timvf_read64((uint8_t *)timr->vbar0 + TIM_VRING_CTL2); + + if (timvf_ring_conf_set(&rctrl, timr->tim_ring_id)) + return -EACCES; + return 0; +} + static int timvf_ring_create(struct rte_event_timer_adapter *adptr) { @@ -146,6 +284,8 @@ timvf_ring_free(struct rte_event_timer_adapter *adptr) static struct rte_event_timer_adapter_ops timvf_ops = { .init = timvf_ring_create, .uninit = timvf_ring_free, + .start = timvf_ring_start, + .stop = timvf_ring_stop, .get_info = timvf_ring_info_get, }; diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h index e3f558e10..e155b6ce2 100644 --- a/drivers/event/octeontx/timvf_evdev.h +++ b/drivers/event/octeontx/timvf_evdev.h @@ -75,6 +75,11 @@ #define TIM_VRING_AURA (0x108) #define TIM_VRING_REL (0x110) + +#define NSEC_PER_SEC 1E9 +#define NSEC2CLK(__ns, __freq) (((__ns) * (__freq)) / NSEC_PER_SEC) +#define CLK2NSEC(__clk, __freq) (((__clk) * NSEC_PER_SEC) / (__freq)) + #define timvf_read64 rte_read64_relaxed #define timvf_write64 rte_write64_relaxed -- 2.16.3