From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0087.outbound.protection.outlook.com [104.47.1.87]) by dpdk.org (Postfix) with ESMTP id B44C32C16; Tue, 25 Apr 2017 13:36:01 +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=TFPW/lR0eN2hIDnGwQRu6MR3E2iOuSw2MqCdVQRns8k=; b=SETx9lSwyqbIgDUg3/jkzDQFG4HZw8hEBMsdCxJPrjz4cMvVF18Ntk+M6MV5+qMTJ3b8WYTfdMOEFEI0kHi9oJTDxEcuaAX+HhEpvKdlrfQ0Qb7iN/J7OXguy+lhqozbY9ty7CPTmpx7iv5MHK5kuAxNRVc5+ie1tPW/SNkgBjg= Received: from AM4PR05MB1505.eurprd05.prod.outlook.com (10.164.79.147) by AM4PR05MB1507.eurprd05.prod.outlook.com (10.164.79.149) 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:36:00 +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:35:59 +0000 From: Shahaf Shuler To: Adrien Mazarguil , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API Thread-Index: AQHSvZ5VWE84di6u+Eyra++sYJPir6HV9GUw Date: Tue, 25 Apr 2017 11:35:58 +0000 Message-ID: References: <1ee903d53826fd4709eca74275b2913eb11c83b9.1493108423.git.adrien.mazarguil@6wind.com> In-Reply-To: <1ee903d53826fd4709eca74275b2913eb11c83b9.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; AM4PR05MB1507; 7:0Q/cfpbhhwZRj6pD9E2OF7I3xH8Wt+n3N8qbkrsSANrIXwLA6WvfNbHE8nID45yi5k7tNl0HFWBO4k2zGr9QAD0gbbhciXPpKjQNi2XYsPuCEqNiLRt724879jer5gPIGFnqG4wlv3dPwEqSNlKExqRYuuP3zfl1G8DEs7RqkZQkZujnAX+7YMI9odRuTltaeN18szDIo3/dRQmaA2HHcVPWiGYupuw5dLwL8sPLeO3N6iQLA7LmweL4oNFnwH/ABCGfKPupxHQ3TyTBUdrfmim8wYF+7p3PyvB8x0Abo/5Pip2UZms+jjwTe8xMJr0vl5rC0kgEGOWx1Hh4zyDzvg== x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: 80c4de67-351d-4153-680c-08d48bcf3eeb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:AM4PR05MB1507; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:AM4PR05MB1507; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1507; x-forefront-prvs: 0288CD37D9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39860400002)(39400400002)(39840400002)(39850400002)(39410400002)(377454003)(3660700001)(2501003)(4326008)(25786009)(8676002)(3280700002)(81166006)(66066001)(7696004)(2950100002)(8936002)(5250100002)(189998001)(2906002)(229853002)(76176999)(5660300001)(7736002)(74316002)(3846002)(102836003)(6116002)(50986999)(6436002)(6506006)(9686003)(33656002)(38730400002)(6246003)(2900100001)(54356999)(55016002)(86362001)(575784001)(99286003)(53936002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1507; 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:35:59.3366 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1507 Subject: Re: [dpdk-stable] [PATCH v2 11/13] ethdev: fix C++ errors in flow API X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2017 11:36:02 -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:428:2: error: expected primary-expression befor= e > '.' token > [...] > build/include/rte_flow.h:469: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: 6de5c0f1302c ("ethdev: define default item masks in flow API") >=20 > Cc: stable@dpdk.org > Signed-off-by: Adrien Mazarguil Acked-by: Shahaf Shuler > --- > lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) >=20 > diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h in= dex > 7749491..bc7bc45 100644 > --- a/lib/librte_ether/rte_flow.h > +++ b/lib/librte_ether/rte_flow.h > @@ -314,9 +314,11 @@ struct rte_flow_item_any { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_ANY. */ > +#ifndef __cplusplus > static const struct rte_flow_item_any rte_flow_item_any_mask =3D { > .num =3D 0x00000000, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_VF > @@ -341,9 +343,11 @@ struct rte_flow_item_vf { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_VF. */ > +#ifndef __cplusplus > static const struct rte_flow_item_vf rte_flow_item_vf_mask =3D { > .id =3D 0x00000000, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_PORT > @@ -370,9 +374,11 @@ struct rte_flow_item_port { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */ > +#ifndef __cplusplus > static const struct rte_flow_item_port rte_flow_item_port_mask =3D { > .index =3D 0x00000000, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_RAW > @@ -403,6 +409,7 @@ struct rte_flow_item_raw { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */ > +#ifndef __cplusplus > static const struct rte_flow_item_raw rte_flow_item_raw_mask =3D { > .relative =3D 1, > .search =3D 1, > @@ -411,6 +418,7 @@ static const struct rte_flow_item_raw > rte_flow_item_raw_mask =3D { > .limit =3D 0xffff, > .length =3D 0xffff, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_ETH > @@ -424,11 +432,13 @@ struct rte_flow_item_eth { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */ > +#ifndef __cplusplus > static const struct rte_flow_item_eth rte_flow_item_eth_mask =3D { > .dst.addr_bytes =3D "\xff\xff\xff\xff\xff\xff", > .src.addr_bytes =3D "\xff\xff\xff\xff\xff\xff", > .type =3D 0x0000, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_VLAN > @@ -444,10 +454,12 @@ struct rte_flow_item_vlan { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */ > +#ifndef __cplusplus > static const struct rte_flow_item_vlan rte_flow_item_vlan_mask =3D { > .tpid =3D 0x0000, > .tci =3D 0xffff, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_IPV4 > @@ -461,12 +473,14 @@ struct rte_flow_item_ipv4 { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */ > +#ifndef __cplusplus > static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask =3D { > .hdr =3D { > .src_addr =3D 0xffffffff, > .dst_addr =3D 0xffffffff, > }, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_IPV6. > @@ -480,6 +494,7 @@ struct rte_flow_item_ipv6 { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */ > +#ifndef __cplusplus > static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask =3D { > .hdr =3D { > .src_addr =3D > @@ -490,6 +505,7 @@ static const struct rte_flow_item_ipv6 > rte_flow_item_ipv6_mask =3D { > "\xff\xff\xff\xff\xff\xff\xff\xff", > }, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_ICMP. > @@ -501,12 +517,14 @@ struct rte_flow_item_icmp { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */ > +#ifndef __cplusplus > static const struct rte_flow_item_icmp rte_flow_item_icmp_mask =3D { > .hdr =3D { > .icmp_type =3D 0xff, > .icmp_code =3D 0xff, > }, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_UDP. > @@ -518,12 +536,14 @@ struct rte_flow_item_udp { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */ > +#ifndef __cplusplus > static const struct rte_flow_item_udp rte_flow_item_udp_mask =3D { > .hdr =3D { > .src_port =3D 0xffff, > .dst_port =3D 0xffff, > }, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_TCP. > @@ -535,12 +555,14 @@ struct rte_flow_item_tcp { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */ > +#ifndef __cplusplus > static const struct rte_flow_item_tcp rte_flow_item_tcp_mask =3D { > .hdr =3D { > .src_port =3D 0xffff, > .dst_port =3D 0xffff, > }, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_SCTP. > @@ -552,12 +574,14 @@ struct rte_flow_item_sctp { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */ > +#ifndef __cplusplus > static const struct rte_flow_item_sctp rte_flow_item_sctp_mask =3D { > .hdr =3D { > .src_port =3D 0xffff, > .dst_port =3D 0xffff, > }, > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_VXLAN. > @@ -572,9 +596,11 @@ struct rte_flow_item_vxlan { }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. */ > +#ifndef __cplusplus > static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask =3D { > .vni =3D "\xff\xff\xff", > }; > +#endif >=20 > /** > * RTE_FLOW_ITEM_TYPE_E_TAG. > -- > 2.1.4