From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0070.outbound.protection.outlook.com [104.47.40.70]) by dpdk.org (Postfix) with ESMTP id 2510BFE5 for ; Fri, 31 Mar 2017 21:36:26 +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=p9ZftXeynrqsLAwYW41yJUmIednLRccWq3v84XYdi4Q=; b=E5a8aWBHyOdIIGNJaishvRW+2hD6Q2HBa5IzK6BhZUHvczaio8orvTwWHqVW3YZeGnYEvT1upeej3zj7FIIAe+4p2ncloTpeABA7+HHzWbwDsT8sRAMOW8TI/JUTe10U43E8C6LKr1iHFsiWpQ4lzyLGiMxTSb8oDGgnDYeFNRg= 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:21 +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:39 +0530 Message-Id: <1490988905-12584-13-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: 29c07f24-992b-48b3-17cd-08d4786d37fb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:FDbaIKS7szw++kpRYx84PAR26U42j6xaEugzf7SF2Rmqz4bv3P2mBhCUOHSoifRK+wlSlwG1J/T3ZCfQNItMmN0V+qh41H3FudKaJdidWZadkLydIblQZ5iW0+i3ijHEdb9g6rsSLm8oDQoM8mFYKC9+zdQh8lbCdF1KLtvjeYfldYh1yzUigR5wy2yjn+L9E59nTxPnYHOMAZ5J+nKxU7e6paa/3OkQFoxHN5aPLIwApmQiK2kXZIxM8XcuDfgRulbOfyVKmcpClW76F6jb2UVD3fOG/S47ijqqJBSOs6d97oi5w58kRKKWt44iZgTQAc0uzJsHnQycE4SAT8WBfw==; 25:wAm9+fjPUVHE2FnefB0spF+RGxPiJZ7zgalC3TbEYrqqM+TPGJfM0JNSnp7fSWMzf9Xa3QpDGvKEPKYACx4WjHv0u0SXf6NCaMVf0tLTnTtFzV+bStjRJKEvW54ZUbU6wKCOlrTqlMneA54lxMOJUfN+C+v5SsxTJf8F5tLI6uI0LyQJhDXGlU2827/xBmIB0EvM6yr1QRCalEyAqs7K/08JI4bSjxBbbSzqtwSqyqoCOXsv1aekKyXtwK14NyUuyjUui1oxmw+Q6S3YZz1mk6wnW9ClSkRn75B968ZU9Nk/5/VDJrd2YQTyWUalmtYEGmHf379zKj65A3EGXdRUVUTizN37qRQJF9XUvQp688kEIwsfxJMxMAGhkRI6kBmgrNwZzC/CO09II2VtInxqfIeL4TATsXtSl9KIXzkDwa1tWNkAYy9fALKYgLDg6Lj3vI5HOtSKfWGsW4ejYEwLQQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:n7oxSSo02ESgZrsotDgt6g44x28d9qRnILSqxgb3dGD11Uw7plRI0QyLH562ifUC2J/l5kH/G1Mq+oxLkH/Av5QAb46WcaG06aFjVDKNqhsJNVzGFRYUXD9QJRKbmc8h93BV/IddaJxnTot+/QRP7DadRwmw5oBD9cUISb9HnEC58nhObg99kcK3h24O38R+vw9Xh/J5QU3TAOoQgGJaysK4lkzwL0hs6Rm4Dkj6+o3xehbtBIMuHXHGTxpvnH1F; 20:fG1qpNeNJApFeP02DMZTGdUaBe3npeQ8jDkjnonBIPx8ER9XVBxg38I8gIHF/xs1qHwHSgmDpky4Z3n2jJNcoh/1YzisFXhRwxWuHNARmivhLj1OGNrh3VTClc/dFWmwIBBPYxKx9Ax2xoiC12z+GGZuINSG1J4TO7ZuAj1g4bv8fGa3hg6roskT3Qzti2Ch6MiWTvubCYD9jUZTFdFaqG/Rybo7BFTi+fAx2GhM/QFZjuzvcXn+cQA38k39DsOKA1ApuCp7Frn0n+PNX6ZjK/mZegirqaWuLYCGlOJtY5r0JDmJWFIfIeZ0lkaGFW0osJ0P1xs1KTv8RoJm8TW6XycGhgqFFc9MKspE/gslErnDbiowwMkGuXGoj7zzrA9+1SvMbuBK9Do///D4D4qciweRTVYUj7yAuN/l5Rd5hYhhnZwFSFDd+6tPpZNRjdUZcX0ubhD8MiCtUjQad5jbukAaVypiJ5G3s9X2PurGQ6CE9QooGzL4sulVgwSE9N5VENDVzkpCHW7MXcqFySdbjM35gD1lfBQd9IEmhuW1gFIEup/Rc2gsK4LfSj0lMo4KXoLg6z64Ajq94DbNRsNSxuFUJXOdgUZpzTw2euKx9qw= 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:vaBhpigX7d35iCzbzaSL6NwWaeVSCxsrEG54gZTTkndr0lvX+7D3eb2FjYPuukkYNL+gqcqDAH7wAlf44BxSugBTLyygQuxQXEEgdR8xMq+8leS2wJILiPF8SgcWMsN9j0TS0x+EGamzhQ3UexGe+quuBYpdQKTGp3u0UUfW2jyR48uS3cw+keenPBKPI77STp1ofehRcYNSdft8QWJhKRrFWvF6kq5ZcaQiqdvfTMT9Fm3SZVOAyWQcSM6VmH+Cowx5CiXZWpnOsWYX3Ufa7T0kaBDm7JEyWZhRwXSahjxyVQgXX2l/uRO8Q1hmq33De/osbOKrCS5jXXOOy3cQGqOeTA6DCmVymZb0mH47HioDLk8oJ7JKoGpdMX4en6xGmLnWOfbnkJtqURYw5VoltmFdQP7+A/2WoGZi/vatbvSGFiv8UUh9VKpEdQ8JEnaedM3m34Ej7HH8B8KDknwWhS1EWlEcHOL9IgiedS0ZSFPTT8FFvW3FCdZtPz5tihVT2vq74Lj5NbZWM0/ShkGPgEWekuxNvP8jeSSS7KdxvB5PGzxf21csLu53Y3AGufHZrFcKmLG5x1yVpTDroLQhq+TGGDYdm6rRrf8K8r6KP/B7+J3CnUGfi4lgqfScHCiKsIMTniKLjet/JffsYb8WteZBh7e23KK2IA0EFAjM1E3PdCBSJrfHAYU1VeoUsiX/hv1SvidhIqsvuiKEuElCTkcJrMbkstcQ2Ih6ouQQ7pkfHldCK7pHwgfCmojNjp2q 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)(575784001)(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:YFdAEjSiAKeI2wLVp4vzfrncIOGfAJFxeQSMSy+?= =?us-ascii?Q?4EEGiRTLDNzjISyM6VyhgdOX8U9QO6fqQ9pKDdb4HnI61wsBchSpbq+TFwgF?= =?us-ascii?Q?HePBdMIxi34+tIQcYVWisTBboIVsIkoM0iMAadJj5HyP/DQxqsrf3a/egAPZ?= =?us-ascii?Q?b9ynr2TdOqO8PeKtmMdCnhNhuqBaLWdsXCE1vUeZFFDAgesXcnPhAnqf1NEV?= =?us-ascii?Q?f3P5py9q3lPBHfmTiIDNR3IlZOnpLLZKH3Qrca6GR1No4LgswMchzSJEOZz2?= =?us-ascii?Q?4yVBMXQwwriEE7O77HIp5IqNbNek8VKD0QM7OZizx0OFABODeFz1cepc6LXl?= =?us-ascii?Q?1V5GvLTkC4mcPPPGYZ6BZuS0DFt6mACWAvyLRKblEFZ/qUkf+a94iVENO/tX?= =?us-ascii?Q?PA9edHYcbB7A0LIFWqnkBkfBGknggqWN1F2QGSKvbQB5APuwEBACZhxm4t/n?= =?us-ascii?Q?jO5iQjmv8ccxiuGxVeuGb3rUy5/0EdHMtNHmGbw4CEa0UghkVG/f9shvNQXc?= =?us-ascii?Q?mKfXqKCwmDjVcOK3AmIZN7EoHumvnxPUkOEB0VfJdRNwA+8fGAz4JcnAzW8D?= =?us-ascii?Q?nQYvP+6Gsgr3fJXw7qFOSgpWmrZN0J+574CRR34MP6UlKOP2lZPdlM5igodZ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zmsP1ZdMHZes0ziVaq/QMyR858MtRKwHal8kTf5doSOsTbOACKAAAnFVNhttb0gPb7x9cfXcJvuriYw7qUaJx9AiR2w==; 5:fAwFGCCYPg31LUfOM2BAgNW9IWBYjZ1q96T7t8v6YhDYGo6os5fu5F5MyhyxeavXMNcgnBcU7t6l/q1/tfPT82kuM+PhwwQ8SK/ilHqla2OQbjbmBGzL8C5Av39Gx+tKrwfsZHlL9XE4Jz7sdDhynugF9mYUCLKwIIOJJUZZMLI=; 24:UetH9gsLPz+SHwhTArzCJwnmzrfwmKYYACWYmoT3FJ5+2A4Xty/2ZC+poAQEzg5USgggrHg4MFPVDLPvD3/c9WeAssE53J5fU/UdIWLKKWg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:o4Q8UeQt3h87/qTp/tAKobG/iFvMQ52cXY31Y4nDbfasULzRgtehHogAiOyLYdwF4nMWC/KxklOFMG3/m0nv8KjvFAD/69xea0dKNFvvto5Vep+Pv10ta0CyI1YwvK4JekANmKhwIfeP/6IoJ9trjBrv2bO1jTS1IfxWTZw7NkZq5LsW0l0K5ibKIauuF2OixElB1Mav7gQPdaH3iRJCde0eB34ed3TtyfIPfYZRFX+dJ0H5Gd4sdMWLx6jgt3kYl4dIhMoeJ1uppuLHi0cdO2VozVpjN3f/OxUPYDUzFqEAvpAtFvn6SddlCkHzhSqB6fwLE2qR+ToO7cTaGJqSdg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:36:21.8062 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 12/38] event/octeontx: add support dequeue timeout tick conversion 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:27 -0000 SSO co-processor runs at a different frequency than core clock. Request PF to convert the ns to SSO get_work timeout period. On dequeue, If device is configured with RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT configuration then use different fast path dequeue handler to wait till requested amount of nanosecond if the event is not available. Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla Acked-by: Gage Eads --- drivers/event/octeontx/ssovf_evdev.c | 38 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 1 + 2 files changed, 39 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 78b0f26..1f3996d 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -119,6 +119,35 @@ ssovf_mbox_priority_set(uint8_t queue, uint8_t prio) return ret; } +struct ssovf_mbox_convert_ns_getworks_iter { + uint64_t wait_ns; + uint32_t getwork_iter;/* Get_work iterations for the given wait_ns */ +}; + +static int +ssovf_mbox_timeout_ticks(uint64_t ns, uint64_t *tmo_ticks) +{ + struct octeontx_mbox_hdr hdr = {0}; + struct ssovf_mbox_convert_ns_getworks_iter ns2iter; + uint16_t len = sizeof(ns2iter); + int ret; + + hdr.coproc = SSO_COPROC; + hdr.msg = SSO_CONVERT_NS_GETWORK_ITER; + hdr.vfid = 0; + + memset(&ns2iter, 0, len); + ns2iter.wait_ns = ns; + ret = octeontx_ssovf_mbox_send(&hdr, &ns2iter, len, &ns2iter, len); + if (ret < 0 || (ret != len)) { + ssovf_log_err("Failed to get tmo ticks ns=%"PRId64"", ns); + return -EIO; + } + + *tmo_ticks = ns2iter.getwork_iter; + return 0; +} + static void ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) { @@ -300,6 +329,14 @@ ssovf_port_unlink(struct rte_eventdev *dev, void *port, uint8_t queues[], return (int)nb_unlinks; } +static int +ssovf_timeout_ticks(struct rte_eventdev *dev, uint64_t ns, uint64_t *tmo_ticks) +{ + RTE_SET_USED(dev); + + return ssovf_mbox_timeout_ticks(ns, tmo_ticks); +} + /* Initialize and register event driver with DPDK Application */ static const struct rte_eventdev_ops ssovf_ops = { .dev_infos_get = ssovf_info_get, @@ -312,6 +349,7 @@ static const struct rte_eventdev_ops ssovf_ops = { .port_release = ssovf_port_release, .port_link = ssovf_port_link, .port_unlink = ssovf_port_unlink, + .timeout_ticks = ssovf_timeout_ticks, }; static int diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 9a6bac5..16bf3d5 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -117,6 +117,7 @@ #define SSO_GET_DEV_INFO 0x3 #define SSO_GET_GETWORK_WAIT 0x4 #define SSO_SET_GETWORK_WAIT 0x5 +#define SSO_CONVERT_NS_GETWORK_ITER 0x6 #define SSO_GRP_GET_PRIORITY 0x7 #define SSO_GRP_SET_PRIORITY 0x8 -- 2.5.5