From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id E20CF1B1CC for ; Tue, 9 Jan 2018 19:55:51 +0100 (CET) Received: by mail-pf0-f194.google.com with SMTP id n6so9201243pfa.4 for ; Tue, 09 Jan 2018 10:55:51 -0800 (PST) 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=S0oldHfIWyf/U3bOv//W8W9UDprbsfL/IPVsfXmmJpo=; b=blJctG39xS2INFPX7L9CK4PqzrMXqP1FG8H5poTr+ZoZBRELO7YYcthe9UXSQngF4+ 7L7sKnW5e60NMo94wVh8QTua+HEwn+HygAvcu10OLmI1z4aqHkgixLngvaDGVk4wlQut MjeBF8Olq6hj1BTfYwJlhBWjiAhBO64Iv7rmfhdskC4MSb0U83RVY3UN7GizS3w2BkPh J15j8TLi2TcSCmlp+B127FwqKcevqMFOSLlmvkzdSemwWYtDB0oyCccfUBJCWHTur4Cn L+PfbJ4U6BXm3kQirZij2spCNt05Cvh3U1Zz13jViNm6RAYhhiU5tLAIXERgvYYy38Uj I2Ug== 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=S0oldHfIWyf/U3bOv//W8W9UDprbsfL/IPVsfXmmJpo=; b=DvYVpNISJfuwOvis7rJKnDqHFtlxn5MsIo9wCVj2ohKDEpsPL6YPHvI/oP/nzrVk7b 9FlP1NyI88URmuPsGnrn7z7MhTqNPsSZhgAtLdkiMoMFw8KVyilWbS2EJyGK1wOJfqMw uk28/Tej5pGLkphzgklVJgUHZb9NZsrvgO/4RTefFqZ3Un348And4LNxr65Gn1O3uAxW Ma/GsrzPlcbddTnKwKRCnHq5QEqBpe60tYRmiPtx+Zi1Uu/zYBR+uvjR//tspuHpIWVv bO+13/M61KSVgE8A/eReZz7dF/fx3gKXHhD5xLwY6DAm9GeHXuleniuvKAwLsNZ+zW4F Htcw== X-Gm-Message-State: AKGB3mIBJrz7fKQWLkCuhUoF4w634xZsPIe6H4HUisMX43mkZte+Z5kv khAqkCcfA5LdAUWw66FwbgcdLQ== X-Google-Smtp-Source: ACJfBosReepBxsXcmV6EoUpKqS4ki/VRVXmNa74cMZDB6mNhu/KPO4gp/G+eXGVvHNXAz8Yrt8B+nQ== X-Received: by 10.101.81.7 with SMTP id f7mr12989237pgq.435.1515524150954; Tue, 09 Jan 2018 10:55:50 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id h192sm33511672pfc.139.2018.01.09.10.55.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2018 10:55:50 -0800 (PST) Date: Tue, 9 Jan 2018 10:55:49 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: Thomas Monjalon , dev@dpdk.org, stable@dpdk.org, declan.doherty@intel.com, Boris Pismenny , Aviad Yehezkel , Radu Nicolau Message-ID: <20180109105549.6c853ade@xeon-e3> In-Reply-To: <20180109162317.18183-6-ferruh.yigit@intel.com> References: <20171201022957.64329-1-ferruh.yigit@intel.com> <20180109162317.18183-1-ferruh.yigit@intel.com> <20180109162317.18183-6-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer 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, 09 Jan 2018 18:55:52 -0000 On Tue, 9 Jan 2018 16:23:17 +0000 Ferruh Yigit wrote: > "struct rte_eth_rxtx_callback" is defined as internal data structure and > used as named opaque type. > > So the functions that are adding callbacks can return objects in this > type instead of void pointer. > > Signed-off-by: Ferruh Yigit > --- > v2: > * keep using struct * in parameters, instead add callback functions > return struct rte_eth_rxtx_callback pointer. > --- > lib/librte_ether/rte_ethdev.c | 6 +++--- > lib/librte_ether/rte_ethdev.h | 9 ++++++--- > 2 files changed, 9 insertions(+), 6 deletions(-) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index b3918b77a..184245880 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -3115,7 +3115,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, > return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg); > } > > -void * > +struct rte_eth_rxtx_callback * > rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, > rte_rx_callback_fn fn, void *user_param) > { > @@ -3157,7 +3157,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, > return cb; > } > > -void * > +struct rte_eth_rxtx_callback * > rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, > rte_rx_callback_fn fn, void *user_param) > { > @@ -3192,7 +3192,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, > return cb; > } > > -void * > +struct rte_eth_rxtx_callback * > rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, > rte_tx_callback_fn fn, void *user_param) > { > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index a61a97c6a..2877a455c 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -2846,7 +2846,8 @@ int rte_eth_dev_get_dcb_info(uint16_t port_id, > * NULL on error. > * On success, a pointer value which can later be used to remove the callback. > */ > -void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, > +struct rte_eth_rxtx_callback * > +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, > rte_rx_callback_fn fn, void *user_param); > > /** > @@ -2874,7 +2875,8 @@ void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, > * NULL on error. > * On success, a pointer value which can later be used to remove the callback. > */ > -void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, > +struct rte_eth_rxtx_callback * > +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, > rte_rx_callback_fn fn, void *user_param); > > /** > @@ -2901,7 +2903,8 @@ void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, > * NULL on error. > * On success, a pointer value which can later be used to remove the callback. > */ > -void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, > +struct rte_eth_rxtx_callback * > +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, > rte_tx_callback_fn fn, void *user_param); > > /** I would prefer that the public API keep a typed (but opaque pointer). Use of void * is problematic and likely to cause bugs.