From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9F72F1B1EE for ; Wed, 10 Jan 2018 17:45:27 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 08:45:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,341,1511856000"; d="scan'208";a="165705520" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by orsmga004.jf.intel.com with ESMTP; 10 Jan 2018 08:45:23 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by IRSMSX153.ger.corp.intel.com ([169.254.9.34]) with mapi id 14.03.0319.002; Wed, 10 Jan 2018 16:45:21 +0000 From: "Van Haaren, Harry" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "santosh.shukla@caviumnetworks.com" , "Eads, Gage" , "hemant.agrawal@nxp.com" , "nipun.gupta@nxp.com" , "Ma, Liang J" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 09/12] app/eventdev: add pipeline queue worker functions Thread-Index: AQHTiiK5mRtKbCy3BUu0FF77R8OT8aNtTtvg Date: Wed, 10 Jan 2018 16:45:21 +0000 Message-ID: References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-9-pbhagavatula@caviumnetworks.com> In-Reply-To: <20180110145144.28403-9-pbhagavatula@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWZmMGNmZjItZTliYi00YmI5LWI2YmYtNzRiOTdiMTJlYWMzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ink3MWRuWWx3b3RKNDFnMFdkY2xaMVwvZjErczhJeHBieU40U1plamVkZHZjPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 09/12] app/eventdev: add pipeline queue worker functions 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: Wed, 10 Jan 2018 16:45:28 -0000 > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Wednesday, January 10, 2018 2:52 PM > To: jerin.jacob@caviumnetworks.com; santosh.shukla@caviumnetworks.com; Va= n > Haaren, Harry ; Eads, Gage > ; hemant.agrawal@nxp.com; nipun.gupta@nxp.com; Ma, > Liang J > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3 09/12] app/eventdev: add pipeline queue wor= ker > functions >=20 > +static __rte_always_inline void > +pipeline_tx_pkt_safe(struct rte_mbuf *mbuf) > +{ > + while (rte_eth_tx_burst(mbuf->port, 0, &mbuf, 1) !=3D 1) > + rte_pause(); > +} re safe, see comment below > + > +static __rte_always_inline void > +pipeline_tx_pkt_unsafe(struct rte_mbuf *mbuf, struct test_pipeline *t) > +{ > + rte_spinlock_t *lk =3D &t->tx_lk[mbuf->port]; > + > + rte_spinlock_lock(lk); > + pipeline_tx_pkt_safe(mbuf); > + rte_spinlock_unlock(lk); > +} IIRC usually the "Safe" version of a function has extra locks/protection, w= hile the "normal" version has better performance, but less-error-checking. Here, the "unsafe" function does the extra locking. If looking from the HW = POV, that makes sense, but I think its inverted from most existing code... Happy to be proved wrong here .. ? > +static int > +pipeline_queue_worker_single_stage_safe(void *arg) > +{ > + struct worker_data *w =3D arg; > + struct test_pipeline *t =3D w->t; > + const uint8_t dev =3D w->dev_id; > + const uint8_t port =3D w->port_id; > + struct rte_event ev; > + > + while (t->done =3D=3D false) { > + uint16_t event =3D rte_event_dequeue_burst(dev, port, &ev, 1, 0); > + > + if (!event) { > + rte_pause(); > + continue; > + } > + > + if (ev.sched_type =3D=3D RTE_SCHED_TYPE_ATOMIC) { > + pipeline_tx_pkt_safe(ev.mbuf); I guess that means that the functions where they're used are inverted in na= me too.