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 3CDCFA0096 for ; Fri, 7 Jun 2019 14:51:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A04361BBD3; Fri, 7 Jun 2019 14:51:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 8B63C1BB78 for ; Fri, 7 Jun 2019 14:51:41 +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 x57Ci6JK014457; Fri, 7 Jun 2019 05:51:40 -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=W2RF1Zc+yWat533CfVcP2UQkVmZpynZxQJZCCPwYa5Q=; b=MkGxb52kwXee0vd870qB8/VUyeRiZ/hcjr6R5TGqscVeFqtVIe3i0LJ2iOywiEZW2O+d m4FyJWoDbxRmpgAIeOoPIVbzqw+QBkOHg19iJzGHhZB7V/lq7yyDnb3+t4970Grpu4LD 8thL07NVnFxILJW4Y5ePXOq7WAT0CbK3PZ3qQbsyMTGJgJZ0eBtcc81fh0IRWyko5q9B gaFnmLvidIJDFNA5GzQUalUnpixMhtQDOUo8HIghpX5m/JQHYfktdfRtUJ9UOZUt1osJ WHK4VJjK9P//vYEuQo1x6dJ5+CMHBagT1PTTmfJf2JljEvQkMXZzilquoh0S1AyxsxXV IQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2syjp0s6m8-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 07 Jun 2019 05:51:40 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 7 Jun 2019 05:47:15 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (104.47.48.51) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 7 Jun 2019 05:47:15 -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=W2RF1Zc+yWat533CfVcP2UQkVmZpynZxQJZCCPwYa5Q=; b=U/Sx/o1POQ46iB7DN3tmtTtbRYRJ2aQ/LE05b6TGRsGBuOQxB6FFGssyj8HNoi2a4uEv5EjHzVKWS+29Q0HZCxbI3ZLaDYpB7g438xxWFXJoRoQ23qDHckFgdocn//juav6f6MAfe5EKzUBN8ergNGNOjf24Z2FsNV9hvdmsg9k= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2710.namprd18.prod.outlook.com (20.179.56.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.12; Fri, 7 Jun 2019 12:47:13 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::1ce4:557d:eeb8:843c]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::1ce4:557d:eeb8:843c%7]) with mapi id 15.20.1965.011; Fri, 7 Jun 2019 12:47:13 +0000 From: Jerin Jacob Kollanukkaran To: Anoob Joseph , 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: AQHVGjKQ+V3Ku82whE+B8uMwgeQoN6aP+ouggAANPACAACB48A== Date: Fri, 7 Jun 2019 12:47:13 +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-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.178.234.223] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7a3ee2c6-12ff-4589-c503-08d6eb4643de x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BYAPR18MB2710; x-ms-traffictypediagnostic: BYAPR18MB2710: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0061C35778 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(136003)(13464003)(189003)(199004)(11346002)(71190400001)(86362001)(6246003)(54906003)(476003)(446003)(53546011)(486006)(110136005)(76116006)(4326008)(316002)(8936002)(81166006)(81156014)(186003)(305945005)(99286004)(71200400001)(26005)(7736002)(66946007)(102836004)(25786009)(7696005)(8676002)(66476007)(6506007)(66556008)(64756008)(66446008)(73956011)(68736007)(256004)(76176011)(14444005)(9686003)(53936002)(52536014)(5660300002)(14454004)(55016002)(2906002)(66066001)(229853002)(6116002)(6436002)(3846002)(33656002)(478600001)(7416002)(66574012)(74316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2710; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: YMFWNd8iG27ro5EkSuSv2jxp6incWjKBjt+G4tVpR7b+L9S9M1PZwu7SWBl6s/tL0isvGs7YEzuECV3hFpHsjREN4qUNbVst1k+JULwcVa6Pu8FupXQnobGxvjsbOygbne95HatyjszWY5D5P4PfIiAQgVNnvVjsn3u2JOQbgN6vBre11xkRh7Huq8UCQ45nFOsSIgiD6ZGWlgDm+qBaj2okR+jqJF2iPX/OT1bbqbzPtNrjj7SAk3YqHv0/+CAZyt+7KmAUDMBAnNWngnPirQzslEKdPRBaovJR6QT+b4lrp+azHd/gpKCGp1jodtQNyBiJYLDk9vHJTmCh8yWq+UmTBQNtOLZrlG6AgLeu+qddikDEnobry0C3UbL1AsLl+cJDFX43FgbBotPzBZ4HcMylCxMoqfHBAKb1cLccIDI= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7a3ee2c6-12ff-4589-c503-08d6eb4643de X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2019 12:47:13.6925 (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: jerinj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2710 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-07_06:, , 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" > -----Original Message----- > From: Anoob Joseph > Sent: Friday, June 7, 2019 4:15 PM > 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 > ; Mattias R=F6nnblom > ; Liang Ma > Subject: RE: [PATCH 04/39] examples/l2fwd-event: move global vars to comm= on > header >=20 > Hi Jerin, Hi Anoob, >=20 > Please see inline. >=20 > Thanks, > Anoob >=20 > > -----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 > > common header > > > > > -----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]; > > > + >=20 > [Anoob] Static has to be removed from all the above vars. Will fix in the= next > version. OK > > > +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; > > > > Instead of moving global variables to other header file, IMO, it is > > better to create a structure with context and share with workers with > > rte_eal_mp_remote_launch() or so. >=20 > [Anoob] That would make the design a bit different from regular l2fwd. Ev= en in > l2fwd, all these variable are present. Be it global or static. >=20 > 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 keep= the > changes between l2fwd & l2fwd-event minimal. Please share your thoughts o= n > which approach would be better. I think, we can avoid global variable to communicate between Workers. I think, we don't need worry about diff between l2fwd and l2fwd-ev= ent. If worried about maintaining the patches splitting then I can think we can squash a few l2fwd app patches if required to add the context structure. It will be scalable approach.