From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0077.outbound.protection.outlook.com [104.47.32.77]) by dpdk.org (Postfix) with ESMTP id 293EF5F1F for ; Mon, 12 Mar 2018 15:38:48 +0100 (CET) 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=BeqOHcgXkqWcY+DxGZBPdTuBXijUuvwgpczjUInA/1s=; b=oCzHGh5NEvXAqVVDi4jo1f1CUL6LPLhqrGn4NNpVS/TRPBo79R15g98Vp+5ZxDlZ67bgCjM/glR9NA+OFSKGJ407MMyKUuaiaQvYWbMbrKTMmFpZqDyg+7Wtwq8bzYv30k6HRc/xexc/vc7uQG0RAxdc0IPq74VAfrm6A10vlos= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by SN2PR07MB2528.namprd07.prod.outlook.com (2603:10b6:804:7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Mon, 12 Mar 2018 14:38:42 +0000 Date: Mon, 12 Mar 2018 20:08:23 +0530 From: Jerin Jacob To: "Eads, Gage" Cc: "dev@dpdk.org" , "Van Haaren, Harry" , "hemant.agrawal@nxp.com" , "Richardson, Bruce" , "santosh.shukla@caviumnetworks.com" , "nipun.gupta@nxp.com" Message-ID: <20180312143822.GA3636@jerin> References: <1520290870-4987-1-git-send-email-gage.eads@intel.com> <1520550631-13403-1-git-send-email-gage.eads@intel.com> <20180312062527.GA20170@jerin> <9184057F7FC11744A2107296B6B8EB1E3FA711B8@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E3FA711B8@FMSMSX108.amr.corp.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::16) To SN2PR07MB2528.namprd07.prod.outlook.com (2603:10b6:804:7::6) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c855e45-03ae-4799-77fd-08d58826f5ee X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN2PR07MB2528; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2528; 3:pVQQkx1n5UtJ43sTFJGmhCnQPZGC25+1lX7bJbRn2DH3Uu0lAYjbUOsj9Mh4V9bp+paPGIhORsYs4AL1XJAWS253Y5YD9/EHg4UVBALvNMClfHZ/jwUU4jAKBTrBZDfpNXAvThAboXAVv/nvZCTKVsQfAkx+0+umS5R4SZNghC18gpdMudo8ssUOeyVgEtJLpgaP8bptIzQNsA8RFenb5mskxkdyF1ZDc0phyDmUbf/wNlSuAlDY4fxMK+FyAnod; 25:TxrUENHF4PP9wXGAEIJw2pEvgdxI0HqStnOrWsK5azd+5p9c+zt27IFUQQGr94z6+y68292dClOpW/X7IG1J7ztv1FrnvH0XZfNlcDjsRFaegfT3NdOSNnxnUP0UkjA92whDaBTOrSMOoBNxli40Rq96Ka+iH2UDvKAiGca3ERr7if7cigGQZFuN0cFOuiadVNn8wN0nSk9RW7U0cxwXjN6VPA38qi6Cf/8gMhGOl2YWu5oTwdt07r/XlgxbRDU6TK4HtD1J8EVBJh+Cdm45Mw0YomUgc/nBk/Fx3kUHosM1sRwCvxCHl9MW/M4wzxEWLi+BI22DZ/LToFDIV6Hq7g==; 31:aiiNdxNrdsIveD+tWB0moKYPDfAMOgmYA/2Uj/wFHJbCx2bBVMi5m4ZJTqJj3eZn4k4LGEoUQMx3w0z38tKS82zd5Gda7gemxsyD17MRgLJ7as8RZJYqufOi+7+3JQNDKp6xRIv2iJiVg96ORiRgBmmsgmCi0/u1skN6Oj8qwvDvKgZFSw2xqdfvX6pyhXukQnrk3hfqIm+Qea5yjwRuVVtiX9h0ZQIAf3nRINZ1fgU= X-MS-TrafficTypeDiagnostic: SN2PR07MB2528: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2528; 20:42MHN5RBZ/8V72TYfmkoF+23FJiABjipRuEg0I41H7NC8Qi5b7Ty92xort6tGv4rz5V2NgUQD3tMqik4RFM0gw05AKiIzx7pnWmSJNd5HbNcjzYzNw9EuSXG0sFGYKOMlYUQzTs9Gc3Y9dMgG+vJ/r6igU2zgfHISZGmjpCp3xkyZyl49FLZhksegjZdscn+B15lwE76a+n6mP0xLzMO1xLk1WMHTQpGvm+5ETlLmg0uqHl4l+PSDUr60+92zefDy/i6aYObNad30bzdsRJg/D8TDxfkIlwDCspGuLR/9CAk7LdLct67KA2dQnYhIyFh1yRSms4/1mJqsBazP7kAsaTvcdesfOX+An1De1T678DJp3BiUbardxOGE3f6YY+b5jNjfp8AeFMoVrb2VdI7TiOXCjsiyevm32IvLB+hdQ4PikgRbYUjZgcHVy3DUQ43HiEsNwkMPxqXxXhyMky0fNs5gbte+LSsz9WU3aiNCXYGM2tUpZFKQC3kF1cJv+QgtIH0hSppK4irRR6g5BlDWCSvdmsfX6lo6Wrm02dLDxAR+zJjUhKPJGTfJcmsQZDg6tFuw0Vgfv2HzgxSyBN//lZpueBvAcOiA3Bass+mAuk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3002001)(3231220)(944501244)(52105095)(10201501046)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:SN2PR07MB2528; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2528; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2528; 4:auFNAe76hnXrTEF6IoHOOMqkfpDFdu2l9UQgHPKmH0+tJq90sX4IYDsD9M+6heRMBZAYXOw6qn51zN3KrwtLo7ze2cOR+PS1/qGVbYfUVf3DaLDOzeDPKOvIWnrQkYI5sFrExrTxNBBKQox1ntBNs+SMVbmTAQNGOHmCOvnoAC5yX5iRnIAEuJ/UG/YJiXc+Zw3Vzht60P4q5V2H5HrI1ZUoNktR6SBlRaTCWsK3lEXU5R1qUkbJfUvrQHsQacQIO8d19shLbFjE+208GmkFmDid88oV5F+zUbaakpYVMJ+s+Kr5+6ku17opDBeQUcZzPD3z6BWsLavBWAT9u14CrvL1UmuLzZ3Hwi/3UsXK23w= X-Forefront-PRVS: 06098A2863 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39850400004)(396003)(346002)(376002)(39380400002)(199004)(189003)(13464003)(43544003)(16526019)(25786009)(186003)(2950100002)(26005)(72206003)(42882007)(54906003)(966005)(58126008)(4326008)(478600001)(53546011)(386003)(6666003)(6916009)(8656006)(8936002)(68736007)(97736004)(93886005)(5009440100003)(81156014)(81166006)(5660300001)(33656002)(33716001)(76176011)(106356001)(6496006)(33896004)(16586007)(316002)(50466002)(105586002)(305945005)(55016002)(9686003)(7736002)(66066001)(53936002)(1076002)(23726003)(2906002)(6306002)(229853002)(8676002)(47776003)(52116002)(6116002)(6246003)(3846002)(53376002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2528; H:jerin; 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; SN2PR07MB2528; 23:6lp/6QPDAEQn6nduXENsFRoLzP4Z7AJEs5w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86SuXpAa10PiJ9kOetB/klzQ+IKyDldUaR1KbgOvyWvgkOWK6fWFDv5oILkgK/nGada4Zg3UUj2M7oFGUiRiFKXT5WwPOYn//ZJbDFhL56pkikRUN3sYUAASdKBJwoIazqtrYraZDFWa42b8XCMWi5Ih62CbGiku9eUz2LtK87WHEJ/kyuFpQ15XlX/QacAvIBCE6AXFGGiCXMGwIuI6VDE=; 5:XCRpirBDni4bd97VQIZmMThmBR0l+uVNxoAku9e9ZA/9WdkdjirTx8hsKtf79dQ+Fh14w8kM8XvjQxVib2IFAbeM6sV0XZKLEV4l2jpTsXaS80ZWsUpMNTKD02GIRiO6+rvUpN7PpTH7pKBb0nMuuBKGdY+P4iEeo6Y4Pfiv73s=; 24:QXdoqVti/2ZvQG1NS7ih77OMd1bzqVCLoKSK3GglPNeFTIuB5Ma4v4EPAMgVPRSvXw6harknAOOrd++nBxn39ZIbJ9aSDenZPZX3WJDRrBU=; 7:YcMO40DdF/8Jy29xRCamFQmRlBKJb8QnUfnMdnNOkLsqzs6D3rzdKYuZij6Yxi5OZWcqwpElL76PQM7MWHvCDRtkFCzcth6t6GtYNGYLvQMbX/2RkyFLD6J6YjHLkOP25iYiOQ/IQmO+YVvBpWsO60w3UzRpehsC1EGzKKtzp3SKJNAdMW5/Vt/6JIs4YX9RCW436dFoZrAIDIiyI7O6U2QxKopqqKlNXX+p24BScCQxtTeIJau6Tljp/5d+0WZz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 14:38:42.0536 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c855e45-03ae-4799-77fd-08d58826f5ee X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2528 Subject: Re: [dpdk-dev] [PATCH v2 1/2] eventdev: add 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, 12 Mar 2018 14:38:48 -0000 -----Original Message----- > Date: Mon, 12 Mar 2018 14:30:49 +0000 > From: "Eads, Gage" > To: Jerin Jacob > CC: "dev@dpdk.org" , "Van Haaren, Harry" > , "hemant.agrawal@nxp.com" > , "Richardson, Bruce" > , "santosh.shukla@caviumnetworks.com" > , "nipun.gupta@nxp.com" > > Subject: RE: [PATCH v2 1/2] eventdev: add device stop flush callback > > > > > -----Original Message----- > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > Sent: Monday, March 12, 2018 1:25 AM > > To: Eads, Gage > > Cc: dev@dpdk.org; Van Haaren, Harry ; > > hemant.agrawal@nxp.com; Richardson, Bruce ; > > santosh.shukla@caviumnetworks.com; nipun.gupta@nxp.com > > Subject: Re: [PATCH v2 1/2] eventdev: add device stop flush callback > > > > -----Original Message----- > > > When an event device is stopped, it drains all event queues. These > > > events may contain pointers, so to prevent memory leaks eventdev now > > > supports a user-provided flush callback that is called during the queue drain > > process. > > > This callback is stored in process memory, so the callback must be > > > registered by any process that may call rte_event_dev_stop(). > > > > > > This commit also clarifies the behavior of rte_event_dev_stop(). > > > > > > This follows this mailing list discussion: > > > http://dpdk.org/ml/archives/dev/2018-January/087484.html > > > > > > Signed-off-by: Gage Eads > > > --- > > > v2: allow a NULL callback pointer to unregister the callback > > > > > > lib/librte_eventdev/rte_eventdev.c | 17 +++++++++ > > > lib/librte_eventdev/rte_eventdev.h | 55 > > +++++++++++++++++++++++++++- > > > lib/librte_eventdev/rte_eventdev_version.map | 6 +++ > > > 3 files changed, 76 insertions(+), 2 deletions(-) > > > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c > > > b/lib/librte_eventdev/rte_eventdev.c > > > index 851a119..1aacb7b 100644 > > > --- a/lib/librte_eventdev/rte_eventdev.c > > > +++ b/lib/librte_eventdev/rte_eventdev.c > > > @@ -1123,6 +1123,23 @@ rte_event_dev_start(uint8_t dev_id) > > > return 0; > > > } > > > > > > +typedef void (*eventdev_stop_flush_t)(uint8_t dev_id, struct rte_event event, > > > + void *arg); > > > +/**< Callback function called during rte_event_dev_stop(), invoked > > > +once per > > > + * flushed event. > > > + */ > > > + > > > #define RTE_EVENTDEV_NAME_MAX_LEN (64) > > > /**< @internal Max length of name of event PMD */ > > > > > > @@ -1176,6 +1194,11 @@ struct rte_eventdev { > > > event_dequeue_burst_t dequeue_burst; > > > /**< Pointer to PMD dequeue burst function. */ > > > > > > + eventdev_stop_flush_t dev_stop_flush; > > > + /**< Optional, user-provided event flush function */ > > > + void *dev_stop_flush_arg; > > > + /**< User-provided argument for event flush function */ > > > + > > > > I think, we can move this additions to the internal rte_eventdev_data structure. > > Reasons are > > 1) Changes to "struct rte_eventdev" would call for ABI change > > 2) We can keep "struct rte_eventdev" only for fast path functions, slow path > > functions can have additional redirection. > > > > Good points -- I hadn't considered the ABI impact of modifying rte_eventdev. rte_eventdev_data is in shared memory, though, so it's not multi-process friendly for function pointers. How about putting it in rte_eventdev_ops? Yes. Make sense to move to rte_eventdev_ops. But need to take care updating the those function pointers in secondary process.