From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0046.outbound.protection.outlook.com [104.47.34.46]) by dpdk.org (Postfix) with ESMTP id D24461B6A6 for ; Mon, 23 Oct 2017 19:41:21 +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=ZXBTRnYbSEpCTJYjFiWo5/WzLHFtGgdVaMhSR2EIGS4=; b=hBB2N4C2cI6JL2vzO93p2nr2croDzJFmy2OJeeKqJ1qWUpL0q2/5CfUv3p5qctcY1hRBUjO75hF9KuUEgD1W2EMjY7S71z8aGT7//oSAhr1wp12sdovogZG45QNTpawSOr6UfAxcDloErGngwppz1bTOL2uuKj4IPm9/IUuSgIs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (103.16.71.47) 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.156.4; Mon, 23 Oct 2017 17:41:17 +0000 From: Pavan Nikhilesh To: harry.van.haaren@intel.com, hemant.agrawal@nxp.com, jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pavan Bhagavatula Date: Mon, 23 Oct 2017 23:10:54 +0530 Message-Id: <1508780456-27837-1-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507814147-8223-1-git-send-email-pbhagavatula@caviumnetworks.com> References: <1507814147-8223-1-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [103.16.71.47] X-ClientProxiedBy: HK2PR04CA0048.apcprd04.prod.outlook.com (10.170.154.16) To MWHPR07MB3471.namprd07.prod.outlook.com (10.164.192.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6eb342ca-1687-447b-2051-08d51a3d44fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:MWHPR07MB3471; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 3:vGKs8q6wKrQ6hD+Pm8uyS3rIKN/Pp1sjLZMnPnfCD2nHFs3Q5ftZrTYYJZDDg9ZIsGCOGs+Q9ovHT+dGERS3JcSEyB2QYpgVSA+EAy4MttGNTktsARkwfL4d8f0dMgPzqcjAQJbeBI+DovK56UwoRzrmvGr5uGvLEcoDE7m3417LlacJsRkJHbMOvaJD5JjX4HDfokZMFc0KlmOIvorsUfvtEMyyg2efC0yughMf9lo8TcEwARAzMh1A56TzvNq1; 25:EwA0ZkomsJMoEVIBETdYinrEMNyVmNDeuieroVu6JvIxeCg67vLpaj4z8JVdlByCBSYEP28AtVogkzjqm/V0AYQFpTgO0ck+cNTAAidGgWEKufoVxHDj/3xkSmkwik88Danz8doiXFAynj96CnGOX2zTSEYMjMJEdAy9E5LJZaY1tzUeDlXBduFF7XQ2zQZsttwieBf0k0dFO22GkrRpqzGjwucnRYhyb6h30YRAXurRMVXKTkxz0FB7sfiKTPaGNVVb7noO/ylit/17QCZ1JmDVQhrtKCsTogeGMdAPBFML9VUyHDKKKGdrS6N08K1VfjEA69wekxzDD8zBaXOdyw==; 31:uowh05zrF9ymCSm71K5fxDyVlEVkfy1gweTkJ7N8rGTyH89FZEpKeM4GWg74U9EO+9TcUCU3pmg79ZbPst7/l+iyKUWjXPF39/PpRa1s93WI/j4f4BUQGvq6SSg6gatJHUPck5Kd300ZueYxKaFpp9yJTKMZ8ixPv261rah76kydC1pCgG8ffgNEfn7TvdPwjhdU8S9SIpKkz0FhaCEuiEfE7wMH8eKM+UV/wcntqNI= X-MS-TrafficTypeDiagnostic: MWHPR07MB3471: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 20:zO/HTOfVd4aWeHaXcq1MlNI69hJeBEvisYZWuAtkghorWvQTmn4ef2RpjHFNXS7RZIVhzQks1xXIo0+1660fuVpfgMHxt582cnkac3gZyYni9zC87JoAxNqhkYuazlGGJc+za2PpsNYST0FN9Of22VF3D/TN8RTmS2F39b3A82ZqtKWyHYRMaTPCLeniZxPafNhwLgLroro4fUky3Ne/LnDLT3ROBntho0HhhpzyCEX+uvqN/1wYz4ZZs9r9GDWDevpsz3rQZ7o2yT/vvmEiU8jJmRr5G9HKzUCY4KDAGkcJLLvciPWCZAQ9SqjQlGfOCTH6d6A5QCS4w9q/H8+fUoPX+ZDwNhg7no+0HDMcoKIdqQZcGx7GReuASXJKYSRefnH1aNpM2Yo0Z+DTOdnRaQzYWTGFuOuVZ2uP2WzyumdM1ghK26tMrRceRlppof1SitAZ7jWUe5dM+j1hfFpCOrRDKIIk717oq+XLbYRlh6ObjQH/5d/yKsYIKHeDzPb6Zsod6mW46AxbXONcIuTzYs4to5SSVj23FcaoNhQDSHgRjfeKQR5nbnaG8izo3EYP67g9I+BP3gH04Oico6q5k932WwDD8zPxZJUGYfB2ckY=; 4:RzbpPUZ84oIxnCXYuJYwferf2BudlLiiLMHQkQ8CxxcuJM1ocFJE/+OYiWsza91WEeWLMElNCq2KIqdceqA1o9WV+vpQgf6s/JGTrJ+GY7cGURT2fFGWPO3Pg33FKyrWy2UwkgUfSizHSEHdRWg9PRTLxk9GqmkksGzSx/SWbyRhfIOH2QHYCqG+dDaa6dD8Gk8LMed3Wec81d2F5U30qbZQvHZpN+0T84MOQ6X/UbhB3iRB6Hjv7mGymQZjlUqd 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)(10201501046)(3002001)(3231020)(6041248)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(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: 046985391D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(346002)(376002)(199003)(189002)(8656005)(8656005)(6666003)(2950100002)(42882006)(6636002)(101416001)(47776003)(68736007)(106356001)(5660300001)(33646002)(105586002)(6116002)(16526018)(189998001)(6486002)(107886003)(97736004)(6506006)(3846002)(5003940100001)(4326008)(6512007)(53936002)(7736002)(305945005)(36756003)(8676002)(2906002)(66066001)(81166006)(81156014)(8936002)(76176999)(50226002)(50986999)(50466002)(478600001)(25786009)(16586007)(316002)(48376002)(72206003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3471; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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:tZgDHhI5ftDa5wKzx0bmKGY6DLDqvlXp7YumuEC6v?= =?us-ascii?Q?1QuzOu1qeGFhaPM4sWJ7vaPWl18eI2EHWT3YIrzMY4bmQzLciHMi8NZqWPWl?= =?us-ascii?Q?QrelrXt3nCGOb2YxSngTM6ZHkQcbxHh5LKyXjpMVTgtY3QJBeZ0JlQy0FVIX?= =?us-ascii?Q?bbutSHSdBVQCTs0y/pR6U3M58scqjTleexTE7uGN98jUhKYTU+wvfBlgrl35?= =?us-ascii?Q?eWTRSRUC6+LhCXWgDlllz6pn+cG0EF7hr1Z90s67xRkmjfTZ0Y2ONLQZhmVG?= =?us-ascii?Q?7q0FTalTrg1Q26NPgndytVX8OklIHY7CIWVzs+yjPYRxUL2AAYmtsn4hw6Go?= =?us-ascii?Q?IIlbdlVKgii7n/R89tCwV+tGvhUCCM9vFFO5hkyC0R56YD8FtB3qt2AxOJlc?= =?us-ascii?Q?lWSHM010BV7bq0W1+6Kp+p988/4AWE63+sfn8uzhzLUOXJYh7xMH7svYYdNR?= =?us-ascii?Q?lNuGpkBwjHpM62Op7U6aiCwGMjt6Yb0NvEGyh3RQ8ES0siGVfsMKrDoJ2cKV?= =?us-ascii?Q?qsC5s9veMobNLwqKFeV0A8aWGY+0H1ROmtGFqPMOkTsM/h3+lain8n/xqanA?= =?us-ascii?Q?wcoqYP65cD2MLSA0HNbWiUTtqZ+YR3woEJoiOlI0oqXY8HHld7nVUbHazQap?= =?us-ascii?Q?K8NsH/QxHrvL9a7s2RpO8RDbTIfYxxPdrc+R64ynfPEig7xBg0XMP74LBfqk?= =?us-ascii?Q?0zllmIKHS4Ix3j+T33hTgfe4zzBvhWb+k1Nm3BvWoyApsEFWtPO37NXCB3uX?= =?us-ascii?Q?ZZmxMUFZxLIA8kOFNFhFRUkdFqB4jAtx+JgyBzowhQzHHXdYGj1LIgYSEwcU?= =?us-ascii?Q?knA8etVE9A/eEqS9JtN0aB1eNVS92igxUe4h2l7rxfhT7cSl2YXsYnRERSU5?= =?us-ascii?Q?tE/L73SGiowRIaHJR0x50SMgEYy4E4V73rHyhfFMqdhgN6ZGDtgX0meODkuQ?= =?us-ascii?Q?l/PrboL89dVQgSXJ0hMZesT1paHmDO7DrafA/IxlKYNUFddT2tBNGRXLKYS+?= =?us-ascii?Q?gvuALLGfNMX2pH+35wB+MyfC2/DLa/2NDkEaySvlXqRiUG8UDupBFEdydwxZ?= =?us-ascii?Q?jnHW2Z5h2Um1cyXksQqURHy6QWepmfERGQmtoAdzT2T8RqibQf5RGto9Uez/?= =?us-ascii?Q?5qQEy8VMlvIWJoCeftJkjCle7WLfDzcIvTUW63wLa6xejnkhoadQmuGCztYE?= =?us-ascii?Q?wt2aRGPAtRw0pk=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3471; 6:DiW9Q9Dvfh0BWoYR3fwCjUO9VKpByT0ec8aSPA9Iu+H4QQB65nJyIbGQubvomofTQgzA4+IDiJiKv9ZKWgD6OgAVSGFpsiHV/m2zf8K505mPNBOR3SDmDQd2WxEnbWdmW18sn0LOH43wnnZYKpnzVLs85PBao6ADALDPJaQK4DrT8qb8saYEXWQIahIuDCyXQTrW14d23qBYYoV8h1orWfi2G051FWqEvnvWbnF6RrkDvQqv/+n4m7Gvmw6B2Ic3wV57rXuWaVlVY4qZ+72lBpbuthSA92/Q2vv/eZjrHJe4FB7Bcr4tGlvZ5zdBmqN8Lch639YG1jrBCxTL6pHw9g==; 5:WQcNQob5l4v3Xcu+ld1NzIqokB2oteJjJtwGymtdmy58/gVofzRY5z9DgAz1goe+Q2XMexYil/nPY7gJEs6TVSokXeBTNFaeBiUX6hqchBaHuqOfRuR0MGmQxIS3Yb/0c2efMYWcbPomNtKZT9dvHA==; 24:QC/EFnabVQJVXhJxqI7X2a6MWvsIYDoFMM+KDqcI13RuWW7oY1Ob4/8ASM6DPgbYASqm+WejTYgOh5Be+HcpbN5fay45sNFaCYALT0DXURg=; 7:LgZB8eetzus2kiv2L1wnzuRi1QGZXbIPMuLse6GW7ju6DYz3f0ZerSP8Ei4jCnC0c9qT2Ub7tbdn086OOwyUjbCWufIOlcYi87q7ZGe59qXORXE2ixaqTsZhdGBPJE3bzxj0gY4PgTlaj2LUBOKAK75nPcg1E4M4ZJwjNqK7N+1XuAKYaKsqPCoSIJSeIMtYYDf6d8IvD1bGMAqshZNm6yJQ84XF34UYuALnZNF7k0g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2017 17:41:17.9894 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6eb342ca-1687-447b-2051-08d51a3d44fa 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 v3 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: Mon, 23 Oct 2017 17:41:22 -0000 From: Pavan Bhagavatula 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 --- v3 changes: - fix app/test_perf_queue using invalid queue configuration i.e. setting schedule type in event_queue_cfg instead of schedule_type. 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..a7a2b1f 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.schedule_type = + (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