From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 605129E3 for ; Tue, 25 Apr 2017 03:18:42 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 24 Apr 2017 18:18:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,247,1488873600"; d="scan'208";a="253020290" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2017 18:18:41 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Apr 2017 18:18:41 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.193]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.217]) with mapi id 14.03.0319.002; Tue, 25 Apr 2017 09:18:39 +0800 From: "Xing, Beilei" To: Adrien Mazarguil , "dev@dpdk.org" Thread-Topic: [PATCH 12/13] ethdev: fix C++ errors in flow API (MPLS, GRE) Thread-Index: AQHSvRL+veA+Vn+dVUCscv+8/u0yuqHVSR6g Date: Tue, 25 Apr 2017 01:18:38 +0000 Message-ID: <94479800C636CB44BD422CB454846E01315E8D46@SHSMSX101.ccr.corp.intel.com> References: <7bcb59287ddea099179915808ecf056be62ad742.1493048352.git.adrien.mazarguil@6wind.com> In-Reply-To: <7bcb59287ddea099179915808ecf056be62ad742.1493048352.git.adrien.mazarguil@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGNkNTFjYjItNmEyYS00Y2RjLWJjZDUtMDg5OTVmMjE2ZjY5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Im83VnpGSVU3M0lNa2pcL1M5YnEzSXVndVFOWDBaNmk4dlRaNGkra0hlaXJzPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 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 01:18:43 -0000 > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Monday, April 24, 2017 11:53 PM > To: dev@dpdk.org > Cc: Xing, Beilei > Subject: [PATCH 12/13] ethdev: fix C++ errors in flow API (MPLS, GRE) >=20 > 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++ initi= alizers > will be added later if necessary. >=20 > Fixes: 7cd048321d1d ("ethdev: add MPLS and GRE flow API items") >=20 > Cc: Beilei Xing > Signed-off-by: Adrien Mazarguil > --- > 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 Acked-by: Beilei Xing Thanks.