From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f45.google.com (mail-pg0-f45.google.com [74.125.83.45]) by dpdk.org (Postfix) with ESMTP id 9CD792901 for ; Fri, 19 May 2017 19:34:35 +0200 (CEST) Received: by mail-pg0-f45.google.com with SMTP id u187so41150841pgb.0 for ; Fri, 19 May 2017 10:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2JERsiiZSt7r4DDAU9WOM6o9/6l8bX8fzIYllYZyYEM=; b=kPu/kEwaZV9x5QfAfagMxwy99jnvBG/hkCpRgVrIFsPHlop14uuhoTVWtAsoasLon5 fV+oKOnmKCkZyWJLW6G52iD2ykgjcT3r3UUxADLCuCMamwlO6t7Rh7kA65aQjPiV6wng /TjMk7tx8vUXPRnCLSsIZZekxo+KUgH0ioUb/dppid215L6x+qUvtkLr5K77GLdzKTN+ op0Z2P66hhHlrjYt6rg2xWbRjYMk2RFmAen7FiZtHFmJJ5ZU50OwwZqKKOGLkm887F+0 ASQS8VEOngEDDcL64ZqoooZL6UXrp1YR/HIUCyeCRMx92JPfw7pkS1lvBWUFxsYuWYqR OUmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2JERsiiZSt7r4DDAU9WOM6o9/6l8bX8fzIYllYZyYEM=; b=GeubWlyKUshhd1t+KjhYcqAZmAJdH3U5oQYxdF4pp4MJEUIwvsELerAfZ1iR0W3EtZ r+OXMyMooJttpwPCMOSWFJM07dHncMcEe0oYEYZOCD4QR/RgxHTiKjM2zNMN6XmC7uM7 gS3xllMOh7lCY6jCliLj5Ev9FgXFKoPs1X0UDN3bAdbGfNDrDLiToEPa8oD6p9N2sDHz YdG2Sy1HMT3JJKUfB/Tg0NAkqyD41dUWJFDPB4cgQ66S4yDSGWji3dJQMhi5VY3wT3V1 b2BULT6MpfBQaFk4gW6rFLhyFkBLpGgL5u2gHG1nukkJIULL09SqeV+0KdXwzGmVzEMg jyuw== X-Gm-Message-State: AODbwcBJBgJVBxnC8N0CMsTntDgeKnxkgtPlEHCb8Xxc1776tDjNIRmC ean7eSrbV9ghDxS9 X-Received: by 10.99.116.74 with SMTP id e10mr11431031pgn.194.1495215274852; Fri, 19 May 2017 10:34:34 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id y2sm16918018pfk.1.2017.05.19.10.34.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 May 2017 10:34:34 -0700 (PDT) Date: Fri, 19 May 2017 10:34:27 -0700 From: Stephen Hemminger To: Cristian Dumitrescu Cc: dev@dpdk.org, thomas.monjalon@6wind.com, jerin.jacob@caviumnetworks.com, balasubramanian.manoharan@cavium.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Message-ID: <20170519103427.4b083a11@xeon-e3> In-Reply-To: <1495213972-109148-3-git-send-email-cristian.dumitrescu@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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Fri, 19 May 2017 17:34:36 -0000 On Fri, 19 May 2017 18:12:52 +0100 Cristian Dumitrescu wrote: > + > +#define RTE_TM_FUNC(port_id, func) \ > +({ \ > + const struct rte_tm_ops *ops = \ > + rte_tm_ops_get(port_id, error); \ > + if (ops == NULL) \ > + return -rte_errno; \ > + \ > + if (ops->func == NULL) \ > + return -rte_tm_error_set(error, \ > + ENOSYS, \ > + RTE_TM_ERROR_TYPE_UNSPECIFIED, \ > + NULL, \ > + rte_strerror(ENOSYS)); \ > + \ > + ops->func; \ > +}) 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.