From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) by dpdk.org (Postfix) with ESMTP id 100332C57 for ; Fri, 31 Mar 2017 21:36:14 +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=tW/o55YAYVNSXKCusf9pAonErLQn3zWwd5Kes3vmft0=; b=CYlZ+OrPqLQ3k1vUS0MlayDmQMC99LKAYQ0aeWlOC7/kcMViKXD2ETJqfr+Nh9JNhJGK3I+cKoY1gYGv3Jbb36I4okFDcLxdvi1pdS9P3Jkgv07NZglqaV9/6jky5U6C0o2zxnxue6lBUDgmyBM1vF9XCBfxlUp+qvZW9CuZ6io= 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:09 +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:36 +0530 Message-Id: <1490988905-12584-10-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: 65c0b885-7805-4262-b386-08d4786d30d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:Z05WZhZZQBtWfK4eEM/JyfhvYs5hYSn6IDsnOau4hkc6yW108IyzPV45ZvfVdIEF2r3TPSOxNJpz149yWNpKGkZYk0WT9Rk44kIl4jirQCg/GiWbgOgJVWAgmSdAo9cpNR2BPpIv3OP/1STxJhnjNVTvo9PUe6UwdQZegXpM3Qdd/LeSsst42vGw3ADempqUz+I9jSNX9aKsckZ8lIW5vcrVotEa1hIdll5/4x8wkOPyB3lwd3adpqWV0UP80yWLeJnE2aj581KihTHYnq+K2N2cJSFCGXU8C1xRcsPTobbbjIyyzJs1v6H2kruX09EAskYWSngpCrr6b29yWjZ5Pw==; 25:EMukabzFwE9rCtJV8tmcViXLzKyKOvTyOekEG8tQvxNu67u4YYIZIPLbO48hOfRVfOqMYuzmwRKvJAgsQnlCF5lwElBnQJdBdvH1Ks7j7Zw7n5GEM1/YTR3GSF8B4O3me9yOKPtSJuEXJLDRGcjQazR2SxrfY1sGmDL3oCGrMSAxxFKWOpdomtR3YLTsISzbJbLpg2t8B1i+lRcwyeuO6vL9eNhkoPGFC1gPnwDxLSu/RrrI9rq/DFW88OlSM45ue4g37AWe3eQmtnyTOTt8Wu/8aNUY8hdKsk5K7pXaPPGwQGS6AmVqVzrRc37B+k9F5/KVESop6BQgq2CyG78fTJf2ceu+rn9zqn65kz/oL1u51j6O/3uAxYdx3I9ME58MC+KOTRehQymABtvBflXLZUxfH/Iw4hyrvAVD9GrmsXrQmw8lGBlszcmzzwfBDHAY3qIf6W4oF+2UHO8jB5XoIQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:KA2H2he0fVwedSqibxsimompBqywDMtB8kia6aOIHYD8dyLX7D/O5xS/dZhWVpQOszdVVzTflcinGTuyRLoZGV8yquQgxXV5MFROSrG+9gITOe5p46lESW3Ui/fihvFACRsMuqAfq4mF6eoyGlpJGJTFpUawcvgmhRH3Txg27bqubdorDwhzcK2Cbcmbm/3J1O0SkDtI/GJPmMib7hbWjDiSJWayFc4RhD8YNoCfBqk=; 20:sB2JFFLj+HZrMZpG9OrVYAI642YQjz4dzm1By3MZ5TgJRgyHrOGHalpSGU3Iozna/OvOuaz0VddsGg9d5x7Ap4XwoLrs+xk4cbnTNWQboq6UQolIa7dfiOcwkOAB4jZja1jEWVqB2rhVFdbJop7mBj7Yknr5kpPgiojuocwemCYTzQGkGr6bm20vuq8OH3w1dYamJLlQsmDkclMGZ951kPtdDFSv0IDO3r7D9Sb0wOQcG91825S3CybHInfKdXXhKt/H8VOUlEt5oZ3S2/T1xo0hqbyeA/zc6NVMa4/rwugYrYXpWsxceVtfRzY2i/7C3mOzAGC36/CpP3LTq4LAEsQJrT2WOxcwGvYxT4ZUXMEM9BoXv3rJdN9/ByV+HxFA8/hOQdtiRO/5LBrAxxamFjSzYlG6fS4GKqTj86X8eyKwGA6r0d3Y9LWP+++qQDqoJk4PVAYi3hf10ba6rWJ7WGLK6fwBskKk9GnIT/MzGgSF1f85Wp+Er8+9pZZ3G/hQA9dYMFpNbk0/sRwfQxwzzNEY1tmVVc1dDtP4SCfYPlNXNrU6TfTrToYGzNv0kQ4Unv1aGaObhh3pS3alVqe76g2Z/P16PcHSXpY40/Vbo3U= 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:smZX++qZw/7LHrDGOMm7lwLk7SCT19VumgLlVXOb805s7tFdBtaRojn8EMB5/8zvgTZwy9T3p2xzx1WkfGv2lOgflU5LFR6fO0Ofa5efQewpSczDVc2zBkdTEfuMvsMg4yOgd44SnIbS6zxKsYszOqP46BUsAVTMvABcjpx48YVrix0xVQX7lcR/rdUqr7wEBHMc0ZwF/36gYb7rELb/uQ3Q5nDlo5nZJkX32hubpn+BwBWLenWXf4lXkXUDB7WqPFPNJeOoZGiUfkScylCM1O1dXawpbaKUn3r9bvR+awo1GMJRccumOfcCHq7sTrb25NJCa5NjAMJHg6gBz3wkzlYDAofqrGv0q0x6HRfJnzxw5vbdSIHqomC9AJVyhTwCLe8NFBivvENTZeB6e1nZn1fP8WP87gY4zclOrtRgSaBpkfPBQAQXaYRhiVX7ui1mtAqR75GNuMNKxVNfjgxIVxapTqoCCadXJfQ6gN44405t1f/D16qS871Rf9WPPpzFuM6LPeg1X16qM/AHMPhSLwYNOeigud2DQtgKrAuvi0cFdHDl5c0usNUDElst0KkQomBZn0PCRMCrbiSMSRlqAcwV+OUxyD2X0hItIv9PFqN6OyCYhaIXVovfOP53MCAcZg3uXdKCtLobAiNnyOWCSL+AxFVBb4dAxDH1YYKruyEXM/Ly7DUNDCprrHaAKWvtuzHBrHwBiA0fJXgtGTplh4Fu6CM7fsXB0C86M0C/AwJt3T+DNfxkalk+JToQNzWM 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:xY2mhXrRhwZev8j7/HpzmLQ5YK6TR6tJdYkAPq5?= =?us-ascii?Q?YYEYdupIxJhkHpa0VnCUta4689TtHwCLzwcX243YNRtbN2WruciNlQQ/RIiI?= =?us-ascii?Q?1oO9/Vj2nyXwusjGrh+wIy0m+kZgBR7KVb6+uL1s4Jgt7KRq6UY93LtSYzuK?= =?us-ascii?Q?OjMidsFphEgKfzx+CHcMHPNb/hdSFTnS5A+1huYtIaszVgCaJUxzjcJMG8Of?= =?us-ascii?Q?v3C7b1PDpoREhWaY9jSmeS3voFstnGQ0o8suR/4rz0n9m90DDtvai+a01hK2?= =?us-ascii?Q?1o23tsbHVCVraOAxgppINYyW28H7BzZUFuTaxS23Xx14vZR2Kggs6GAvoprf?= =?us-ascii?Q?IBFX6RPrf0NG09ViV21NkK2JOtDuhlKYaYEI0OK7j4PxFQz5rlajDUJTHRcQ?= =?us-ascii?Q?LoLwFBhFGg4KGTvusYEF40cM/FMKcpU9MafOtxrQ7H+rPyOFuKhWFPuPAoWS?= =?us-ascii?Q?3OnfW5BzJbXdO5vzP4GzCkm5rNKYLUMnha+wDjCJW8LyWMpT/Sdr0KtDlTNf?= =?us-ascii?Q?efksEGc2Jq+FInfCFR9v8mcJVQSyVYFny9cyIH351An2inlrQx6Qm8ESZ0Vl?= =?us-ascii?Q?+yZW2whc6Ghr3Rf7y7lEZTxyjU5uPFf6Gsc01VA0cxtaoCtggLfpw22pxo/U?= =?us-ascii?Q?YDcbZ+VLgG9L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evymHB+CYhv/UoXOP3qWeHw4nLnntTV4qfRkERSadK9oOxOfNvocNA==; 5:Z8Q6UfC3UXqSy2SP0SUv71tCYkJixVlcddDtHfgAu/WTlysImQCARmzPQVGq6XBS0gs/mDfP2S/bCInFHAvWWluL8NhLmsoALj++GArYiKYslq0bv0SnKu+szINKax0/lDA+THLfCzHCC7IEhhHPRoWScJzjAs0TTt/Af0f8mb4=; 24:enpDnvwmBIOXtzMsb8EJcQouYFBcqE98mifQTdch1p06xjq+q3RyaOF4pbQZCmGYN/d6hdGUF6DeIuqqItfvsiMgigIwHZYiX1OLwThWBFg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:pnV9/c49pUC540lxD7oQBierFzb2FdawV+ABWc/wzF3Gu+dcohH6VcoKTgA4Fw+FGvc3U0iRhcGTK7evRpLTVf5uHFGmF9Me8DwiJMoIuEyG8XaT+mpuMGzZv5oihAyyw8yBQ/Wda8/pqpktLHfy7ZoBeJUPeWAb3xwEOHF8BQ9TJD0ZmmMd+79XJJQ/rgvDdif/1R9jvGkHO4YjfCNs0uVpDfU7p4MMxk5JI5h5VapmVjy/vHeozmFKoDSQhqVQsdEC/SK1d9FHM1oshppHwUu+hAebg/RfTG8NFyDRPzqCBhFKlwQ0aoKGr3ZV8pVjAvTEZU/w7dsUdNaFLLiY6g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:36:09.9115 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 09/38] event/octeontx: add support for event queues 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:15 -0000 Pretty much everything done in HW. Need to configure the priority associated with event queue aka sso group through a mailbox request to PF Signed-off-by: Jerin Jacob Signed-off-by: Santosh Shukla Acked-by: Gage Eads --- - Remove RTE_EVENT_QUEUE_CFG_DEFAULT flag to sync with next-eventdev master --- drivers/event/octeontx/ssovf_evdev.c | 63 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 2 ++ 2 files changed, 65 insertions(+) diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index b66d957..a6a2202 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -89,6 +89,36 @@ ssovf_mbox_getwork_tmo_set(uint32_t timeout_ns) return ret; } +struct ssovf_mbox_grp_pri { + uint8_t wgt_left; /* Read only */ + uint8_t weight; + uint8_t affinity; + uint8_t priority; +}; + +static int +ssovf_mbox_priority_set(uint8_t queue, uint8_t prio) +{ + struct octeontx_mbox_hdr hdr = {0}; + struct ssovf_mbox_grp_pri grp; + uint16_t len = sizeof(struct ssovf_mbox_grp_pri); + int ret; + + hdr.coproc = SSO_COPROC; + hdr.msg = SSO_GRP_SET_PRIORITY; + hdr.vfid = queue; + + grp.weight = 0xff; + grp.affinity = 0xff; + grp.priority = prio / 32; /* Normalize to 0 to 7 */ + + ret = octeontx_ssovf_mbox_send(&hdr, &grp, len, NULL, 0); + if (ret) + ssovf_log_err("Failed to set grp=%d prio=%d", queue, prio); + + return ret; +} + static void ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) { @@ -129,10 +159,43 @@ ssovf_configure(const struct rte_eventdev *dev) return ssovf_mbox_getwork_tmo_set(deq_tmo_ns); } +static void +ssovf_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, + struct rte_event_queue_conf *queue_conf) +{ + RTE_SET_USED(dev); + RTE_SET_USED(queue_id); + + queue_conf->nb_atomic_flows = (1ULL << 20); + queue_conf->nb_atomic_order_sequences = (1ULL << 20); + queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ALL_TYPES; + queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL; +} + +static void +ssovf_queue_release(struct rte_eventdev *dev, uint8_t queue_id) +{ + RTE_SET_USED(dev); + RTE_SET_USED(queue_id); +} + +static int +ssovf_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, + const struct rte_event_queue_conf *queue_conf) +{ + RTE_SET_USED(dev); + ssovf_func_trace("queue=%d prio=%d", queue_id, queue_conf->priority); + + return ssovf_mbox_priority_set(queue_id, queue_conf->priority); +} + /* 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, + .queue_def_conf = ssovf_queue_def_conf, + .queue_setup = ssovf_queue_setup, + .queue_release = ssovf_queue_release, }; static int diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 1c36923..d0f5d85 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -117,6 +117,8 @@ #define SSO_GET_DEV_INFO 0x3 #define SSO_GET_GETWORK_WAIT 0x4 #define SSO_SET_GETWORK_WAIT 0x5 +#define SSO_GRP_GET_PRIORITY 0x7 +#define SSO_GRP_SET_PRIORITY 0x8 struct ssovf_evdev { uint8_t max_event_queues; -- 2.5.5