From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0066.outbound.protection.outlook.com [104.47.34.66]) by dpdk.org (Postfix) with ESMTP id 4DB5B1B2E2 for ; Thu, 12 Oct 2017 15:16:07 +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=fboj3mgL0UPtyGdtlLel8Jf5ka8tVU/N/yrpBssmnAY=; b=LQcA5WAF7X8Nc8K5yMZPRLm8LHxBtJEpQajmqsQMDidn4aFfgcV6cy4wuwH3X4WuZRMPvwZ9ue2ZcJ1ggUO3remzjdTEO8i4yUGRMKJ05E/oSaAQOwoEEIyWSVU3Vj8OwmfR6kDzqx41BLxzkxNahd+WRGzp41WTqgn+FF7nJh0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3471.namprd07.prod.outlook.com (10.164.192.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 13:16:02 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Thu, 12 Oct 2017 18:45:45 +0530 Message-Id: <1507814147-8223-1-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR12CA0033.namprd12.prod.outlook.com (10.172.49.19) To MWHPR07MB3471.namprd07.prod.outlook.com (10.164.192.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5441edde-14ad-4167-b7e4-08d51173643e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR07MB3471; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 3:jNiv214C1xQVadQSPTTrc7axo1ASKD/QkvBuhQP00dJY6HRJyX4hoTmf4ux0M8dvv6Gv1gF2RkAQG+dIsAsw4B3dusF9zbQnD5HdTrUOO7gsA1YuOFjVepUefnDRBMXz/RckYZdO87Ze6TTQIhEJ6jZClMvaRtcbj7xmSU2LMM1Pwai5yvLjE6Z8OekVcmBIPPmJ5Rzw246fzunOeuA2x4Z4kNo8u5zwF/mKRrz4PpyAXDTOm8e+Mk/kp3xCtqME; 25:PMxZeq7Vy9/7lVidwnJ3dejYUgEgP/8rv5S13uSrkHtQ2sytlAVEP06wlFgIJrwEKmR8FSkDJ36D6JinOLfcAgVO3E+H9BpXBsMJcbaVfA5PJtOsboRC5IcmNt+2Ed6TL7tH5KSj83iSIxEIUIJnB86bcAR/IIhMAG1bJ+itw0KlcJ0N20P2wdkmYKCh6VTlAG+3GxKsmPJnyPGBTyZQUqd1kknjT9wD5sgR1oSmzi6/9SY/w2UCahqc4s3hGhE3tySicnMGA5lQit52WdAaf+1a/6AAMr3fHdKYnAevclgKulYbOo/5HoYrX4dzPB6oh/IiCvrSXNwGYBFZgPg3Pw==; 31:zGxYNVe68hABEyodHSNZwCdM/LZqJTovm7grQuxE4hMAAic22AixFc/9E9Unq4CT2W2Pu0Mvpzdb0uE6GH24DSAOfsxVDT3+ZMkFsoeQMjmmY3R9zq6Ae4fHW2WDYPf2K7GChOiTbJdlCbcVkT0PBpE5oG9g9H82vMhJk6CPObaNlXQ+GEKx7aamcQYa2xiol3keTYvDu5uUqka+cWFY9SgKAr1WlhlP0qqPgg4ZLE0= X-MS-TrafficTypeDiagnostic: MWHPR07MB3471: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 20:L6eY0wt48qosIVqJF7QeRzskECAvLr7cnRJsb2tFjVKEq3hcwiRhcw0oU9gUaC9AbWJIRIZeH+HhBvuD4DFH78NO8cN6/hAzni0lfS4VLYwS/ZNaG02hmTGNU10m9HoQrQ0WPVOworueRsntH8NErAe1iGhp0L1ensJW5c2yENVIfDlb9SBOwiKqMrQV6UohrHMVEmzC68zpl3RrXaqkDCv88L4Wpd+gSTDgPUCGSz1PT5yaXl28sKD7NgE2PP1k6wvMSv83RAcaqRUQy3eYEkGf1JGs24dJxG0+pzRHGzou2vjXlthWd9B7KCAZQ0nQJv29c1Z0quT2N3K8ZlmDz17q85BcHa8ZON6mMD4agVTQjMGaAV04Uzaea8Hl8Rn/j46iBk5fSG6d+u3I4k1Y06h+ESYJ8fFtXgVq3AsnjQrN8vAe9lpFtgFkYZAq+tf0U4AwuDJSrNY3xS+IEjXSs5JpzhJT0IlCUDE4065YCSpiA+Zk89cOf2T5WRh2bZnabeLvZ2l04dTutjY2pFbrEN/cJTlTTdvUY9IFLZld0RhpSZUwerHgUSlLsdpCRhVIpQCyWOcLSe2qS0b4vmkWw7TltuDHVMnpWaMSaVSyt3E=; 4:wn8F0upe4vViFHPpDU+BzUvakDrOHzHC4mkedYTKtbSHkL+xBRYbxSo1/HmKSHq29U2Z/lQ6iqqQ391M2Ip3Gvq65EQ6Yb/AFPl7NKSbPE6WlPRAVj6Vm1zD284EzdAkbPZxbOXWaseTBsGV9Tat8bv3ioERo5batmaGlEo17li6+f9sjt2vWRubpBmbVRPWGnLBhbmtbHRhoBQeZPWRem/AGI2bqoP82DtsEKNTT662xWGSpz8WSlNnqpGmzum3 X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3471; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3471; X-Forefront-PRVS: 04583CED1A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(8676002)(5003940100001)(81156014)(69596002)(105586002)(6666003)(53936002)(42882006)(305945005)(33646002)(106356001)(66066001)(25786009)(8656003)(7736002)(50466002)(48376002)(53416004)(47776003)(8936002)(189998001)(81166006)(6506006)(36756003)(6512007)(316002)(5660300001)(72206003)(97736004)(3846002)(6116002)(2906002)(50226002)(16526018)(16586007)(478600001)(4326008)(6486002)(50986999)(101416001)(107886003)(5009440100003)(68736007)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3471; H:PBHAGAVATULA-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3471; 23:sFMXfRsagrZYMlA9+jHdOlw/OUYZYEZS/VeFYCVQa?= =?us-ascii?Q?8DeSQvWjA9WaXH3qhqbz7EZL7PATN/Jr1L38rua/24N2Ip4Wvr6a36+rEIBV?= =?us-ascii?Q?0aeS2hKDgWf3vrpq9cAofZ7futIcoIOjNK43m/Q7v/XtDdPl5zQ4822xcs81?= =?us-ascii?Q?1wX7fQP0Kz5Xfh4qPVBhN3MJewY6PBuxC+4KqX3uRu0mc4pBRPJpnZTrlhj4?= =?us-ascii?Q?L5Y+hPt2rlp8D13rd0kSJouiHMjY9odNYkx2V0R3Y80P1yz9jzByGq3hdozm?= =?us-ascii?Q?5i2Qx8GChBqseSEhJEsWUrLsq83CSQ5FGpeNviSKFwD/Sl8A1qrJChd+8neZ?= =?us-ascii?Q?V95MYIEHllwuYrObj3dSsLYo0pygCLbXoqZi+2aUQMe2ycAqlPYEouDr6Dgq?= =?us-ascii?Q?jhVBaZ4VMBJgTeCDiDxaXIW8aI1ozw0VD2HbYGC2FQhCaUPjK8S+OqbHn2Ra?= =?us-ascii?Q?CJXEDNB6orL5q9vQCfEvNGnb9hXFX1e4eA8I4iKUf7XyUldcSnK1HYMe04Nq?= =?us-ascii?Q?wvTFn5Ilhk5h25TaWiZTzoNNq4TLzheBeR7tmvrTfHn26sgvmkdmd9f8A9BM?= =?us-ascii?Q?+UXmasQ9JqMtOP7f1K2oXnLSFMRmprCXNzviaZgkuJVzUt6cyomX+T6FKogI?= =?us-ascii?Q?vA+pW7rPMWEdSojnkdxGvnwPsdj/Pr0l3c8RGHb0hBFay3GFsCAiuO+qbjoG?= =?us-ascii?Q?jaRWiycTsx0CD+pPrph4RskZcWPZjmnrjVs9X71i06N8QIKOmfGtaNCeYvuk?= =?us-ascii?Q?ucIxH7MCUBMh2YdoEMTywVR1yVejGIVGW/5LOERGHnPgb3MhU6LcketC3vVL?= =?us-ascii?Q?ZQxPf65ShjcIf5ME4H/cJxR5JCZiwQLo3eyfY4IA35ncfzHLIz56LP6alrhC?= =?us-ascii?Q?ebQJubglB5ccnR5ed6If96lGWpUyJiMY9WnPHg0K5/jylXFKSoIkZz9ZQXLc?= =?us-ascii?Q?IHdB5lUn90aILnKvSZze+WqYOWvPLUBauj/ievliXvy9x4KhrKjvKeM2NwbX?= =?us-ascii?Q?lclqT3bk6Pz3N3n7ahAyxOaUX8Cy1BXMoxjL9NzYrRwnwUinuToMySw926hD?= =?us-ascii?Q?PScdThx1xnQWw0EcVdzBfc7G+43GaNS27akLik8jzMBHT7JmGJQB/x5Yj2Q/?= =?us-ascii?Q?Rkwp8Gs4H8j7ddiAi95+mLP+1FUdwrqImS5BWNQftX5fF0nNMdMNA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 6:GJszCKh4S31AycFI84zUV0SUUnLY83UABZ8nlLGPOP3mK9HjlmMJTjkIgMV6TWpyYI0XNv7P/10WNK7gBvFBt71rTvjcCgm2ikkbEQ04AE4+99ax7AK1RikVJu/uinRQzTKBC3ERc59Q9rOfjjaxHAjOscVF/ZNZOlMbIe+FFi/xVKyMsxZMVwQmW80oQmynULaKZO2v4EkBfqt2cyOH7NG+ylF82HJGBhRtU5bG699X37SMcKPHBMjeV2nEzRtH4re1eVnJB+HVR+DnoS6o6d17c+7t3l5L5RojwCN32nsyvnHNNpRXXIQ30WFnvWltmQiWgq//M+NAowkZI7mOwQ==; 5:wlZf6kIGLOXuM3c7fhAnvcjiaQ/TfjdBjSPNXjS7A6Masc8qHoBO+KStdTWDWz3qRm9DWYl7UMe+uK369voiMAjhGK4AGoLbkL8/sCETs15B7/c3hjgKGJYALWuL1oqvOcyQs77oDW5TrclzAY1eLQ==; 24:5Ujjp1FJsVXacU5QRXOOazpEGs8+l98pFdsP3zMPuxRtcsbFA6vsFdf79g5J+lTXfmE2ljrZbNtwPSK6utFIilpqURVKZiaGCJtmmapFeMQ=; 7:LU3QZdC2njeYaaoTZLFbHGVaHpKfO2Xz0mSV5joUvQVjgrit7h2EbLmSVW7CG1OGIXM5yQJVQuWA1vzj6pZcaRw/CXHiQguzIuYPb06esjnmxN4T2DvQdiTFyGYnIhbvPHI7dCtN6jRqvBCMgho7lfFBGKTFcEIOwC9uFZ825DoO+EKPU2FofoDfLof8BLSiNKAMhfrmSO8fbTFrpCX6370HOcgps6t/tW9rMqlppeM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 13:16:02.7598 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3471 Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config 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: Thu, 12 Oct 2017 13:16:08 -0000 With the current scheme of event queue configuration the cfg schedule type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary conversion between the fastpath and slowpath API's while scheduling events or configuring event queues. This patch aims to fix such inconsistency by using event schedule types (RTE_SCHED_TYPE_*) for event queue configuration. This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to improper events being enqueued to the eventdev. Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app") Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/evt_common.h | 21 ------------- app/test-eventdev/test_order_queue.c | 4 +-- app/test-eventdev/test_perf_queue.c | 4 +-- drivers/event/dpaa2/dpaa2_eventdev.c | 4 +-- drivers/event/sw/sw_evdev.c | 28 +++++------------ examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------ lib/librte_eventdev/rte_eventdev.c | 20 +++++------- lib/librte_eventdev/rte_eventdev.h | 54 ++++++++++---------------------- test/test/test_eventdev.c | 12 +++---- test/test/test_eventdev_sw.c | 16 +++++----- 10 files changed, 60 insertions(+), 121 deletions(-) diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h index 4102076..ee896a2 100644 --- a/app/test-eventdev/evt_common.h +++ b/app/test-eventdev/evt_common.h @@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id) true : false; } -static inline uint32_t -evt_sched_type2queue_cfg(uint8_t sched_type) -{ - uint32_t ret; - - switch (sched_type) { - case RTE_SCHED_TYPE_ATOMIC: - ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY; - break; - case RTE_SCHED_TYPE_ORDERED: - ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY; - break; - case RTE_SCHED_TYPE_PARALLEL: - ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY; - break; - default: - rte_panic("Invalid sched_type %d\n", sched_type); - } - return ret; -} - #endif /* _EVT_COMMON_*/ diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c index beadd9c..1fa4082 100644 --- a/app/test-eventdev/test_order_queue.c +++ b/app/test-eventdev/test_order_queue.c @@ -164,7 +164,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) /* q0 (ordered queue) configuration */ struct rte_event_queue_conf q0_ordered_conf = { .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY, + .schedule_type = RTE_SCHED_TYPE_ORDERED, .nb_atomic_flows = opt->nb_flows, .nb_atomic_order_sequences = opt->nb_flows, }; @@ -177,7 +177,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) /* q1 (atomic queue) configuration */ struct rte_event_queue_conf q1_atomic_conf = { .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, + .schedule_type = RTE_SCHED_TYPE_ATOMIC, .nb_atomic_flows = opt->nb_flows, .nb_atomic_order_sequences = opt->nb_flows, }; diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c index 658c08a..28c2096 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -205,8 +205,8 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) }; /* queue configurations */ for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) { - q_conf.event_queue_cfg = evt_sched_type2queue_cfg - (opt->sched_type_list[queue % nb_stages]); + q_conf.event_queue_cfg = + (opt->sched_type_list[queue % nb_stages]); if (opt->q_priority) { uint8_t stage_pos = queue % nb_stages; diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 81286a8..3dbc337 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -378,8 +378,8 @@ dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, RTE_SET_USED(queue_conf); queue_conf->nb_atomic_flows = DPAA2_EVENT_QUEUE_ATOMIC_FLOWS; - queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY | - RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY; + queue_conf->schedule_type = RTE_SCHED_TYPE_ATOMIC | + RTE_SCHED_TYPE_PARALLEL; queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL; } diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index aed8b72..522cd71 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -345,28 +345,14 @@ sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, { int type; - /* SINGLE_LINK can be OR-ed with other types, so handle first */ + type = conf->schedule_type; + if (RTE_EVENT_QUEUE_CFG_SINGLE_LINK & conf->event_queue_cfg) { type = SW_SCHED_TYPE_DIRECT; - } else { - switch (conf->event_queue_cfg) { - case RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY: - type = RTE_SCHED_TYPE_ATOMIC; - break; - case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY: - type = RTE_SCHED_TYPE_ORDERED; - break; - case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY: - type = RTE_SCHED_TYPE_PARALLEL; - break; - case RTE_EVENT_QUEUE_CFG_ALL_TYPES: - SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n"); - return -ENOTSUP; - default: - SW_LOG_ERR("Unknown queue type %d requested\n", - conf->event_queue_cfg); - return -EINVAL; - } + } else if (RTE_EVENT_QUEUE_CFG_ALL_TYPES + & conf->event_queue_cfg) { + SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n"); + return -ENOTSUP; } struct sw_evdev *sw = sw_pmd_priv(dev); @@ -400,7 +386,7 @@ sw_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, static const struct rte_event_queue_conf default_conf = { .nb_atomic_flows = 4096, .nb_atomic_order_sequences = 1, - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, + .schedule_type = RTE_SCHED_TYPE_ATOMIC, .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, }; diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index 09b90c3..2e6787b 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -108,7 +108,7 @@ struct config_data { static struct config_data cdata = { .num_packets = (1L << 25), /* do ~32M packets */ .num_fids = 512, - .queue_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, + .queue_type = RTE_SCHED_TYPE_ATOMIC, .next_qid = {-1}, .qid = {-1}, .num_stages = 1, @@ -490,10 +490,10 @@ parse_app_args(int argc, char **argv) cdata.enable_queue_priorities = 1; break; case 'o': - cdata.queue_type = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY; + cdata.queue_type = RTE_SCHED_TYPE_ORDERED; break; case 'p': - cdata.queue_type = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY; + cdata.queue_type = RTE_SCHED_TYPE_PARALLEL; break; case 'q': cdata.quiet = 1; @@ -684,7 +684,7 @@ setup_eventdev(struct prod_data *prod_data, .new_event_threshold = 4096, }; struct rte_event_queue_conf wkr_q_conf = { - .event_queue_cfg = cdata.queue_type, + .schedule_type = cdata.queue_type, .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, .nb_atomic_flows = 1024, .nb_atomic_order_sequences = 1024, @@ -751,11 +751,11 @@ setup_eventdev(struct prod_data *prod_data, } const char *type_str = "Atomic"; - switch (wkr_q_conf.event_queue_cfg) { - case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY: + switch (wkr_q_conf.schedule_type) { + case RTE_SCHED_TYPE_ORDERED: type_str = "Ordered"; break; - case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY: + case RTE_SCHED_TYPE_PARALLEL: type_str = "Parallel"; break; } @@ -907,9 +907,9 @@ main(int argc, char **argv) printf("\tworkers: %u\n", cdata.num_workers); printf("\tpackets: %"PRIi64"\n", cdata.num_packets); printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities); - if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY) + if (cdata.queue_type == RTE_SCHED_TYPE_ORDERED) printf("\tqid0 type: ordered\n"); - if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY) + if (cdata.queue_type == RTE_SCHED_TYPE_ATOMIC) printf("\tqid0 type: atomic\n"); printf("\tCores available: %u\n", rte_lcore_count()); printf("\tCores used: %u\n", cores_needed); diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 378ccb5..db96552 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -517,13 +517,11 @@ is_valid_atomic_queue_conf(const struct rte_event_queue_conf *queue_conf) { if (queue_conf && !(queue_conf->event_queue_cfg & - RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && ( + RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && ((queue_conf->event_queue_cfg & - RTE_EVENT_QUEUE_CFG_TYPE_MASK) - == RTE_EVENT_QUEUE_CFG_ALL_TYPES) || - ((queue_conf->event_queue_cfg & - RTE_EVENT_QUEUE_CFG_TYPE_MASK) - == RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY) + RTE_EVENT_QUEUE_CFG_ALL_TYPES) || + (queue_conf->schedule_type + == RTE_SCHED_TYPE_ATOMIC) )) return 1; else @@ -535,13 +533,11 @@ is_valid_ordered_queue_conf(const struct rte_event_queue_conf *queue_conf) { if (queue_conf && !(queue_conf->event_queue_cfg & - RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && ( - ((queue_conf->event_queue_cfg & - RTE_EVENT_QUEUE_CFG_TYPE_MASK) - == RTE_EVENT_QUEUE_CFG_ALL_TYPES) || + RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && ((queue_conf->event_queue_cfg & - RTE_EVENT_QUEUE_CFG_TYPE_MASK) - == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY) + RTE_EVENT_QUEUE_CFG_ALL_TYPES) || + (queue_conf->schedule_type + == RTE_SCHED_TYPE_ORDERED) )) return 1; else diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 1dbc872..fa16f82 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -270,9 +270,9 @@ struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */ #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES (1ULL << 3) /**< Event device is capable of enqueuing events of any type to any queue. * If this capability is not set, the queue only supports events of the - * *RTE_EVENT_QUEUE_CFG_* type that it was created with. + * *RTE_SCHED_TYPE_* type that it was created with. * - * @see RTE_EVENT_QUEUE_CFG_* values + * @see RTE_SCHED_TYPE_* values */ #define RTE_EVENT_DEV_CAP_BURST_MODE (1ULL << 4) /**< Event device is capable of operating in burst mode for enqueue(forward, @@ -515,39 +515,13 @@ rte_event_dev_configure(uint8_t dev_id, /* Event queue specific APIs */ /* Event queue configuration bitmap flags */ -#define RTE_EVENT_QUEUE_CFG_TYPE_MASK (3ULL << 0) -/**< Mask for event queue schedule type configuration request */ -#define RTE_EVENT_QUEUE_CFG_ALL_TYPES (0ULL << 0) +#define RTE_EVENT_QUEUE_CFG_ALL_TYPES (1ULL << 0) /**< Allow ATOMIC,ORDERED,PARALLEL schedule type enqueue * * @see RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC, RTE_SCHED_TYPE_PARALLEL * @see rte_event_enqueue_burst() */ -#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY (1ULL << 0) -/**< Allow only ATOMIC schedule type enqueue - * - * The rte_event_enqueue_burst() result is undefined if the queue configured - * with ATOMIC only and sched_type != RTE_SCHED_TYPE_ATOMIC - * - * @see RTE_SCHED_TYPE_ATOMIC, rte_event_enqueue_burst() - */ -#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY (2ULL << 0) -/**< Allow only ORDERED schedule type enqueue - * - * The rte_event_enqueue_burst() result is undefined if the queue configured - * with ORDERED only and sched_type != RTE_SCHED_TYPE_ORDERED - * - * @see RTE_SCHED_TYPE_ORDERED, rte_event_enqueue_burst() - */ -#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY (3ULL << 0) -/**< Allow only PARALLEL schedule type enqueue - * - * The rte_event_enqueue_burst() result is undefined if the queue configured - * with PARALLEL only and sched_type != RTE_SCHED_TYPE_PARALLEL - * - * @see RTE_SCHED_TYPE_PARALLEL, rte_event_enqueue_burst() - */ -#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 2) +#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 1) /**< This event queue links only to a single event port. * * @see rte_event_port_setup(), rte_event_port_link() @@ -558,8 +532,8 @@ struct rte_event_queue_conf { uint32_t nb_atomic_flows; /**< The maximum number of active flows this queue can track at any * given time. If the queue is configured for atomic scheduling (by - * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES or - * RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY flags to event_queue_cfg), then the + * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg + * or RTE_SCHED_TYPE_ATOMIC flag to schedule_type), then the * value must be in the range of [1, nb_event_queue_flows], which was * previously provided in rte_event_dev_configure(). */ @@ -572,12 +546,18 @@ struct rte_event_queue_conf { * event will be returned from dequeue until one or more entries are * freed up/released. * If the queue is configured for ordered scheduling (by applying the - * RTE_EVENT_QUEUE_CFG_ALL_TYPES or RTE_EVENT_QUEUE_CFG_ORDERED_ONLY - * flags to event_queue_cfg), then the value must be in the range of - * [1, nb_event_queue_flows], which was previously supplied to - * rte_event_dev_configure(). + * RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg or + * RTE_SCHED_TYPE_ORDERED flag to schedule_type), then the value must + * be in the range of [1, nb_event_queue_flows], which was + * previously supplied to rte_event_dev_configure(). + */ + uint32_t event_queue_cfg; + /**< Queue cfg flags(EVENT_QUEUE_CFG_) */ + uint8_t schedule_type; + /**< Queue schedule type(RTE_SCHED_TYPE_*). + * Valid when RTE_EVENT_QUEUE_CFG_ALL_TYPES bit is not set in + * event_queue_cfg. */ - uint32_t event_queue_cfg; /**< Queue cfg flags(EVENT_QUEUE_CFG_) */ uint8_t priority; /**< Priority for this event queue relative to other event queues. * The requested priority should in the range of diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c index d6ade78..4118b75 100644 --- a/test/test/test_eventdev.c +++ b/test/test/test_eventdev.c @@ -300,15 +300,13 @@ test_eventdev_queue_setup(void) /* Negative cases */ ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf); TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info"); - qconf.event_queue_cfg = (RTE_EVENT_QUEUE_CFG_ALL_TYPES & - RTE_EVENT_QUEUE_CFG_TYPE_MASK); + qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ALL_TYPES; qconf.nb_atomic_flows = info.max_event_queue_flows + 1; ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf); TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); qconf.nb_atomic_flows = info.max_event_queue_flows; - qconf.event_queue_cfg = (RTE_EVENT_QUEUE_CFG_ORDERED_ONLY & - RTE_EVENT_QUEUE_CFG_TYPE_MASK); + qconf.schedule_type = RTE_SCHED_TYPE_ORDERED; qconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1; ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf); TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); @@ -423,7 +421,7 @@ test_eventdev_queue_attr_nb_atomic_flows(void) /* Assume PMD doesn't support atomic flows, return early */ return -ENOTSUP; - qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY; + qconf.schedule_type = RTE_SCHED_TYPE_ATOMIC; for (i = 0; i < (int)queue_count; i++) { ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf); @@ -466,7 +464,7 @@ test_eventdev_queue_attr_nb_atomic_order_sequences(void) /* Assume PMD doesn't support reordering */ return -ENOTSUP; - qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY; + qconf.schedule_type = RTE_SCHED_TYPE_ORDERED; for (i = 0; i < (int)queue_count; i++) { ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf); @@ -507,7 +505,7 @@ test_eventdev_queue_attr_event_queue_cfg(void) ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf); TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 def conf"); - qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY; + qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK; for (i = 0; i < (int)queue_count; i++) { ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf); diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c index 7219886..dea302f 100644 --- a/test/test/test_eventdev_sw.c +++ b/test/test/test_eventdev_sw.c @@ -219,7 +219,7 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags) /* Q creation */ const struct rte_event_queue_conf conf = { - .event_queue_cfg = flags, + .schedule_type = flags, .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, .nb_atomic_flows = 1024, .nb_atomic_order_sequences = 1024, @@ -242,20 +242,20 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags) static inline int create_atomic_qids(struct test *t, int num_qids) { - return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY); + return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ATOMIC); } static inline int create_ordered_qids(struct test *t, int num_qids) { - return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ORDERED_ONLY); + return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ORDERED); } static inline int create_unordered_qids(struct test *t, int num_qids) { - return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY); + return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_PARALLEL); } static inline int @@ -1238,7 +1238,7 @@ port_reconfig_credits(struct test *t) const uint32_t NUM_ITERS = 32; for (i = 0; i < NUM_ITERS; i++) { const struct rte_event_queue_conf conf = { - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, + .schedule_type = RTE_SCHED_TYPE_ATOMIC, .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, .nb_atomic_flows = 1024, .nb_atomic_order_sequences = 1024, @@ -1320,7 +1320,7 @@ port_single_lb_reconfig(struct test *t) static const struct rte_event_queue_conf conf_lb_atomic = { .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, + .schedule_type = RTE_SCHED_TYPE_ATOMIC, .nb_atomic_flows = 1024, .nb_atomic_order_sequences = 1024, }; @@ -1818,7 +1818,7 @@ ordered_reconfigure(struct test *t) } const struct rte_event_queue_conf conf = { - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY, + .schedule_type = RTE_SCHED_TYPE_ORDERED, .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, .nb_atomic_flows = 1024, .nb_atomic_order_sequences = 1024, @@ -1865,7 +1865,7 @@ qid_priorities(struct test *t) for (i = 0; i < 3; i++) { /* Create QID */ const struct rte_event_queue_conf conf = { - .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY, + .schedule_type = RTE_SCHED_TYPE_ATOMIC, /* increase priority (0 == highest), as we go */ .priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i, .nb_atomic_flows = 1024, -- 2.7.4