From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 612B2A04F1; Mon, 6 Jan 2020 13:32:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9DB671D62F; Mon, 6 Jan 2020 13:32:46 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 15E231D626 for ; Mon, 6 Jan 2020 13:32:44 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 04:32:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,402,1571727600"; d="scan'208";a="217398400" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 06 Jan 2020 04:32:44 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 04:32:44 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 04:32:43 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.105) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 04:32:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbAmbBP6y9NnZpzL/Zr6DExsscGizUg6YJEFaaRR9qum961vVo2E0oWn3ezxa7fT2tzYt7KZDZkOiSKRJ7V4DlHlVFRyJaUumC3sCEKc8/SXt+jF4ATTTZJzwfCijdREoizQUadcaaAQLLO6jkL7caTAOhk+j2TidLfmatWNiFBCdN24YO7B2Thd5GRhOR6x+dJDJnkB4vsTGuH99gzbMwnRfGA7WMSfTUThnX77oapCI8xYkF/JNd9jPCX0Gbh/MmlIxqV+hoODuK5RVwRCmcw9thNdU1CQGAHUCtbXF0o1HjMy9pmAW5rccwcFRXrqX9ajkJj1KXGTof4uPioBYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UtjDmUJ40j1O2H1x8MEICt0btyLJe2qDx2nW6EiHadk=; b=VW7xRLp9CDSMcQX5fRRA25cfVxWG37ry0XFvPApHbqBZxSJdVzCEdelKF/6YfWQZS5G3PHlLDA58rMYhlmil8mMaxtuDQYO2B5MxX9MU1+CYWpsbazvFf5SNH2S7KRYZfWLRr3m7CXYtQZiMyMIeINe5wHdmoMhO0SJmOkQBzd/mC6yUHYHhBIF9Pdx8AuQ5E/51GzSPZuiKu+hbIMwtKH8HfJQoZRmdyefaetCIVgAcPWrNjxZwJk6t7AtZsktKE6vnwne1LvdBES9ESUP3L1PtQ6sfSDKheSZxsq59zwlohT6P+5AA6zFnr6H3b4wb1Imj9i2Fzlb4aimpiqoyXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UtjDmUJ40j1O2H1x8MEICt0btyLJe2qDx2nW6EiHadk=; b=hNcWz6h/ZMAfxiAefx+kzIXfMMcH6qJNKJUcEtwNl0KQ3TtfMrbln7LktOYcyAibxhv1NaT6gPSfNv2h8YuN+TWy8ziT3TFwDk4k3kgVMgif8UgdDXAjWUsO+lj2kNOepU55Zj8mR4JDtke9a+vj2J29Vw+hVYHYlD/cubB5C88= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB2928.namprd11.prod.outlook.com (52.135.127.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Mon, 6 Jan 2020 12:32:41 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386%7]) with mapi id 15.20.2602.015; Mon, 6 Jan 2020 12:32:41 +0000 From: "Ananyev, Konstantin" To: Pavan Nikhilesh Bhagavatula , "Jerin Jacob Kollanukkaran" , "Kovacevic, Marko" , Ori Kam , "Richardson, Bruce" , "Nicolau, Radu" , Akhil Goyal , "Kantecki, Tomasz" , Sunil Kumar Kori CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 01/11] examples/l3fwd: add framework for event device Thread-Index: AQHVqrFyV9/tRySbxki5txAAEqnJT6fZD6/ggAQuAwCAAIZU0A== Date: Mon, 6 Jan 2020 12:32:41 +0000 Message-ID: References: <20191204144345.5736-1-pbhagavatula@marvell.com> <20191204144345.5736-2-pbhagavatula@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDExOWVlNjktYjE0My00NmZmLWI1NjUtZDcyMzQ1NzcxMTJjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiN2NJaU5hQ29mZDFPTW9FXC9VVnRvSno0N0RLVElnVmRuNEU0N1lDbTNIUGZiN011VkNLTW4zbjluTzBDRTNZR1oifQ== dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.163] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d8851fdc-439f-4d2c-d317-08d792a485dd x-ms-traffictypediagnostic: SN6PR11MB2928: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0274272F87 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(39860400002)(136003)(396003)(366004)(199004)(189003)(5660300002)(52536014)(316002)(76116006)(66446008)(6506007)(66946007)(26005)(64756008)(110136005)(66476007)(66556008)(33656002)(2906002)(9686003)(8936002)(186003)(7696005)(4326008)(81166006)(81156014)(478600001)(86362001)(55016002)(71200400001)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB2928; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: numqUZtHt5fqlNZH/xK5r5Hwk51pB51mR9xPlteJDkQWNRW1IB7CJSSiXU/2L3HegB74fD1KB5jHyOPQqbnvF/xNZrZAFFxnV0wR0dxSW5GM1FQrvUcQYuJddjaFSXL92PyK7hLARN+xMjZ3leLb5XpKQIQq/Skd1nJ7RSS67WYYyV8/6jIuoRMo/oOXqLVx/1Bink7spl+zT101vmtZTp5zbSelQdv0YyZkEq0Uv1kT7tRNHEICruid66/cGf0yuj6nI58lfE6Y7y/6MKzFrRVo/XZXvoCZr4/ZEPqRq6SvTqLgyhlcZfa/nmZfE9KJWL29gH6yR1q7X9krDvZxpu4mDJ0SRO0obRyKIGpX51FHrkt1HYRv4zq5/bFLmLClYBAc7LKbDRyDcE5vfkE0sWWKEvErkRjjyVKGMZHBYODjSOUGMSJzm0n6ZPHfF/0meMdoc53/mRewo85B2llnv7ckWzzXf0L3k8FwDcfHaXmRCGgcj03gXj5lshNfwRq7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d8851fdc-439f-4d2c-d317-08d792a485dd X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2020 12:32:41.2814 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0wwxkZSnMxX+J9jPe2pj4eXNu0u9tdsZdwWQuDahLd62LOvDC78l0NeGSbhB2Z3MXJbf6K8IN1SFY6+i87wU0BGQjQNmKOwJXeyccHP8Cwk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2928 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 01/11] examples/l3fwd: add framework for event device 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > >> +struct l3fwd_event_resources { > >> + uint8_t sched_type; > >> + uint8_t enabled; > >> + uint8_t nb_args; > >> + char **args; > >> +}; > >> + > >> +static inline struct l3fwd_event_resources * > >> +l3fwd_get_eventdev_rsrc(void) > >> +{ > >> + static const char name[RTE_MEMZONE_NAMESIZE] =3D > >"l3fwd_event_rsrc"; > >> + const struct rte_memzone *mz; > >> + > >> + mz =3D rte_memzone_lookup(name); > >> + > >> + if (mz !=3D NULL) > >> + return mz->addr; > >> + > >> + mz =3D rte_memzone_reserve(name, sizeof(struct > >l3fwd_event_resources), > >> + 0, 0); > >> + if (mz !=3D NULL) { > >> + memset(mz->addr, 0, sizeof(struct > >l3fwd_event_resources)); > >> + return mz->addr; > >> + } > >> + > >> + rte_exit(EXIT_FAILURE, "Unable to allocate memory for > >eventdev cfg\n"); > >> + > >> + return NULL; > >> +} > > > >Does this function really need to be inline? > >It wouldn't be fast anyway. > >Another question - do you really need memzone here? > >Wouldn't just rte_malloc() be enough? >=20 > Will remove inline in next version. > rte_malloc would call for a global variable which I'm > trying to avoid. If you plan to move that function into .c file, you don't need a global var. it could be static local one. > I don't think there is any harm in using > named memzone. I don't see any harm, though malloc+var will be faster I think. Though up to you - no strong opinion here.