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 66EEFA04F3; Tue, 7 Jan 2020 17:34:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F66D1D443; Tue, 7 Jan 2020 17:34:13 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 56EBC1C139 for ; Tue, 7 Jan 2020 17:34:11 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 007GV1rq024292; Tue, 7 Jan 2020 08:34:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=RCJuayEE17wWRoO4puxnzjoX6tRaMALu2PJxKne4F6k=; b=AVC3DMA2u5hcWoQfwoS5V7IgOrLKCd1Y60pCGnr5Bz2X5HyDj4XzD8lks6WrID1owy6X 50pimyrWmQQO/SsjBtA2ZaijKy7jlmDlykI9no1EWbz1MWfcC7QTYKKhW+AUQkZx8u3t NHpbhgYlb/x90OWFgCaAk8VHfrqqCzv3dFB6jmK8DEh3+QWJYiNGJDBWdlkRMs0xU+q/ jLXBIwMF9C/qHmSlay4SKaR5Q0M9rQMzvMmNnfrqWa0IQjhbFDAea8jxwgAmPKeP31/d ubMC97dBl8oJOPVLEzBvIstmdhE/80QJc7IH2UPF11kHkf+iTeSsJsU+MooZ/Bpjl0lA 5g== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2xarxvb5h6-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 07 Jan 2020 08:34:10 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Jan 2020 08:34:08 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 7 Jan 2020 08:34:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eG7asyBWMZsbU6HcaPYBnt3h+JDsxYZ0rmGb1WgAqSoErHxszI66QWGwz4l1cCY0iJQPStxuqgmJFSDXLC5l+Cf+GocpXXK0WrNYHo6mtCNxAYdaPft6ZUIyK8ADMw3ICNXG67bLZppTThO14rd3mHhkT4cg9OVpL5ogrAaDMmU/w8DGdZyxgx1c/DGbUUp1nc7brt9czB8e0WcfmbMcP9ERut7cBAYbSC8cwPSrLKgcgzzDnew9k6MAQuCJQfWCdsrhYWf3QELGRsK/OWJrhh8bxYYs6lJsFfs0QVxICVCuyx69uEQ6EYLxTZXQH+DWIKlYSZvaefuaU2a9lrTwuw== 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=RCJuayEE17wWRoO4puxnzjoX6tRaMALu2PJxKne4F6k=; b=do/WX/pgY3drcTsaikZ3MIy5ehGPodxno2tfeCXNQApMRA/dJEUqhx1k03hH3lY9kRu48eiJ3uGXcchu4pmZYcGl4kfR6aqc65KvWdyQzC2We9pZZm9oMsLS396nixkb22BryzHR7UWoUsaVKDvgTP56xavhx5PDdnBIWIRlNt2LFqX6WI4pPThwALlWhqtCGiQZMsEbJQqO6U/8aO7Xh4yKqXadRv3fGoSmepYuJ9hA2XUikCqs4iM5TyMfB+NFZyNHQWhVUetrO98jbiLKZ2lMV7WCCHQbkCAmhRM+kJyFUhK1+XWP89jHrPOmrHn6+7kfJeJ+H6eTv4NH9q5rpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RCJuayEE17wWRoO4puxnzjoX6tRaMALu2PJxKne4F6k=; b=XvyVG89VbG2yVTL8Dqiz3TIvc8rzEH1wvyy8QdibNb62XzHPLUItPD06WIS1F15IA3q7PEH5QGEq57rSopSxlclUMDik5iWgtu3HbO350jrYMXduYB8a5hKnpcjhuTiLfXuMZwGa64wOVxjV+l8w490IhNE8zetnkZ1NL+m4IpQ= Received: from CY4PR1801MB1863.namprd18.prod.outlook.com (10.171.255.160) by CY4PR1801MB1941.namprd18.prod.outlook.com (10.171.254.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.15; Tue, 7 Jan 2020 16:34:07 +0000 Received: from CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::edb0:c18d:7455:f60b]) by CY4PR1801MB1863.namprd18.prod.outlook.com ([fe80::edb0:c18d:7455:f60b%4]) with mapi id 15.20.2602.016; Tue, 7 Jan 2020 16:34:07 +0000 From: Pavan Nikhilesh Bhagavatula To: "Ananyev, Konstantin" , "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: AQHVwjQ7Ss9W5H4tz0qJdKkOuMTnjafdBwPQgACPWoCAAdQsEA== Date: Tue, 7 Jan 2020 16:34:07 +0000 Message-ID: References: <20191204144345.5736-1-pbhagavatula@marvell.com> <20191204144345.5736-2-pbhagavatula@marvell.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [223.226.91.107] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 653909d0-39b7-425a-e1b0-08d7938f6a88 x-ms-traffictypediagnostic: CY4PR1801MB1941: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 027578BB13 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(39860400002)(366004)(376002)(396003)(199004)(189003)(186003)(6506007)(8936002)(478600001)(86362001)(81166006)(81156014)(7696005)(316002)(9686003)(5660300002)(110136005)(55016002)(6636002)(33656002)(52536014)(26005)(76116006)(64756008)(66556008)(66476007)(55236004)(66946007)(66446008)(4326008)(2906002)(71200400001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1941; H:CY4PR1801MB1863.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SiBalpIGWvyywLtWdOvzIyBgMkkB6ldW81Ih+gBCvEG265HUnZrpx/+xZsBei3GfMhMRpxhZSIFmMjCZ5Jn/kcxSS3Z2FSxTtCg2/VpF2XJsJti43hRaRZEzuu6x0NoIz40pWx4iqUfgf5vf4IZQl6QMc6Oo/JO6m2/X2LZyexKAAL/2G09vedFJ8NV0iqiFVZw87bBJL++elL6//bJQAayLAchoRJYRfGwoBWfZehGmcn4w/Jq5086s7KhsGcdgwngXP6X/Y0B+F0F7p3SqMn5zzGAhwREm7B1hh0DIoomu7eAqbPh5adlu808Gzy3x4EB8W5JQIO7jKugjeS1spOb60cQPbO4CG4oVlzWcUIHaKUGqgfAnnw1WdFOXO/Ir1KZVU1kgBLML7Cblsi/GovwbAs7aVSoB4JczVXvfL269UY7NPaJzXKb/SvKmF6HPClNoeTQunQPo2Z8k280knV0G+OShHef+FvfhsMTSpNCSm3ByyiFtxgzHT7TM53Ah Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 653909d0-39b7-425a-e1b0-08d7938f6a88 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2020 16:34:07.1527 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 698paONyOehnAp1HF0araWi/31uoaMzPgya43k/7YqLtp1CxkWg38lVFYIMrVs5jIC6Ij5SP0UMqYZfnETCPh0cT98Iw4QnBNrhThXTJIxA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1941 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-07_05:2020-01-07, 2020-01-07 signatures=0 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? >> >> 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. Maybe we can cut down some init time. I will move it to .c next version.=20 Thanks, Pavan