From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id ADDC511F5 for ; Fri, 9 Mar 2018 12:25:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2018 03:25:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,445,1515484800"; d="scan'208";a="26587743" Received: from silpixa00399777.ir.intel.com (HELO silpixa00399777.ger.corp.intel.com) ([10.237.222.236]) by fmsmga002.fm.intel.com with ESMTP; 09 Mar 2018 03:25:38 -0800 From: Ferruh Yigit To: Neil Horman , John McNamara , Marko Kovacevic , Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit Date: Fri, 9 Mar 2018 11:25:31 +0000 Message-Id: <20180309112531.292163-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180117215802.90809-2-ferruh.yigit@intel.com> References: <20180117215802.90809-2-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v4] 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: Fri, 09 Mar 2018 11:25:43 -0000 "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 Acked-by: Stephen Hemminger --- v2: * keep using struct * in parameters, instead add callback functions return struct rte_eth_rxtx_callback pointer. v4: * Remove deprecation notice. LIBABIVER already increased in this release --- doc/guides/rel_notes/deprecation.rst | 7 ------- lib/librte_ether/rte_ethdev.c | 6 +++--- lib/librte_ether/rte_ethdev.h | 13 ++++++++----- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index ad54de721..0c696f743 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -142,13 +142,6 @@ Deprecation Notices successful. This modification will only impact the PMDs, not the applications. -* ethdev: functions add rx/tx callback will return named opaque type - ``rte_eth_add_rx_callback()``, ``rte_eth_add_first_rx_callback()`` and - ``rte_eth_add_tx_callback()`` functions currently return callback object as - ``void \*`` but APIs to delete callbacks get ``struct rte_eth_rxtx_callback \*`` - as parameter. For consistency functions adding callback will return - ``struct rte_eth_rxtx_callback \*`` instead of ``void \*``. - * i40e: The default flexible payload configuration which extracts the first 16 bytes of the payload for RSS will be deprecated starting from 18.02. If required the previous behavior can be configured using existing flow diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 86bce0872..77628cc05 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3501,7 +3501,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type 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) { @@ -3543,7 +3543,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) { @@ -3578,7 +3578,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 213fe27e1..d58b0cb02 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -3004,6 +3004,8 @@ int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); +struct rte_eth_rxtx_callback; + /** * Add a callback to be called on packet RX on a given port and queue. * @@ -3028,7 +3030,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); /** @@ -3056,7 +3059,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); /** @@ -3083,11 +3087,10 @@ 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); -struct rte_eth_rxtx_callback; - /** * Remove an RX packet callback from a given port and queue. * -- 2.13.6