From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0044.outbound.protection.outlook.com [104.47.38.44]) by dpdk.org (Postfix) with ESMTP id C572D2C3F for ; Fri, 31 Mar 2017 21:36:10 +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=dP/xD/y9rbBljz0nB5AIy0yaMqq+8mHZjCZ0/nqzgf0=; b=eY2xX1RSD3iNy6qawIg6GgiMKWEChzo7fkd78aGA9oSokxDERzvfCVsA37K/blL/tOrlB6LyLyhjfjdz12cxTuNLz/LkpFoOl8iC0Bq1ugG3M9kKc7wh2Dh9nJ5KDE4uzuT+Sth13Yh3RAyA+rVMSfdtQVLf6ZZYdEjiMJ6T1p8= 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:06 +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:35 +0530 Message-Id: <1490988905-12584-9-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: 8b70893d-c8c1-48e9-71ca-08d4786d2e7e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:x0Ut9ryOpVyB9uYDqn+vjiTbBDuqvadf/99eVK47o/mpn7S1QjXCcQyyFJLaqiSWNuLLgKaDxNAqUJHmsatLJ9nnS0TjLZD1qQVnxJaVbXvNZEaancokWWcRv1gAX1u8zafcJ9Zx9mMno6c1sUxAFfN4cvTuhb77UNeZAbxCiMLF27OpjZJ1Liml2arkBwXiCXfuGG7NOfiUnQo3JSiIq6aPL5ILn7PMa+KiAO4BDwJH+LX1W5r+VeeA87+ClW02BlT2z/+Ia4p/oHLSBqpLOJBLfBrvG2DmRFiOhy2slZEhmx6ZYvhONTlITpRXyXH1cafcUdgCq6bj2DOJVlSupQ==; 25:OtKZpv0ddlwDFfXy7XcHxk9Os/4Jp1FgAazNkJpcz6GRECeKXYScz43CzkmlWW4+K3adypgubWb70gY4QL4j+JlG2d/QqxxaQtmsGW88tz5amMVOikoSnYCiUSk7sWLnKX33sfyLzpVU/HzB4HHy4bTLkDyCtfzWJ1jCSqLiOH1h4zVjHKiM26fXXPnw3EhY3KHvamd00Cqcn78/juPGySuMurHeVV6EvlGo17l9hyrYY6kNYG6uLFkN2FM4cQDxamjU8/W5dmeCNdsppyzVqUN2ZSfgDD4Rm4d9yFdcNcbWC0/Z0Faw+BxbU5QEvWU/A5J8vmM6nm6Z37RkPJOTe6+fZMLD/79zUe4OAVY9JT9uLG6UZxt6bUG8gBiS8sAzwZGyWczPiWkfUQ2qXOO/XzzQYmRcvk2kq1CaK4n7JCZg52Jb3AKY0DetSJOzTlvifFuJLNrNI3bIBvk0+vrM3g== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:WvSthdZbHqmw6CepWouvtwOoHd/iScYzo+c/QSCElIb6JimwIbae/8H+BrQQvhFSIGoPHsB9W/yLXgwplWXvHfcuUnWLwMG80VcbkygyWXSYOH3ZliN0hexicTwrbjjBDP4XEVWunTdk0mwbbfLRLkNPOtVnNpTA7dq/xkMp3H+okEi07hk9dZL7QVM9ifa/XRuaSuh3LZb/5ZW1ShJa3Op3W3m/7zV6sp+kjuQrFt1tvfUwvd72dzymjjxumPZ+; 20:bVw5Ns2HH5NHGdiPStrZiaAvGuA+8LY54uSphQP6za/bMAUDgknW1rmVGlQ3aoJlcz2YUPDW29QnxjofN5quiNncWS1E2Gks6t2EMWeXcksbAILaE74af3dndPSmsbKx40CLQssUF87W/a1arBADRRrdJiDqob+2t2WM9INqv66wuL6JW4BjGp4BRTq1Wg2alBP/phdvHHsnczfVaquLPS4eMUQGuHRMC5I4wkYEndD07puKf2kP/Q0vpEQ1JT1xENavq50exru0oLcqgRqMieCPHs8k46+Occ9fUS/cDRDh9RO+nyjcJiqlUqTOxXi9ulmRfOlKKGH5L8jXjFghJa0NSi6MgFEHM721Rl7JL5hlxweo7NncaI1/nHQCp/Ms8EWkLubaZecS8VNzzsmiCrBUpXr5lt+iweDh3JBo+tubnUJ5XlFkApkknGnKX7q74AWKTIW9cNc57UYbL6FId3h9W3X/woPl/JlCdO8EvtxMY5giifl2H8mU4mtee8284VPGj2H1rEDmJc8JO2VGJi6zVE/MrA9HC0HNSUPPfbXJLmSiJwHwzF8sXcEc88G7Pc+cTIf5Uux48K/n13P8Ffk1MVXAgUR8meIY/zt7yOs= 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:J6BmBOIQokwsGOccZqx5JZDkN7snAN+kYx+U80Vr9jcFQmJnmxYXBN2GwXeEPN4tddeGJ+DBumQgrAmUMzVODoHsOFtMNQS1HEX6Uce5fjjnDmIVZwRmC7dr75a3mf4Hd+XyRGicg4oENPnBLsg2N8CYtToelW6CBDmc1Jr0J6epusvOab7S1BiTwCduu9CPI/5iMnULK11S8lWZroUKaWRbQhkTv8ZjX0HL9EFf6ljg2yvO1CjCB7e3aNfl/7Hg2L3HuCgO41xaXJmb/uazqP8q/r9ScvHD7l+fpQdcbIg7Qi3HgOA9U24vAv7ugVNBBWrmViUrNfQ2huJbUHyHC/mUpLdn9eUd9mEgJvMty2KJfo98lVOAoOamdDL9Y/IkvnoeKDsbPesofUiIbyMAhblNKx0n9mBTuP++nwg1oZUWWHC3kxVwvxFnU4j1CaphHCKDecPp5hUVhirx4M43Rm9o0e6SGk8b+ObQ1Vv5noXaq7/A3N8kH2UFFofvsDp7/HbeVT2qnmD2Qd23dxVEZeFjvjCijmh4a3464KdQeHrEPerfmqCNeO8uL/d21KNf0TLTLP5iDmCHc5IvQLyz1wYBD5f9KRma8wLLtc13yx5ssGUYxWCer92ynpWVJMZtkqk6sobdP/0UblOFYucpEbIXi4tBwgcPwcZ0GgA9+JGUmkYWapHMhsjRQf/ikOwkar1RCiBtbV2pgGH/mhytBI+4VEYByI4iFIeayiBEUmlURjFxy6Ur/tuL/IjkrBoT X-Forefront-PRVS: 02638D901B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39840400002)(38730400002)(8676002)(53376002)(107886003)(110136004)(50466002)(189998001)(305945005)(6506006)(36756003)(50226002)(25786009)(48376002)(6666003)(966004)(8656002)(6486002)(7736002)(2950100002)(5660300001)(53936002)(81156014)(81166006)(3846002)(42882006)(6916009)(6306002)(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:uD0+wwGyZTdMs5bTcG+WVU+/E0YHj5XhuZGXbyV?= =?us-ascii?Q?PILW5SJgAs5/1NZl/busbDvLHrLQbvrQFfrohMxHDqP9AzbJcxueyOnikeQi?= =?us-ascii?Q?qAyQ+91HuLtpPZjw1Pl38IUvJuEIz9p5/7m1n8ERCxREdOYtSTm3cC1XTOrf?= =?us-ascii?Q?MQ/YgaqsH/+KRRBu9Usrwt4Lo0F/JuRIpWXjg2CLUQm86RKONiJNFD7wto0o?= =?us-ascii?Q?eCelsxZ3sBeJXOQmP7qqkt3XQaTAk2MzNUNMBLus7vHv9tqVLsy1Z6j4C+u6?= =?us-ascii?Q?WULnq0uaWox2AXd4REmB2IIWl0F9yhjmzG/PJAXWlIpJmJ6kPWOKHJ/ZwnTu?= =?us-ascii?Q?j12szRaODY4A5h8cKxEaDtk6lWuRvy4/Y9ddnpb6MWHM1yD6QnorFkNiaB8i?= =?us-ascii?Q?9HFDMPArQTvaT4o03QM9wNueKV4ELLx9gkDGh9nJEpaRAhHHfp91n3ioLaEA?= =?us-ascii?Q?sOlIfS9PCPmTvBOlsOoUo27fujzkWCyMtuB9WpufDwpXNRj6Xh6Aq/xNPy5m?= =?us-ascii?Q?Z76eTIua9S6Uy+TtF1Hgvixh/CGwtuULGUsXp0B6+QR7jGXrjcNl+0h7NA8I?= =?us-ascii?Q?+eI+i4OTY1gNTh0Z3nv2dl9Fz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mNLA7xGdGyJqak02DCBr39lxOC+ucZEVh46pUDW5yaNAW6S4/SRUSde1Ur1/Ma21Jo10Z87+jvsHejfyY2sF+LgCMwzJKSRmdphcRuCExoEmJvP0wEw4hqv6rzVQ8qdMCZwOzui8OGksEAn/ws8eRXIWBffvg==; 5:A0QLTI1oAOBAh+UFMTvxcK+ZcGmOblpfnYYI9y5topgaT+5FxhbKD0WvP9ilWFBaz8oJT+UMdOPdBPym8ElfkQwQz1UII85OG9uqNdBzqlblR1CEIBqkUNU206lKKs4wWqt6u2zSGSxlckxAq+HcaLP/PHqHcf3Uja9gBKoX2kg=; 24:rnfP08Y1ZcPRB1iWp8V6B9U16HyLuk6nV12vK82UQX4Jkuke29I2f8hbBtFN41PeaRpxUKV1TlTRUJgma7HRtsSmnz7n49BSCJgXiD1KNb0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:KnUJHZgamDzrLhrGNrXv+0MPcVcSZzFBUu25EZuG0/EWqyxFmCl1dF8h3y+d84Ulgpo5jeGEkMVZN3wNjrETTB75laViI0nJo5S2tPRLy8QYpZxk9LHwUrSyo7z9zoY+OE/Ka7xr69w0RKCfRBQXiLZKKViIXfjB6nLW050/ltKUOPmc1+lTOQXMld3VgYPe6DFy3vdLk1bTKDQM2R1l7dyk/uMF5s+jmG8HByLuKc8xee1Fh2s/pugwe/695hifwaUfhoCLkmfFSGIsRa2Lfwswz0k2BuvGs17uL3JOEOtbpQVS2UngI3qrk4KI+mnjmnSA0xzzoVTizymh2kVEkA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:36:06.0209 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 08/38] event/octeontx: add configure function 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:11 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla Acked-by: Gage Eads --- v2: - Improved the timeout accuracy(Gage) Improved the timeout accuracy by invoking ssovf_mbox_getwork_tmo_set(edev->min_deq_timeout_ns) in ssovf_configure if RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT flag is set http://dpdk.org/dev/patchwork/patch/21377/ --- drivers/event/octeontx/ssovf_evdev.c | 44 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 4 ++++ 2 files changed, 48 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 9608d9c..b66d957 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -65,6 +65,30 @@ ssovf_mbox_dev_info(struct ssovf_mbox_dev_info *info) return octeontx_ssovf_mbox_send(&hdr, NULL, 0, info, len); } +struct ssovf_mbox_getwork_wait { + uint64_t wait_ns; +}; + +static int +ssovf_mbox_getwork_tmo_set(uint32_t timeout_ns) +{ + struct octeontx_mbox_hdr hdr = {0}; + struct ssovf_mbox_getwork_wait tmo_set; + uint16_t len = sizeof(struct ssovf_mbox_getwork_wait); + int ret; + + hdr.coproc = SSO_COPROC; + hdr.msg = SSO_SET_GETWORK_WAIT; + hdr.vfid = 0; + + tmo_set.wait_ns = timeout_ns; + ret = octeontx_ssovf_mbox_send(&hdr, &tmo_set, len, NULL, 0); + if (ret) + ssovf_log_err("Failed to set getwork timeout(%d)", ret); + + return ret; +} + static void ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) { @@ -85,10 +109,30 @@ ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES; } +static int +ssovf_configure(const struct rte_eventdev *dev) +{ + struct rte_event_dev_config *conf = &dev->data->dev_conf; + struct ssovf_evdev *edev = ssovf_pmd_priv(dev); + uint64_t deq_tmo_ns; + + ssovf_func_trace(); + deq_tmo_ns = conf->dequeue_timeout_ns; + + if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) { + edev->is_timeout_deq = 1; + deq_tmo_ns = edev->min_deq_timeout_ns; + } + edev->nb_event_queues = conf->nb_event_queues; + edev->nb_event_ports = conf->nb_event_ports; + + return ssovf_mbox_getwork_tmo_set(deq_tmo_ns); +} /* Initialize and register event driver with DPDK Application */ static const struct rte_eventdev_ops ssovf_ops = { .dev_infos_get = ssovf_info_get, + .dev_configure = ssovf_configure, }; static int diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index b8b89a7..1c36923 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -115,11 +115,15 @@ #define SSO_GETDOMAINCFG 0x1 #define SSO_IDENTIFY 0x2 #define SSO_GET_DEV_INFO 0x3 +#define SSO_GET_GETWORK_WAIT 0x4 +#define SSO_SET_GETWORK_WAIT 0x5 struct ssovf_evdev { uint8_t max_event_queues; uint8_t max_event_ports; uint8_t is_timeout_deq; + uint8_t nb_event_queues; + uint8_t nb_event_ports; uint32_t min_deq_timeout_ns; uint32_t max_deq_timeout_ns; int32_t max_num_events; -- 2.5.5