[dpdk-dev,7/7] rte_ether: mark deprecated statistics with attribute

Message ID 1446771879-3979-8-git-send-email-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Headers

Commit Message

Stephen Hemminger Nov. 6, 2015, 1:04 a.m. UTC
  Use deprecated attribute to highlight any use of fields that
are marked as going away in the rte_ether device statistics.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_eal/common/include/rte_common.h |  3 +++
 lib/librte_ether/rte_ethdev.h              | 16 ++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)
  

Comments

Thomas Monjalon Nov. 12, 2015, 10:03 p.m. UTC | #1
2015-11-05 17:04, Stephen Hemminger:
> Use deprecated attribute to highlight any use of fields that
> are marked as going away in the rte_ether device statistics.

The example app ip_pipeline does not compile.
I will add a patch to fix it.
  

Patch

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 3121314..f8ca6f3 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -69,6 +69,9 @@  typedef uint32_t unaligned_uint32_t;
 typedef uint16_t unaligned_uint16_t;
 #endif
 
+/******* Macro to mark functions and fields scheduled for removal *****/
+#define __rte_deprecated	__attribute__((__deprecated__))
+
 /*********** Macros to eliminate unused variable warnings ********/
 
 /**
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index f653e37..49a6889 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -198,25 +198,25 @@  struct rte_eth_stats {
 	/**< Total of RX packets dropped by the HW,
 	 * because there are no available mbufs (i.e. RX queues are full).
 	 */
-	uint64_t ibadcrc;
+	uint64_t ibadcrc __rte_deprecated;
 	/**< Deprecated; Total of RX packets with CRC error. */
-	uint64_t ibadlen;
+	uint64_t ibadlen __rte_deprecated;
 	/**< Deprecated; Total of RX packets with bad length. */
 	uint64_t ierrors;   /**< Total number of erroneous received packets. */
 	uint64_t oerrors;   /**< Total number of failed transmitted packets. */
 	uint64_t imcasts;   /**< Total number of multicast received packets. */
 	uint64_t rx_nombuf; /**< Total number of RX mbuf allocation failures. */
-	uint64_t fdirmatch;
+	uint64_t fdirmatch __rte_deprecated;
 	/**< Deprecated; Total number of RX packets matching a filter. */
-	uint64_t fdirmiss;
+	uint64_t fdirmiss __rte_deprecated;
 	/**< Deprecated; Total number of RX packets not matching any filter. */
-	uint64_t tx_pause_xon;
+	uint64_t tx_pause_xon __rte_deprecated;
 	 /**< Deprecated; Total nb. of XON pause frame sent. */
-	uint64_t rx_pause_xon;
+	uint64_t rx_pause_xon  __rte_deprecated;
 	/**< Deprecated; Total nb. of XON pause frame received. */
-	uint64_t tx_pause_xoff;
+	uint64_t tx_pause_xoff __rte_deprecated;
 	/**< Deprecated; Total nb. of XOFF pause frame sent. */
-	uint64_t rx_pause_xoff;
+	uint64_t rx_pause_xoff __rte_deprecated;
 	/**< Deprecated; Total nb. of XOFF pause frame received. */
 	uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
 	/**< Total number of queue RX packets. */