From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7D36B1B208 for ; Fri, 20 Oct 2017 11:54:40 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 20 Oct 2017 02:54:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,405,1503385200"; d="scan'208";a="1233103496" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2017 02:54:37 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by IRSMSX103.ger.corp.intel.com ([169.254.3.49]) with mapi id 14.03.0319.002; Fri, 20 Oct 2017 10:54:36 +0100 From: "Van Haaren, Harry" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "hemant.agrawal@nxp.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Thread-Index: AQHTQ1xG14824kEOX0adMmqVvtGmd6Lse9Hg Date: Fri, 20 Oct 2017 09:54:36 +0000 Message-ID: References: <1507814147-8223-1-git-send-email-pbhagavatula@caviumnetworks.com> In-Reply-To: <1507814147-8223-1-git-send-email-pbhagavatula@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTBmNzI4MWMtOWZlMS00OTEwLWIwZDUtOTNjNzc4YWIwYmRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImZsZG1cL1RkWUVhVk5ta3dES0RMME1lQXp0UEdcLzBNcit4UU85cWROSFJtVT0ifQ== x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Fri, 20 Oct 2017 09:54:41 -0000 > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Thursday, October 12, 2017 2:16 PM > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren, > Harry > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue > config >=20 > 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. True - worth cleaning up. =20 > 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. >=20 > Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app") >=20 > 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(-) >=20 > diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_commo= n.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; > } >=20 > -static inline uint32_t > -evt_sched_type2queue_cfg(uint8_t sched_type) > -{ > - uint32_t ret; > - > - switch (sched_type) { > - case RTE_SCHED_TYPE_ATOMIC: > - ret =3D RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY; > - break; > - case RTE_SCHED_TYPE_ORDERED: > - ret =3D RTE_EVENT_QUEUE_CFG_ORDERED_ONLY; > - break; > - case RTE_SCHED_TYPE_PARALLEL: > - ret =3D RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY; > - break; > - default: > - rte_panic("Invalid sched_type %d\n", sched_type); > - } > - return ret; > -} We should note here, that SCHED_TYPE are integer values: #define RTE_SCHED_TYPE_ORDERED 0 #define RTE_SCHED_TYPE_ATOMIC 1 #define RTE_SCHED_TYPE_PARALLEL 2 While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in thi= s patch) #define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY (1ULL << 0) #define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY (2ULL << 0) #define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY (3ULL << 0) #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK (1ULL << 2) I'm not against this change - but we must be careful that if there was any = bit-masking being used previously, that that will subtly have broken if we change to sched types. I'm reviewin= g with that in mind.. The RTE_EVENT_QUEUE_CFG_ALL_TYPES config flag now means that all SCHED_TYP= Es are valid. Previously this was contained in the bitmask.. this may lead to = issues. See patch 2/3, where *only* the schedule_type is read, and returned. What i= f it the "ALL_TYPES" flag is set on the queue? It will be reported wrongly. Currently there is no intege= r value for "ALL_TYPES", so we cannot represent "ALL TYPES" in the return value from get_attr(). Am I explaining my reasoning clearly enough?=20 The patch correctly leaves QUEUE_CFG_SINGLE_LINK as a bitmask, so that bit = is ok. > #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 Remaining diff was updating the QUEUE_CFG to SCHED_TYPE