From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0052.outbound.protection.outlook.com [104.47.42.52]) by dpdk.org (Postfix) with ESMTP id 276AB1BB4B for ; Fri, 8 Jun 2018 19:26:05 +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:X-MS-Exchange-SenderADCheck; bh=0S4P3aWUGEt2VXePOfJbhuM34NPoIDzd/LaKHMNtY4c=; b=Ochk7uLxDEIx+nX3aLwF8s+reUVCtrKPgkATuzbUMFAIdCxSTKXDkIp0jkGSTC/yN2I5ALDS4YLK2MfTmP8utMIRw+s8WvmiPuHX9j19UqSH2RVdQGPkqUth9bffhcXXW64NAgv8vhqM+f2Znk2aPaN0x89hOIFEZ8aQQt5OWeg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Fri, 8 Jun 2018 17:25:58 +0000 From: Anoob Joseph To: Bruce Richardson , Jerin Jacob , Pablo de Lara Cc: Anoob Joseph , Hemant Agrawal , Narayana Prasad , Nikhil Rao , Pavan Nikhilesh , Sunil Kumar Kori , dev@dpdk.org Date: Fri, 8 Jun 2018 22:54:17 +0530 Message-Id: <1528478659-15859-19-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::12) To DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4906; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 3:EjU+foOvre2gfy0PyryRxZiA2fniKn2AlHMZX+kDhR9DaNEXIzjqPw9HEDTkGt9vSPjsrI9juHiea//+9P2lc1L7PT1HcJY4qrq2dBn7F3HHOhVUB8EEPLPZ7ZI1fuss6pqwtVojPcdQ3kIRceeA0U3W+BGVjG991AtbuZK235WgVMClFnQ2DNqvcuiRyR/lAhz47DZJKc14x921I7KV/aJtMP4sjhni6A5KdlEGkpCAPnnaiPjM9C0c2hfEPX/e; 25:9ZLo2QZ2u8ZRUkEcUQ/hazqOwDf3IsBtDW+24G2Gi+tiHhGrTQ1uOPILgWJehio7B2eM0fHvu5bOXirL8kF7FyL5OXGGEcBaciAY5NY/vfBifXlSvCGBaJSFrA64cdyjsU2EJObqm9Echgj822TlxSM+1QJ/D4PtdG3WJBOoNXyRtGEeTEsK3E5JCYsjml6GwQyCloB4PGdbFA7f2FpnKJnc+v/4BX4sNzQve3cxkzZqEGn5DuN76RFTAJOilTQn2Pr/acXsfA8nsx2WTSoxTCNxS0u+hsQHYhfoYTRxOjqqGtWpyQ7/0BfxTDMXL0l3+dzdiutpXuxiCojO9GQgkA==; 31:ZI6SDiFnNeUBmm+WrPXYzhBeOHY1Hqa2M2sxTa/lbqkKqB3MenZBFsIKcY0k3U5RddNXSpEFUvNHgp/nlg57uYfl1gieo8XbHt/vlHJlojwHG8DwkWFwI4pO9zFIs4kuHjAbMp5fbjI90H+F36d8mBCK2yF/ExsGJNKbXjoIcDXjb6v/iggjTEvn0jP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-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB4906; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4906; X-Forefront-PRVS: 06973FFAD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(189003)(199004)(22813001)(186003)(16526019)(5660300001)(26005)(42882007)(55236004)(66066001)(47776003)(68736007)(6666003)(305945005)(2906002)(8676002)(7736002)(8936002)(36756003)(52116002)(2616005)(956004)(476003)(446003)(50226002)(81166006)(11346002)(44832011)(6506007)(386003)(486006)(59450400001)(76176011)(51416003)(48376002)(50466002)(97736004)(316002)(6512007)(25786009)(53936002)(6486002)(81156014)(4326008)(3846002)(6116002)(16586007)(54906003)(110136005)(105586002)(106356001)(72206003)(478600001)(8656006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4906; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4906; 23:HBoNz+I/ocOz8GLeagakYALeJ2OFm1uTBivimBFIJ?= =?us-ascii?Q?z0IGWsudDlxZ1k80aOC5FIS5CrIhFhsU56lju9vehvwrPtjW3qRuKvq3zdL/?= =?us-ascii?Q?4lVSkU4NTRkvMJ9JtrAeQ1C1q7f5tkFoXUK0LdELplVnZk6MPMJ06cklYsV/?= =?us-ascii?Q?fg1KNfhOEWpu2jEX3H8PeeHwwX4DcCKvmMxRCo9Q4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0iiUm157na0QmeKK6di8CpJaDxBnwvALiAIcaTXFkke79k?= =?us-ascii?Q?S53J2Li2qiAVOgYRQZpUsbbgpAAcAaAKlSf2DJXu7c61yCrvlNxQVpYBQYTJ?= =?us-ascii?Q?gfR90E/aHnkkR8RUY43xDWyw0j1VuQA9v6cJkOOJLa69JWduPRz/i21d/NvF?= =?us-ascii?Q?ADOH1st1xoOBhMuLdfYk31NBzoaFJ+ai5lo5Pi4oekj1w/nLuHJ/KKzIT8NX?= =?us-ascii?Q?7TJhgh//nqxfCeQEogwW6H6lQc/m6nO/0vLu3Vu42Gx?= X-Microsoft-Antispam-Message-Info: auT2x1/ehFN1hFWyi216ix39sRAWub25rNfXeObdivbazcBwEv+Ex7ubGdFXUBe7KwT1KcVG4AR+UMj2G/s5W448XKxgCW7U539g9ckS3mjM8rSAOgEWs4GSZewfbthcNJBCCngHEIGLcDo9SSn3lJ7x9yNAg2aQrJz+kgpfxbaMdFoWgDIk16aE3wHf/tfSwH7DbzKAgxaJYoqNOqY+6A== X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 6:hpjpuqCDLVlMF7MKPdw6krXhcUQ79tx0xoWJKo2VQBvq7ZWROxxnUwMReZjI6+sLNtDMaJ1ZOD66nSNv9fwfV7m/SdRjx8zl0VRGdunLQTxzzFGt/BxveX2tsxiojaau8OzvrZ7Y2bp81C4S0+AtjmmjijzDpQ42rGZ5huIk8nxx9pBc2hw/EoLmo+9y+M6lihsW4bJlS3GqBuyARafPJ7JCbfflsFk/FYy/qdudsYamZ8XampkCEr1tBR4IEuhnJM5gr9s2Y69nQIBMJGhuvOdAypDqd3rIA7bEpFbAKOND0er8RtktTOQTPrGTIHVWL/2k8eG48zzRjAGHCDKIlwD/YEvTHIEns67Rs757LdSSkixP7yfMD0qnnpfqk9meOgBphQfLRs2fUWK1G15NoaWm9Qu0fD1I9Opje/yCM5wKa5t3S4b470ebcQoYhRzsHxVDIp+qsoqpOckaS6ALFA==; 5:SsrRiGh7e7W1CdaGMepczzJrx4StndyoN8y1YVkO/1MLIN83ztAahMfv2J4XH3wMgh3c1Y6+0g8XRCxPS752SRG4t3KF8MppsvDFI3XWmJpcMlPjm/QpvmUWxq+m9/i8DPGcs9780JG9NjWF9Mv+jNIx6KxD61jGI/D+ITh3pCY=; 24:uUHgBOIOQ0YeraKAAVLsAdAhwnXpF7THPH07DJYWwuOK3dysV70N5HSKjvKhzhNO76Z6UR03huOaUSuqjlzGjNhdIl+H9Ovs7m52uRJ6OIo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 7:9QBK4zx779hirkGt4xgqbo+o41ovxn3VsK17+x45ejDJzct3jvqJN1VRMqymGmY17/6IIdHlbgzxznXBVFozo9nZ7EB+zwbM3aFtJpKIhi48y2wRw4eT1XBL/1ugHt8E9fofFWu/80uZ5svcmqaGstLAsJE46sGyOQVUzHbrTIGu+pSGUgMOT+p2dSccexye1rSz8OVG8dzHh9rQ832JO+jN44Vj+VnXpc6yj0geS7yFYCAOMDR2Rzi/DDrtj4K4 X-MS-Office365-Filtering-Correlation-Id: 244aa00b-2ec7-4eb4-45ed-08d5cd64e7f5 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 17:25:58.6546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 244aa00b-2ec7-4eb4-45ed-08d5cd64e7f5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4906 Subject: [dpdk-dev] [PATCH 18/20] eventdev: add routine to access event queue for eth Tx 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, 08 Jun 2018 17:26:05 -0000 When the application is drafted for single stage eventmode, it will be efficient to have the loop in the application space, rather than passing it on to the helper. When the application's stage is in ORDERED sched mode, the application will have to change the sched type of the event to ATOMIC before sending it, to ensure ingress ordering is maintained. Since, it is application who would do the tx, this info is required in it's space. Signed-off-by: Anoob Joseph --- lib/librte_eventdev/rte_eventmode_helper.c | 35 ++++++++++++++++++++++++++++++ lib/librte_eventdev/rte_eventmode_helper.h | 21 ++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c index 7827ea6..7f2d269 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.c +++ b/lib/librte_eventdev/rte_eventmode_helper.c @@ -957,3 +957,38 @@ rte_eventmode_helper_get_event_lcore_links(uint32_t lcore_id, return lcore_nb_link; } +uint8_t +rte_eventmode_helper_get_tx_queue(struct rte_eventmode_helper_conf *mode_conf, + uint8_t eventdev_id) +{ + struct eventdev_params *eventdev_config; + struct eventmode_conf *em_conf; + + if (mode_conf == NULL) { + RTE_EM_HLPR_LOG_ERR("Invalid conf"); + return (uint8_t)(-1); + } + + if (mode_conf->mode_params == NULL) { + RTE_EM_HLPR_LOG_ERR("Invalid mode params"); + return (uint8_t)(-1); + } + + /* Get eventmode conf */ + em_conf = (struct eventmode_conf *)(mode_conf->mode_params); + + /* Get event device conf */ + eventdev_config = internal_get_eventdev_params(em_conf, eventdev_id); + + if (eventdev_config == NULL) { + RTE_EM_HLPR_LOG_ERR("Error reading eventdev conf"); + return (uint8_t)(-1); + } + + /* + * The last queue would be reserved to be used as atomic queue for the + * last stage (eth packet tx stage) + */ + return eventdev_config->nb_eventqueue; +} + diff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h index 1d8af44..be2fe8d 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.h +++ b/lib/librte_eventdev/rte_eventmode_helper.h @@ -132,4 +132,25 @@ rte_eventmode_helper_get_event_lcore_links(uint32_t lcore_id, struct rte_eventmode_helper_conf *mode_conf, struct rte_eventmode_helper_event_link_info **links); +/** + * Get eventdev tx queue + * + * If the application stage is in non-atomic scheduling mode, then it would be + * required to submit the events to an atomic queue before tx, so that the + * ingress order of the packets would be maintained. This tx queue would be + * created internally by the eventmode helper subsystem, and application + * would need it's queue ID when it is running the execution loop. + * + * @param mode_conf + * Configuration of the mode in which app is doing packet handling + * @param eventdev_id + * Event device ID + * @return + * - Tx queue ID + */ +uint8_t +rte_eventmode_helper_get_tx_queue(struct rte_eventmode_helper_conf *mode_conf, + uint8_t eventdev_id); + + #endif /* _RTE_EVENTMODE_HELPER_H_ */ -- 2.7.4