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 3DC304C8C for ; Fri, 23 Mar 2018 18:05:52 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2018 10:05:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,351,1517904000"; d="scan'208";a="30710096" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 23 Mar 2018 10:05:48 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.176]) by IRSMSX103.ger.corp.intel.com ([169.254.3.61]) with mapi id 14.03.0319.002; Fri, 23 Mar 2018 17:05:47 +0000 From: "Van Haaren, Harry" 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" Thread-Topic: [PATCH v4 2/2] event/sw: support device stop flush callback Thread-Index: AQHTwFWrAIMN3FoguUye7ASWWY9UZaPeD2Rw Date: Fri, 23 Mar 2018 17:05:46 +0000 Message-ID: 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: <1521555187-25710-2-git-send-email-gage.eads@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 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 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: Fri, 23 Mar 2018 17:05:52 -0000 > 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 >=20 > This commit also adds a flush callback test to the sw eventdev's selftest > suite. >=20 > 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(-) >=20 > 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) > } >=20 > 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); Adding check that dev_stop_flush() is non-NULL? [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] if(dev->dev_ops->dev_stop_flush) dev->dev_ops->dev_stop_flush(...); > @@ -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); 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? Rest looks good to me!