From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0051.outbound.protection.outlook.com [104.47.33.51]) by dpdk.org (Postfix) with ESMTP id 62BCFFA6A for ; Fri, 3 Mar 2017 18:29:45 +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=u58kH6FOToit1Hj6nx2etyAR13feXW/9fyZ8EuAY57U=; b=DUtHRgQzXftEUE01e33wy8Ci+ACt6V1+8z7wa2TL4OS9YhtP9AnQ9B+g6/q5nSmfF+iDjEwzefrEXIlMBFDlJmwSl7kBux/s15JAWdwazccQoGmRJeqqW+gMrMwCPmbwHGs+efXUHhU5i+2FMAx9abU4nuqoGnBCd08ReTo2Og4= 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:40 +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:54 +0530 Message-Id: <1488562101-6658-13-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: c7b12c69-1764-40ef-0910-08d4625ae1c3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:mmtW+kNYIkViZS9iQOkzZbcMvDIdbKuVeBsZlTATqB9oZAPgQtme//T62yokkB8t9b/ngF2sNo7+QS72ksY+peos5UPj1VgNaWkiynlDbp88VGuvzSTQ+cswMd6TO1GCSbaQHZ1oxHE1GkmXOXpJhYmaAkfvRo9wPVSY4TLjxsHfSPfHDMJbcXYb0KNny48yp1tAcI4aCxom0XTHF88RFy8LDxCR97yhPa8RL17Gph2JQNOdBy545ZxdtmnFIHDK9gjYEQ8KasgrVzhw4KZ7ZA==; 25:EKwgF6qHykfciMdNXobII/i8fiPi2KSWvyQj4UbNYHn+PLT5NMHZBUwgR/GmyARZJXbp2MiCAj8ui3ZdNOg/XZ4RGiLBtSOPLDPLe84ppJ+BvMelS2ofJ0F+CKtYmLdRipPx2CNGlF39T4vv21SAfVPnyiNvytYeSYBbGStcDpBfUIJ3MXHZg/6Z5SCqq+ohIFJ+d7pwSC3rrvjjeJPdLOWIykUZJSwswLEtAxETOsow2p50AHAVFHvxVdmptzUkXsUJCKmAV+chTkVv2fxDUA7Q2OioBCUD0Tki6EINPywXFAOk34qCv7RNKi+rAhRPHApl55KS7zmI49S65ztvp3DlME4SKNciwth3qdVwXBVgOz6vmuDRIdpx5C/Q28MEMWcquapTRSybtd+50nusDvDkmYrnymeJ1gPmz9su4cVwqQHYsFWSevQve46fpU0aUo6GOX4YVDysD3nYigW0YA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:WdX9EitaZUqzgeg2X6rElhhzqcj82bI7/Ilvzq8QdAc5i5rKryfHAyB+POCJOFGjBj7lCQBWs+BZ8GVLLV748qvl2GGKGzvaX42/69vSExq6fYuVG9MS6KXunFqyUKw8LQlFM+TD3ihP8D4bYW4P5mZ1eMT9FIdNQo0o46xwsBAWY3IL1Y02xi5PqiN2KnIPRm0fj0VszZTrAf1Uw8FlWALmMCrO7bGCYqICRtKeSKLYDk02esQ1GeJ+bbaeSgEJ; 20:CaI0JLhOiuKP03bX5j3SfUbc7Hf59XeYelbvsmQEyI2uLax7Y5CrcLp7fJ83jYE7/e/4L+jRFgKA9yfCOgFTAE6vuYjFseTQjCLXxEf+xWdajDg/1J57N0VG/phQ7lQMUYGqjaLaDzeoUTSh2BdfQ0ucdzWUgkJCeOMuz3BHbgPH2bny3NZ94PDVIQMDAW9hNurwbXDMdVz6DtanD6mHsOgFE3VItMitt94COFrRNa1TyHm/jJ+YhxNwnPxfbt1CJ2aDvXWfSuPfdHl1dz/5KXyXrPg5mCbma+wASvYmuwWtoLgzwnZ36DiHBrKZjfcoKBi3sDsefcKUUNHRP3fpPGtlStmN1ju2QHFmfg2bjNSgmSrRNg2oTXUsRJD3ypALPN81hUsM6mSM3zrwmKJFWWIhLTuq3Jf5cNV+2RQ0VU0T3m0In7iGt8I+gkRQIjd4ZiCkZgfJArOprKjKLn+wLSlb5x4dM1cMt8gxPUFxVPW/hLEbzQI+Uj7ce8O4Hs+ZHLpGUCFBi4dTO9YnYer3b5jYHrC7QEbRBOrzj4TsgGykiZoy79aGP+NrT4RQS3v6B991W85PfA5TvkDDrjwj0Ydkbi9A/1HM6BH0R1dWKdc= 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:5XAm3vPcil7M4FY9RWDDDdDZYx4WqJQDM7NrwdhcC96rKzpihB9J5Meh1gn9uJPQJGcP81cR9PszbSZVdBb3yngUhJRel8gbWMl1xt6vAoJNWRGW+r4YF+lOz896L6J5z1vvUlChyeAJ/oMJOzmQLlnj7s4QCZN04sb3q9Jw12vuPRAUqcdJsQhGSiGNpVUAmUOHQp5WntcY+JM92wR69nzQCqr+B+bMs2b29n6jCJ1xvc8JzPASb/90Ii+PW33FPV41l5KKGooR4W8pJa2xg1Dv7yf+9I+DrdrxlfDa3uTgPFaYlufeDNuvZEVlbMOgak+xwmKzMfwDLSXKPogdLFzhx0r4QwOBme81GH2nwIbtlf1+/Uddw6bfQqIz8iX6nnabXSrg9vVfiljwO41FlT5sEWf6s93GwIZP5AfswZ7Hkml9wwi9C9W9zwXGMO0y9Mdhm88iKjqirQTTT+mHA+z+ymKjahHChXQx5ePGCaxIlvGlXm3aNAx8OhQJYq+t8JSdYpmsIJ4pHsubZY1Dr7jFAafN83vPto8767Uk+IMtbZQxMCwaHjl0/y/bWPdVA6L77jnL22EBslf3mcEAlv0hPJtA+1/OdwWwaG06QsQ= 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)(575784001)(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; BN3PR0701MB1719; 23:R4JEWczfANOjSTWeNRcnsxvcJB0aJTKvTV1+Pbp?= =?us-ascii?Q?Wav76mSDsmscwD06zd93X/P0+KdVXIOg8zUtpuarN4FKzK1G2avyQWCIXGlB?= =?us-ascii?Q?B2011EPnGFQQy7NYsK4bn+i8gmZiHbdT0s6UtuOLITe+U02L7quuaC/B8Qi8?= =?us-ascii?Q?jNBQOiooW3FLPPZzlw90t5D2CIjmD+rOnUPjRMqCFhi24ICbE8pfBEmYfT6/?= =?us-ascii?Q?31nLtcF72iU5f6AoGy0aY5VT3G5R9i+JjmQs6BTkCeEcRxuvkYuT/MjMbhsQ?= =?us-ascii?Q?L0TUveMSA8dOFSedr5QY9R6aUosYqtgZQ4TC4TAqrEdntX+JYuHdzEN3us4A?= =?us-ascii?Q?h7w0YiC9BOLNwgeVIuDj1C78y/5psVmGY7qAEYIhOoXixHsBbFqYaTDFCPIf?= =?us-ascii?Q?/YrObua3u/lQphZpqT9Nwsw/OuxGDfnsKUVa+IKWBsYYVa6lMxSrsy20iBF+?= =?us-ascii?Q?DdNBojesRZ+ZcGTuELBtcMouGW+ltPx/Fa9vp2x7OubsWB6+wyjFiETLYaIa?= =?us-ascii?Q?W2m4Q+XON1nzeugebEZP3137BR9rVWthroN9+mQhOyKVyj+z1kdWMsYwbkl5?= =?us-ascii?Q?TsXRlz0gwDhTSXgbWhY1NX4kW11n2qCLW3vTOzTglNePx2akA7IAXICfpTXG?= =?us-ascii?Q?FHK5gg4W/nH9nwd1Yk2l8XCVrPY789zcq+9FjtrMMYT0qUHjRqNzDgImTeka?= =?us-ascii?Q?HZnykEWxKvFPVk4wuTsThahHrw8lbrB/55n0OHii976Y3a2SlU0BnB5NyDXJ?= =?us-ascii?Q?QLnX0Y3loIqDDeUlCzaHV6DU6IoYcbUtPZN6Kxw70DZkTgWb0S5AoHk7/8nK?= =?us-ascii?Q?Bp/X7BRB3/dZ3yY1DiP/TwIQHxaVLK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GJJf6lbmo/PJTvv32/hAwPZTGqzZPUpGeuzCLJ1TA6EN++FlvroXWY4dt2gwtcGv7qF8euFA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:j+tL1nqfVG+VOYVrrPlhxPw7HgIeuuorSwJKLuKXAMiV3IeIC6aOMiKZH7UIBT6d5BPLQw75s+TWE1N4eZpNoYFmrI1U1/e32FbYwrvmG1DobyzhYz1+CSlVGz+iFczXjHkJ03lPmRGI6obrn6m/aoaiPUSsYiXPeOYGp0X78xzwto23P0hJttgGf16jY6IMqpAYYgkTTUXye0Dq/CK98+jEe/o5U03OJsdLeEBCCaglX3hWny/fmvL4D209zdyYLfwdipZxSh+CZwE0Jj8nXJIUTxWHJr9VgMAjDbcbZjtLy9rSApaayuMs6qnVlBxdfImRXfmHjG95+YF2MTdcVw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:29:40.7190 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 12/39] 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, 03 Mar 2017 17:29:45 -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 --- 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 b59d721..8474b90 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) { @@ -124,10 +154,43 @@ ssovf_configure(const struct rte_eventdev *dev) return ssovf_mbox_getwork_tmo_set(conf->dequeue_timeout_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_DEFAULT; + 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