From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0080.outbound.protection.outlook.com [104.47.0.80]) by dpdk.org (Postfix) with ESMTP id E344A2BA2 for ; Tue, 25 Apr 2017 13:37:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Tyb1/8tzJB+F/N5VSifPQoh6uGhQqn3YFeS9I2fFbv4=; b=u7evsygfoeeC+9kEC4Ty0+ylDuRTl+hqQDbbJXBN4dnQ3GvaSWupUHBIAjydjKD4XdxhjJShSzCEZjtoijb8Jz2xH4lL4P33jmqJDBFkI2hR2ljEpc40EcVOUUXPlp5c/e0/pE15d5o6rhIYGPKEDCh+1ORHRLClhV13sSeR6Qk= Received: from AM4PR05MB1505.eurprd05.prod.outlook.com (10.164.79.147) by AM4PR05MB1508.eurprd05.prod.outlook.com (10.164.79.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Tue, 25 Apr 2017 11:37:18 +0000 Received: from AM4PR05MB1505.eurprd05.prod.outlook.com ([fe80::5c3d:704c:90d6:8bca]) by AM4PR05MB1505.eurprd05.prod.outlook.com ([fe80::5c3d:704c:90d6:8bca%14]) with mapi id 15.01.1047.019; Tue, 25 Apr 2017 11:37:18 +0000 From: Shahaf Shuler To: Adrien Mazarguil , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 12/13] ethdev: fix C++ errors in flow API (MPLS, GRE) Thread-Index: AQHSvZ6Wk2RM27H2KEaG9XH8ERCkt6HV9Scw Date: Tue, 25 Apr 2017 11:37:18 +0000 Message-ID: References: <384c50c8ea539fc02a133dbb9a0ec59e6036db54.1493108423.git.adrien.mazarguil@6wind.com> In-Reply-To: <384c50c8ea539fc02a133dbb9a0ec59e6036db54.1493108423.git.adrien.mazarguil@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [31.154.10.107] x-microsoft-exchange-diagnostics: 1; AM4PR05MB1508; 7:D26K5/ouecg8C6tmCzGkrXsQSRoHcJdoC0rkxg5h4e9vWyU5Sa76QBmlrMHZ8HTfkUdhN5Jri9Nktoc7YbhvCW4JcGc+v/gdFG3kQlWZzsl2RqdTIfqrZghYfRdAJiZ8DWkV0OQYe9RPn4Uz9WEVbOzK7RpLIq/l4mFXJnDidJG7D4lnBDwXQ1eW4mi90gHnKj+ovRijYr5f2RIVWBEI9HMhlznuMksWZCgeAIgWMCMZrvoBKgORavl43oMN56KQVpFPDeANBosMlbiGjfZrsZvK7i2GrTrU4YCWDJsScQgfUkhcddzDgXI1i6utrbckCAIvoiOt7L/dFEnFrnZXeA== x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: 917c8072-9857-495a-ab5c-08d48bcf6db8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:AM4PR05MB1508; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:AM4PR05MB1508; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1508; x-forefront-prvs: 0288CD37D9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39850400002)(39840400002)(39860400002)(39410400002)(39400400002)(377454003)(6246003)(38730400002)(305945005)(7736002)(8936002)(76176999)(81166006)(189998001)(86362001)(25786009)(66066001)(3280700002)(50986999)(33656002)(3660700001)(2950100002)(5660300001)(2906002)(54356999)(99286003)(6116002)(7696004)(229853002)(102836003)(3846002)(55016002)(2501003)(6506006)(9686003)(2900100001)(6436002)(5250100002)(53936002)(74316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1508; H:AM4PR05MB1505.eurprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2017 11:37:18.0341 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1508 Subject: Re: [dpdk-dev] [PATCH v2 12/13] ethdev: fix C++ errors in flow API (MPLS, GRE) 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: , X-List-Received-Date: Tue, 25 Apr 2017 11:37:22 -0000 Tuesday, April 25, 2017 11:30 AM, Adrien Mazarguil: > This commit addresses the following compilation errors: >=20 > In file included from build/include/rte_flow_driver.h:50:0, > from /tmp/check-includes.sh.1397.cc:1: > build/include/rte_flow.h:631:1: error: C99 designator 'label_tc_s' outsi= de > aggregate initializer > [...] > build/include/rte_flow.h:631:1: error: initializer-string for array of > chars is too long [-fpermissive] > [...] > build/include/rte_flow.h:650:1: sorry, unimplemented: non-trivial > designated initializers not supported [...] >=20 > C++ does not support the C99-style designated initializers used in this > file for the default item masks. While the resulting symbols are primaril= y > useful to PMDs (written in C), they are exposed as part of the public API= for > documentation purposes and to assist application writers. >=20 > Considering that: >=20 > - using pre-C99 initialization style for compatibility with C++ would > render them difficult to understand (all struct members must be > initialized) > - using both initialization styles would be needlessly verbose > - not exposing them at all would defeat their purpose > - applications do not normally need these symbols at run time >=20 > This commit hides these symbols from C++ applications. Specific C++ > initializers will be added later if necessary. >=20 > Fixes: 7cd048321d1d ("ethdev: add MPLS and GRE flow API items") >=20 > Signed-off-by: Adrien Mazarguil > Acked-by: Beilei Xing Acked-by: Shahaf Shuler > --- > lib/librte_ether/rte_flow.h | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h in= dex > bc7bc45..abd4c6a 100644 > --- a/lib/librte_ether/rte_flow.h > +++ b/lib/librte_ether/rte_flow.h > @@ -652,9 +652,11 @@ struct rte_flow_item_mpls { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_MPLS. */ > +#ifndef __cplusplus > static const struct rte_flow_item_mpls rte_flow_item_mpls_mask =3D { > .label_tc_s =3D "\xff\xff\xf0", > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_GRE. > @@ -671,9 +673,11 @@ struct rte_flow_item_gre { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_GRE. */ > +#ifndef __cplusplus > static const struct rte_flow_item_gre rte_flow_item_gre_mask =3D { > .protocol =3D 0xffff, > }; > +#endif >=20 > /** > * Matching pattern item definition. > -- > 2.1.4