From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6AEBD2B88 for ; Mon, 22 May 2017 16:25:48 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2017 07:25:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,377,1491289200"; d="scan'208";a="264924814" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga004.fm.intel.com with ESMTP; 22 May 2017 07:25:46 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.239]) by IRSMSX151.ger.corp.intel.com ([169.254.4.123]) with mapi id 14.03.0319.002; Mon, 22 May 2017 15:25:46 +0100 From: "Dumitrescu, Cristian" To: Stephen Hemminger CC: "dev@dpdk.org" , "thomas.monjalon@6wind.com" , "jerin.jacob@caviumnetworks.com" , "balasubramanian.manoharan@cavium.com" , "hemant.agrawal@nxp.com" , "shreyansh.jain@nxp.com" Thread-Topic: [dpdk-dev] [PATCH v4 2/2] ethdev: add traffic management API Thread-Index: AQHS0MN31TwlO7jqZUWQ3TflextATaH72gmAgASSUXA= Date: Mon, 22 May 2017 14:25:45 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891265279F0A6@IRSMSX108.ger.corp.intel.com> References: <1488589820-206947-2-git-send-email-cristian.dumitrescu@intel.com> <1495213972-109148-1-git-send-email-cristian.dumitrescu@intel.com> <1495213972-109148-3-git-send-email-cristian.dumitrescu@intel.com> <20170519103427.4b083a11@xeon-e3> In-Reply-To: <20170519103427.4b083a11@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTczODg0MzQtNjRmNy00MTY1LTk4NjAtYWJjNGJkOWM2MGZlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjdlWElpZnp1SXh1ZEVZeXVxV3NYcDRNUjZncnNyQXhxOXBFVHNFWUZSNU09In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 2/2] ethdev: add traffic management API 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: Mon, 22 May 2017 14:25:49 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Friday, May 19, 2017 6:34 PM > To: Dumitrescu, Cristian > Cc: dev@dpdk.org; thomas.monjalon@6wind.com; > jerin.jacob@caviumnetworks.com; > balasubramanian.manoharan@cavium.com; hemant.agrawal@nxp.com; > shreyansh.jain@nxp.com > Subject: Re: [dpdk-dev] [PATCH v4 2/2] ethdev: add traffic management API >=20 > On Fri, 19 May 2017 18:12:52 +0100 > Cristian Dumitrescu wrote: >=20 > > + > > +#define RTE_TM_FUNC(port_id, func) \ > > +({ \ > > + const struct rte_tm_ops *ops =3D \ > > + rte_tm_ops_get(port_id, error); \ > > + if (ops =3D=3D NULL) \ > > + return -rte_errno; \ > > + \ > > + if (ops->func =3D=3D NULL) \ > > + return -rte_tm_error_set(error, \ > > + ENOSYS, \ > > + RTE_TM_ERROR_TYPE_UNSPECIFIED, \ > > + NULL, \ > > + rte_strerror(ENOSYS)); \ > > + \ > > + ops->func; \ > > +}) >=20 > If you are going to use a templating macro why not go all the way > and generate the whole function. Examples are in Linux kernel > macros are often used to generate show and set functions. After thinking long and hard, this is the best I was able to come up with. = It would be good if you could pick any of the functions in this file and pr= ovide an example for your idea?