From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0060.outbound.protection.outlook.com [104.47.33.60]) by dpdk.org (Postfix) with ESMTP id E2A72C304 for ; Fri, 3 Mar 2017 18:29:59 +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=Wh0rTEvty7FB921Yh8GTutFQDPf/1Pxp0By7nsxf2CQ=; b=X3hEE6fuKJTe7RK/LiF//W40BF40cAgjwNYvb3Hyi8Pk80wtJ8Ydw4mAw93bvWU1w9Eteg+72tTDeDD7+b3tZPWHfz0nlJpagB7CVuziROD2DHYwzv32cIC9U2rZzvm00s3qAV47t6PBzOEyUZtwjN9gMMIXAk5uHwhY8UxVsxg= 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:29:52 +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:57:57 +0530 Message-Id: <1488562101-6658-16-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: 8ad927d3-c58d-401e-6f42-08d4625ae936 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:pv4UmoQ5aJWHno4fBNo60h87My8XS4H9xJwdGJ5fvUUISWvQmgK6F3LDQZtQNjPPYgmAse9LCYexoGpRA1eslnM+9Z64Hex6kzGU4r9/i6kbIUYpCkdZm9A+iFXyLiIY3rBA/KWULL8KFPwscQn7NLxgr1Iwa8cFgo4U68WYQqoVGpUuTS1SwfDERoV+O+OOEU3z7rwWB1rWEsZ/K1eBblxwY5jL1fHl0VXK5GGq0CERv/3B9JbW/zEXhl9ktA0hJj/wWRfc9LAYQ4Oj3DhJWA==; 25:tj+Mc1NomjJjs6jeZYsGNek+V7eAGhRisLZiJx00eFPHCPo5bpelkEFpIovwtuuso5M1pcZitz9VSkCVL7O9j0UTOvBSpxqcIqUnIh0lJgGhn3wrnF0XWhxooqGsIZACLnaqMmTLF+h97W/YnxM75TSg2rIBI4X0tbDA8CaFOSKhtLgnxuqfpq4Ka82NunFAjmn7hBVtMx6sf77WlH8OEiPdjJD9lfj+kO4EXacGh2/Kj8leXs7hCk4WEgbdmKPiuilXO4T5JdBIqrYI8ZxfdK8PucxDJ9CRmEQpUr1fUzlNK9Abm2sQEbb1doGFFJdpKGvgkjeCWeilSZJVbjwVp18x6bewZ1geg4ePoZfx5gdAo3kH8tB3orS5HYAHrKUqah7RSZU2FyCA9UzyFXY27zUZpU52HR50BzsfLEpAOadq+c6+e5pSnsMR+yuF34Da5tN4GCZ6U9+MJ1JGR3NIyA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:dVTxiwPpzz0Ek4OZESdgj+XMEqIUX9WJ59JCyIELtKccmms+VdhsTvxL+sqQGXHSWga26onz8phXDcUikE0FW017Da+lcK36kX+S5LzyrelROWSprzltxHuZkxajqCzRoYjj+Z/rC6eXg0YUPX5U0BgPtGTp0m0qmrVFQIoydNv4NSANo+KezFIPYpRmTqW3KFLcu+eNkwHjNKXVQPiHXnkr9NUXN2XzAKC+3jCCJzU=; 20:wzQKrgaW3Yic4c5KoCUGX95qnWX4d2yAjzmhC9iQNteLfwTtXcCZopKYzDSB1TSj86mU4UYHqEzHTQsN5RbjDAz816hPrprm+0FME356iW1K982EpQvWNbx5ZMzXd8wbczYEBSKH7RMTeSlT5gRKAr7LxRs+VsROUnJmvPrf0oKqaIuO5FsSTkLrij8BvvKAGcw51KYbcmqX8B6S0sx2V/gOJ/+B7xA+XMNi4YBAx5s7725Iu3GmfUyES3lBIMWP91IXtmi7LFZQ3pBaX/EjmXH2fonDRmUHR6T/pngcMjPSSLw+k/IQSh38L7A0dw6vn3tepLKPWmBUwQpN7cReO6NGJNahd469wyAhIaXNi0wdBkgg8WqRSKdMgUvlsqQFZ5N/06JrYj4t+JaqX/HGPBEofG7d5aO4WRM6Hvl+xqY9tSYUc7fGoZuG44Z5lZhRrGZH3jQ5rnh2WcJ0UFWBYpQFvPcK6smm+Y37uhu3y9WJZ+qzz9qAZfrfGpHD0op+oL1ttaR+W/1t+YiQzMBCNsX4g0bqkVkydr83r26d/QbaAZn3R0EW0GOkPdNIX4rPaFliYwNJsXSxLj7L7yvymEAeWf6AerkXWtFcaYcr9Ok= 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:SgELgxlawvBx82ZzOJsqxniqn1YsBAy8nZbnegteAnxXmB0GvbBRCa0BJM017CSkBa5XsCR2kGg0Oq7MjfdHXf9hQL1cyutsA2IWZkKwy7UvAR92YtTmTb2LbjEd+BEPvCSCixp8pDRXXj60QN4CR37fVhZtSO8cFWRhPkd7VV0qIz+LiVRI/4v2P+B+vAFwvcSeo1VermBDPry+ZydPfEL9qhl+SvLTO69PLSeMLs06Z4uCyOhcmkHFLNvkhrNCd59KCta+M3yUkMd3ucVTipWE+6J8F49Iud5/TEYgk03QiVRp7aGwnkb5A+ncjiWNMR4+Ycpn6GcbrsHDocorjyqWCnN+yRXGPceQlReXspagbnhUCX/eZv6sHdV7s/XnTGH0IXUgL2xPXYky+kqa2epNhFY22SKgM/9DMsEhDe0+bU7Oe5v2h6GpGXCZ6NXcSXfwGXd8K3SyKHUZJT9ncVA6za63t99tSeCrjKqgHh9QAwDSeBLTIYVIIlN+tHlvAIA9RISFd3r0OUv1KC6QXXQ+jS9EJf98WpN37EDOrsQKQ2YIAaQHOIUB0dbRpKONrjEE5XSt5KIxByFK9yWDO8weygtZFIw7xhxrSPreNlY= 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)(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; BN3PR0701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DiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:1I+/EWDb9ppDCuzscWK06EfAQhjty7DTWB8SntjXwhTzdJ6r685Q80NO5MF8XrqUQ/LHKHbuEu1ePW/cvi4poLyzUujzkVZqcjhWGkS8YzrDVg3ZxQugHo3q44ShzZiPnBJAb1gQgIpUVUOxYTYo4Zlx7KjO8hhV8nnefKldedLCZCxubj2iLxDTz3ZoLjtnLDd7NHqAj8iOdZ6GWX4G4hwBUEjm84U1F3/gfD4UFqglGVxS6qWpwb0LDv5jaC0lMqRNjrMvCnoPwsIA0zO+Yg0ZOjjvC+SeFqyXQGpytjPnn78TaXn86P0h3x7Payjw4H5L01WGrsnI02Jf/ENnlQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:29:52.8287 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 15/39] 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, 03 Mar 2017 17:30:00 -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 --- 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 dccadb6..d1be360 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) { @@ -295,6 +324,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, @@ -307,6 +344,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