From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 2D53F4D3A for ; Tue, 27 Mar 2018 00:01:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2018 15:01:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,365,1517904000"; d="scan'208";a="38324887" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 26 Mar 2018 15:01:45 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 26 Mar 2018 15:01:45 -0700 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.102]) by fmsmsx116.amr.corp.intel.com ([169.254.2.4]) with mapi id 14.03.0319.002; Mon, 26 Mar 2018 15:01:44 -0700 From: "Eads, Gage" To: "Van Haaren, Harry" , "dev@dpdk.org" CC: "jerin.jacob@caviumnetworks.com" , "hemant.agrawal@nxp.com" , "Richardson, Bruce" , "santosh.shukla@caviumnetworks.com" , "nipun.gupta@nxp.com" Thread-Topic: [PATCH v4 2/2] event/sw: support device stop flush callback Thread-Index: AQHTwFWrAIMN3FoguUye7ASWWY9UZaPeD2RwgAULYqA= Date: Mon, 26 Mar 2018 22:01:43 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E3FA88B56@FMSMSX108.amr.corp.intel.com> References: <1521087130-20244-1-git-send-email-gage.eads@intel.com> <1521555187-25710-1-git-send-email-gage.eads@intel.com> <1521555187-25710-2-git-send-email-gage.eads@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTIwMzEwYjAtNzY3MC00OTk3LTlkNGUtZjJkODcwMTI4N2JhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Iit0MEV5Y2NsRzFlUkVFa2pvcDB5dG5jQXVkS010dnA2RHJFbXFHNG9vQ289In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 2/2] event/sw: support device stop flush callback 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, 26 Mar 2018 22:01:47 -0000 > -----Original Message----- > From: Van Haaren, Harry > Sent: Friday, March 23, 2018 12:06 PM > To: Eads, Gage ; dev@dpdk.org > Cc: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Richardson, > Bruce ; santosh.shukla@caviumnetworks.com; > nipun.gupta@nxp.com > Subject: RE: [PATCH v4 2/2] event/sw: support device stop flush callback >=20 > > From: Eads, Gage > > Sent: Tuesday, March 20, 2018 2:13 PM > > To: dev@dpdk.org > > Cc: jerin.jacob@caviumnetworks.com; Van Haaren, Harry > > ; hemant.agrawal@nxp.com; Richardson, > > Bruce ; santosh.shukla@caviumnetworks.com; > > nipun.gupta@nxp.com > > Subject: [PATCH v4 2/2] event/sw: support device stop flush callback > > > > This commit also adds a flush callback test to the sw eventdev's > > selftest suite. > > > > Signed-off-by: Gage Eads > > --- > > drivers/event/sw/sw_evdev.c | 25 ++++++++++- > > drivers/event/sw/sw_evdev_selftest.c | 80 > > +++++++++++++++++++++++++++++++++++- > > 2 files changed, 102 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c > > index 0e89f11..11f394f 100644 > > --- a/drivers/event/sw/sw_evdev.c > > +++ b/drivers/event/sw/sw_evdev.c > > @@ -362,8 +362,25 @@ sw_init_qid_iqs(struct sw_evdev *sw) } > > > > static void > > -sw_clean_qid_iqs(struct sw_evdev *sw) > > +sw_flush_iq(struct rte_eventdev *dev, struct sw_iq *iq) > > { > > + struct sw_evdev *sw =3D sw_pmd_priv(dev); > > + > > + while (iq_count(iq) > 0) { > > + struct rte_event event; > > + > > + iq_dequeue_burst(sw, iq, &event, 1); > > + > > + dev->dev_ops->dev_stop_flush(dev->data->dev_id, > > + event, > > + dev->data->dev_stop_flush_arg); >=20 >=20 > Adding check that dev_stop_flush() is non-NULL? >=20 > [Update: Ah I see you do this below already. Still, better check twice I = think, the > data path isn't running here anyway in case future me decides to call > sw_flush_iq() without performing the check] Agreed, will fix in v5. >=20 > if(dev->dev_ops->dev_stop_flush) > dev->dev_ops->dev_stop_flush(...); >=20 >=20 >=20 >=20 > > @@ -702,7 +723,7 @@ static void > > sw_stop(struct rte_eventdev *dev) > > { > > struct sw_evdev *sw =3D sw_pmd_priv(dev); > > - sw_clean_qid_iqs(sw); > > + sw_clean_qid_iqs(dev); >=20 > Based on the port buffers comment on 1/2, we probably need a > sw_clean_port_buffers(sw); here to return any events in the port owned SW > buffers? >=20 Agreed, if there is buy-in on the approach discussed in patch #1.