From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D0EEC28CC3 for ; Fri, 7 Jun 2019 10:02:49 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 9BE59212F5 for ; Fri, 7 Jun 2019 10:02:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="roeSTe+y"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=marvell.onmicrosoft.com header.i=@marvell.onmicrosoft.com header.b="CxfXUbSX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BE59212F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marvell.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A9B51B9A1; Fri, 7 Jun 2019 12:02:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id EFCB71B99A for ; Fri, 7 Jun 2019 12:02:45 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x579xcDC013339; Fri, 7 Jun 2019 03:02:45 -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=KL+8f9+Gs0CwOseeY+7uXoS2xWXJLAe+/H1dQcQmRYE=; b=roeSTe+ybXGnxUXht4TlgGY3Iu/vUZkMK0xSZwq9lzEyBU+vqgzGwJQYS9NW5BiKV07B HhPVh42LKSi1jl+4phBOU+iscZ4SHKn0yRDWJIW9A77FsMLslEmpiTtaccmEPcTxS+J4 2KW4JBh4rBqvt8ypgBaUZrdmr0chDYLJ2iIwb6qRHy3tL65o3VQlbICaqDgiJLnPmBEW fOUQYoIH3AIiirnI7/RiNBITxQTWlYEHkMfmdan5UHLW9JfentuMpiPdw6cTBIQ2am0d f3jvuf3MrZuE3wofZH3iQlOO16v028H8o/nyvhmP8IpByWgOFbsBGg5QzhShnZaYKcZq Bg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2sydhfsmvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 07 Jun 2019 03:02:45 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 7 Jun 2019 03:02:43 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.56) 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:02:43 -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=KL+8f9+Gs0CwOseeY+7uXoS2xWXJLAe+/H1dQcQmRYE=; b=CxfXUbSXU8HYCbJGyyk8JAP2thGo6NYLeuxjuLqMciJ8lzSCgqU+vHT4uKalFTM1CbQKI4soByRK9T7NwfVb7vQDjMJ9egQOd/cgeQLeVM1xtp5f3IUui+MNNKxehymZ8hsZKS/uQW3O5gyyeAAhVGE/BPrMHQhyVFVMXpkb29g= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2455.namprd18.prod.outlook.com (20.179.92.24) 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 10:02:41 +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 10:02:41 +0000 From: Jerin Jacob Kollanukkaran 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 , =?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+oug Date: Fri, 7 Jun 2019 10:02:41 +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: <1559583160-13944-5-git-send-email-anoobj@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f18b813a-4830-4d82-a3f6-08d6eb2f4771 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:BYAPR18MB2455; x-ms-traffictypediagnostic: BYAPR18MB2455: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:612; x-forefront-prvs: 0061C35778 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(366004)(376002)(346002)(396003)(13464003)(189003)(199004)(73956011)(476003)(76116006)(186003)(99286004)(11346002)(446003)(52536014)(8936002)(256004)(53936002)(6246003)(3846002)(14444005)(6116002)(66476007)(66556008)(64756008)(66446008)(316002)(66946007)(66574012)(110136005)(55236004)(71200400001)(5660300002)(54906003)(2906002)(71190400001)(7416002)(486006)(33656002)(68736007)(305945005)(478600001)(74316002)(229853002)(7736002)(14454004)(6436002)(8676002)(76176011)(25786009)(86362001)(7696005)(26005)(81166006)(81156014)(6506007)(53546011)(66066001)(4326008)(102836004)(9686003)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2455; 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: DB/AnQPAkhHgbUzW8d7j2IwYl3Yy2Nv5coqWfdSjSVLcmxxmmFRxarCX5Lb5Xyi0edzg56C5PVw1QPr9LqLMy05x5NECjtxIJilbasDlFE46zxOWNugdXG6Rz50Ydtm47TGq5krNsxUTvc+Io0xnMyCAjBGrPZRUYTTp2bf7/F7sJJzDK5B5s5rID24H+EX4vFI4w9L5jWdUjiFv150gLdfzjv4dYgJRchrpNQoMTYOM+Ay4VaMIuZcz0gBJ3xmSZ/A+xixU0L0L/7KWhSWk4NhTQEfFHI/jriTubjDHw/zVrYgdv3Eyn7pkLsWxzbstT9KnIy23q3UYHpISlYuaP39Tfa/L2fbkhwc90pKmGCbXSfppq+Se5otpVOjTem8DBxNGHvzVjlVQxkTgRxyMUfcbdIftQqCEeRNpb8YFdpk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f18b813a-4830-4d82-a3f6-08d6eb2f4771 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2019 10:02:41.2904 (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: BYAPR18MB2455 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" > -----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 >=20 > Moving global variables to common header for access from control plane an= d > data plane code. >=20 > 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(-) >=20 > 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_ >=20 > +#include > + > +#include > + > #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 >=20 > #define MAX_PKT_BURST 32 > @@ -34,4 +38,26 @@ struct l2fwd_port_statistics { > uint64_t dropped; > } __rte_cache_aligned; >=20 > +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]; > + > +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.