From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DCA40A0096 for ; Fri, 7 Jun 2019 12:45:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FC621BB12; Fri, 7 Jun 2019 12:45:20 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 6BAB81BB0F for ; Fri, 7 Jun 2019 12:45:19 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x57AiQNb016391; Fri, 7 Jun 2019 03:45:18 -0700 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=5tOjyBHwKlGPYTZLwQb9o65+m5/HohQq52s9JNAOJfQ=; b=TWTB28/n0bEu4KFbVOtQUeZlvc0QnZwwmyR0Zdg2dz0brIENhHyYnR3GBgxTadjitdx4 oMUcOJZvUk4XJ6027PSsMbng8K3aR8LtoycnPPhcNFE1tw/5vIQyANBCNOprohSCOFLz 3G8SpN4EAps9tfJlRpj3EaGycREncm6QZt4ICwgahIBsggmxTeuayRUTH5kf2dceW+SH rT2QDWYvqwaiHZnrVlOiaxLDVTh0nYd+W+yuLO58OvVG2CdDhN0B//ZhKexYWMiDHBEm ydvyTPjqg7sPzffDWR2mzvKinyEOJkl+mkRf4BAs98HndWBjZuGS0F2DFZDcJ+/jAzEK 5w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2syjp0rs70-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 07 Jun 2019 03:45:18 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 7 Jun 2019 03:45:17 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.53) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 7 Jun 2019 03:45:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5tOjyBHwKlGPYTZLwQb9o65+m5/HohQq52s9JNAOJfQ=; b=FrpysEmD4DuXdoQX453Xr3CfMcd9pCXTdtktjPnrxRVrbwsqFndpzE0EFzkSwAaX1GI17gngcCeIvUDRJaBT8H2+ONfHreVPEkWMpuHRHPr9xkwknHO5gXCMu0rr36Ea1JGL3Z2Yv2vYuRVKvrmNMun29neC2IXOycMU06VKO1c= Received: from BN8PR18MB2868.namprd18.prod.outlook.com (20.179.75.15) by BN8PR18MB3041.namprd18.prod.outlook.com (20.179.76.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.14; Fri, 7 Jun 2019 10:45:14 +0000 Received: from BN8PR18MB2868.namprd18.prod.outlook.com ([fe80::5d2:e2b7:aa0d:b186]) by BN8PR18MB2868.namprd18.prod.outlook.com ([fe80::5d2:e2b7:aa0d:b186%5]) with mapi id 15.20.1965.011; Fri, 7 Jun 2019 10:45:14 +0000 From: Anoob Joseph To: Jerin Jacob Kollanukkaran , Nikhil Rao , Erik Gabriel Carrillo , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Narayana Prasad Raju Athreya , "dev@dpdk.org" , Lukas Bartosik , "Pavan Nikhilesh Bhagavatula" , Hemant Agrawal , Nipun Gupta , Harry van Haaren , =?iso-8859-1?Q?Mattias_R=F6nnblom?= , Liang Ma Thread-Topic: [PATCH 04/39] examples/l2fwd-event: move global vars to common header Thread-Index: AQHVGjKQj/mLXo/kaEOPnI5gEbBWc6aP++SAgAAFBKA= Date: Fri, 7 Jun 2019 10:45:14 +0000 Message-ID: References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> <1559583160-13944-5-git-send-email-anoobj@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: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 981e07c2-992e-4d22-6802-08d6eb353943 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BN8PR18MB3041; x-ms-traffictypediagnostic: BN8PR18MB3041: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0061C35778 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(366004)(136003)(39860400002)(13464003)(199004)(189003)(55016002)(102836004)(53546011)(55236004)(6506007)(478600001)(66574012)(6436002)(8936002)(3846002)(229853002)(256004)(26005)(186003)(25786009)(99286004)(14444005)(68736007)(81166006)(4326008)(6116002)(81156014)(8676002)(110136005)(316002)(66066001)(54906003)(7416002)(6246003)(476003)(9686003)(71190400001)(71200400001)(11346002)(446003)(14454004)(73956011)(64756008)(66446008)(76116006)(486006)(74316002)(66946007)(305945005)(7736002)(53936002)(66476007)(33656002)(66556008)(7696005)(5660300002)(86362001)(2906002)(76176011)(52536014); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR18MB3041; H:BN8PR18MB2868.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-message-info: Z0hhyfA6VKN51HVsgynFSiHCqiL2fo37/Xxa4lC/kRz8JNmu2HKSgYvqU4je8cFo6zjvhFgXRm1iTaAE+JQgl8pZgww2b2M01+SFem3INmnrN/CzIrHCNVAyfedHe7pYop2tjktT4AmEpxApYYmYy3FP70M989/8ciQzfpnMy33W+oay1KbTlpwkEucKhfj/A38qQmrG/9l21TGHme5wnrR/flYPFb6l9vLOspJahexDToV2z5+JjIbgua7BG9LIKAopLUyf1dvbmhR7E7ko+jq8l2bI7085jLuiRiB13Qwx4j2oHRCnZEKhgF+wGjo51HkgUwPhlxfdq/HiJZMsyEB0eIjChCJebdsdgg0OHokz702j7Pw7asBE+cQn+BzIJKReULNEF9IdjdY+nQDxdm4i2/eAy7PlHavs2FReD2Q= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 981e07c2-992e-4d22-6802-08d6eb353943 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2019 10:45:14.5167 (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: anoobj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR18MB3041 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-07_05:, , signatures=0 Subject: Re: [dpdk-dev] [PATCH 04/39] examples/l2fwd-event: move global vars to common header 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" Hi Jerin, Please see inline. Thanks, Anoob > -----Original Message----- > From: Jerin Jacob Kollanukkaran > Sent: Friday, June 7, 2019 3:33 PM > To: Anoob Joseph ; Nikhil Rao ; > Erik Gabriel Carrillo ; Abhinandan Gujjar > ; Bruce Richardson > ; Pablo de Lara > > Cc: Anoob Joseph ; Narayana Prasad Raju Athreya > ; dev@dpdk.org; Lukas Bartosik > ; Pavan Nikhilesh Bhagavatula > ; Hemant Agrawal ; > Nipun Gupta ; Harry van Haaren > ; Mattias R=F6nnblom > ; Liang Ma > Subject: RE: [PATCH 04/39] examples/l2fwd-event: move global vars to comm= on > header >=20 > > -----Original Message----- > > From: Anoob Joseph > > Sent: Monday, June 3, 2019 11:02 PM > > To: Jerin Jacob Kollanukkaran ; Nikhil Rao > > ; Erik Gabriel Carrillo > > ; Abhinandan Gujjar > > ; Bruce Richardson > > ; Pablo de Lara > > > > Cc: Anoob Joseph ; Narayana Prasad Raju Athreya > > ; dev@dpdk.org; Lukas Bartosik > > ; Pavan Nikhilesh Bhagavatula > > ; Hemant Agrawal > ; > > Nipun Gupta ; Harry van Haaren > > ; Mattias R=F6nnblom > > ; Liang Ma > > Subject: [PATCH 04/39] examples/l2fwd-event: move global vars to > > common header > > > > Moving global variables to common header for access from control plane > > and data plane code. > > > > Signed-off-by: Anoob Joseph > > Signed-off-by: Lukasz Bartosik > > --- > > examples/l2fwd-event/l2fwd_common.h | 26 > > +++++++++++++++++++++++ > > examples/l2fwd-event/main.c | 41 +++++++++++++++--------------= ------- > > - > > 2 files changed, 43 insertions(+), 24 deletions(-) > > > > diff --git a/examples/l2fwd-event/l2fwd_common.h b/examples/l2fwd- > > event/l2fwd_common.h index a7bb5af..55226f7 100644 > > --- a/examples/l2fwd-event/l2fwd_common.h > > +++ b/examples/l2fwd-event/l2fwd_common.h > > @@ -5,6 +5,10 @@ > > #ifndef _L2FWD_COMMON_H_ > > #define _L2FWD_COMMON_H_ > > > > +#include > > + > > +#include > > + > > #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 > > > > #define MAX_PKT_BURST 32 > > @@ -34,4 +38,26 @@ struct l2fwd_port_statistics { > > uint64_t dropped; > > } __rte_cache_aligned; > > > > +volatile bool force_quit; > > + > > +int mac_updating; > > + > > +/* ethernet addresses of ports */ > > +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; > > + > > +/* mask of enabled ports */ > > +static uint32_t l2fwd_enabled_port_mask; > > + > > +/* list of enabled ports */ > > +static uint32_t l2fwd_dst_ports[RTE_MAX_ETHPORTS]; > > + [Anoob] Static has to be removed from all the above vars. Will fix in the n= ext version. > > +struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; > > + > > +struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; > > + > > +struct l2fwd_port_statistics port_statistics[RTE_MAX_ETHPORTS]; > > + > > +/* A tsc-based timer responsible for triggering statistics printout > > +*/ uint64_t timer_period; >=20 > Instead of moving global variables to other header file, IMO, it is bette= r to > create a structure with context and share with workers with > rte_eal_mp_remote_launch() or so. [Anoob] That would make the design a bit different from regular l2fwd. Even= in l2fwd, all these variable are present. Be it global or static. Another option is to have the vars declared as extern in the l2fwd_worker.c= and remove the additions in the header. If that approach is fine, we can k= eep the changes between l2fwd & l2fwd-event minimal. Please share your thou= ghts on which approach would be better.