From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0058.outbound.protection.outlook.com [104.47.32.58]) by dpdk.org (Postfix) with ESMTP id 6D366F95A for ; Fri, 3 Mar 2017 18:29:41 +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=wicB8p376wnRGEScbKyoeAHRP602TI1+Bnt/rADTJeQ=; b=fJ6UWHlasK6EsPBKujhrWhFVfppCiu8FW5ZDe8cE9kQ4mOPtWJWfIQPoiCk2NG8yQApCmZDo9H8Ijeu8WYaGS48UqaMCLkJbwJKXdbty/WkDD9id7DbpnWYlbKBJaSX6IIiueN9mMU4gT2Otht9aCg+2/AobbgzoFkZtC/kLWvY= 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:36 +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:53 +0530 Message-Id: <1488562101-6658-12-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: b6961878-a187-410b-2179-08d4625adf57 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:8DZfowkG1WKBmwly87Chdo18MKVaweaX2bJA6bkEFlc5NBjkdlECXELvO7moYtgK8jWtKf6W4uMAXFpbhBYmQfzb8zy5P66t5A/uyjY/gO5EK7pX5jylDvnLlohqPrYuPLbWeVGxNlngIRrYlN5Ic9fOQbNW0S7dZIiUDqPlqiM1w7EIyMjx0fPOfiPKkio3CmzE9C6t2t0cNLI3WLLVacbuila44yyCJGzQkgzypxIQsozFUw7xiGGE0nBULgIrPamk5gyk8cV+y5WNXQ53fg==; 25:aSOP/XHU4xZu68lkvB7UBbkUX5KoRXQ636VfwTxaaqMvB3t1IxTTcDr0SNejMhJZbbk2UMTB5xa7OZ+OHuFc8Yld/OTSX8Bk9DQG7dlbETyr35tuiFkqFC5Dg7O2/XH3i4AIWHJTo7bLK3xLY6CF9EcGi5xlWw7ilvj71MD5FRbrQgnBfr2E8uj8PA7Y1kY5Ci0BvnxofNvCkFQW+91nBjP2oNe3mzADEk7iJjg6jTl+6x786CBymJvCSWYMGja/BRa8Eyq/MYHNmnY6OSDde1sEZILjvAs4RzSIXZfyQHYPslRM127tVuEgphJWsVHD7hwpJ/XWL/FdoVQ/FC4Tn1HD02cyuEo1Q4jltb4ShQU12f8RMeoRUsXonANB4wQbtdt/NaPdwySmQ5mIY0AFaqFfTv5fcwDPtCcIKLxv6AYZrF4hrQUkKOLWUicO23JZc0/VIxLYQRSMv0GeoWdTWg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:dFsquNpzQ/i3ClzWk6naOoVLB5TwdD/o3BAt7I1Fk9k7IMJUPOWn4LS7a8K1ty3gzPzSMy2qobmy64I48LIcYrMUa8HDLOn9BQRhUftusXgu2tj60hq5l2/D+ryxJqvJjm5emvbC1i6PCp0HSOd2ixQDIcYXEPKg1wZs5NN3MUPrvo+LGaKhTOvqEEF/5ElhmAXPTJxoNwqbXTqwjARlkIT+Zd0FwPnvjmiKFWpuLwU=; 20:BhmNZlP5Z4xogIDwGDDwGyzr8FwCtVeFjFXD67m1YGg7X+KU/qb5mC4C6XAN7F/+r2q1ow9tsno1iukzOFqGZahML9ppD5mgi9/RgJtk6ha6+23S/pYFVK7Uabd5IORFjzReLv+sj2Ib/Jlcb9JucFOfg6IIvZc+/boPhigGUrLa3vuk2RbJdLhvdLbCHlTyIaMdnGtA5r1pF3AqnfugyNt1UOf/24twLECkZe55aenJoeVDoX6f1qQGztP6HyT0H1oRuEtOarqxt0Q0B8d2nnZ8nlr8/jDKUYa8QrCNponaWsaM+9wBwSHA0//9O/D0hiyLVg4vOTiqnPPHk2DjQBC1pA0CmBfD0z54D4iaKP0eC5g78lpohJzlMkk/jDQgHJ8nYzhcU/mgCc8aD/Lub7b1L2iYWV3Oj2hhfVSd8qON/+jynAGoDJYfgC0FRU8dcUxKDUo2w/SV/KMLP/ui9I/Xp4DHeQbZfsKN4WqPKG8CKse3wJ2dADsXa8tEcBSmak4so9EbyUOk4B41nNEaZedxE+YdPt/PN19A2JET3pfFkQ4nMl22kbCZQDkAOIpQFpzLD/yk2QqDTQ7MOA8dPCTqKFMSxp1kmHyo77plTuQ= 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:YW0O1VJ/BfUwoRFAqiplV6gutdkFUXqQzWODGas3ioP+ntkMy5+JrtYz/QbXtmpwcndVtBCYOolhrk/601VAM4CiF7ndXWB5yDRJoPu0ou/hcRMeANB50BMB+PEfQBhMgzXFpfZHIVj89mKhvpvmyvUa+X8rTjTMTEz0vFYJCFr2L29XFDReiyThQGvfoK7cNk5pcDxOXsLZN/1URdQN1DiAOifLf2yr8FCRk3ZOrrtLixYprkr941MhszJdcuSSyU+Vu3fLQNSmxfmlLLpSenNVHqPii2v0OgfCeKFru9Caz///rLBOr6p25iSiAfdXPqHMQTSGnd6IZiJ735nIc+zF79pfT328RsO2BfKdpdT9T7fGzp1gXY8OYgbrnQWRK9zMueMB+MeZEIxMKd+7g3+NVBSJhBHE/tWIKJeAQdToO4W83DJdGj9HF/EfafM7oeM6mOfVLUMdsLTNk5xlAR6NIpiKzZR5KdVAi3doJaLw6r36eq45Ibk5zCd+5wdCG5k2DOOo5MlJrPX2MNjHUWCBDe1e6hCNKwWNeCVboKPYpquUgkjV1lbovkaH0CJ8JT8rYS65BH3SmlC9ZvFDOZyi7yK7LBHHhYVMoKX3nJM= 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)(6666003)(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; BN3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= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:WBe2u79wQU0pJipWswwZaMbGJL71OwlAMAX0SmL5rwLDCR/h7RxifSbmKy96VOqiCsX5oWofPpf49cts0C90XAOgi/f3Ih7Xma8pAHLDw2DjYCgm9qingrUWaEqX5xjuV6htwq/wKbAhqe7IOs8N9c0u5pojHuTR+FsokOWQfTIgFSsMN1zZHu2LxKReZvwYn4ka6xxY9ncQi/KqkAuBo1PXN+O2fWJM1odtC49JqY0D9yaQer7OmshGpB+dlQjF8gG4RBTgxBsqoKDTuG8YGj/Hp5LS56qFHAM/Nm2uBqEKhx32ZNC+ypeaa9XIeAn5xSJqjB+iYNVpTsMDOh2ssw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:29:36.5226 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 11/39] 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, 03 Mar 2017 17:29:42 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla --- drivers/event/octeontx/ssovf_evdev.c | 40 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 4 ++++ 2 files changed, 44 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 342f404..b59d721 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) { @@ -84,10 +108,26 @@ ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED; } +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); + + ssovf_func_trace(); + + if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) + edev->is_timeout_deq = 1; + edev->nb_event_queues = conf->nb_event_queues; + edev->nb_event_ports = conf->nb_event_ports; + + return ssovf_mbox_getwork_tmo_set(conf->dequeue_timeout_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