Skip to contentSkip to conversation

dpdk: enhance EXPERIMENTAL api tagging

PATCH Superseded Neil Horman 7 participants 83 messages Dec 1, 2017 – Jan 31, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

cover dpdk: enhance EXPERIMENTAL api tagging

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_FUNCTIONS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

#1 lore raw

PATCH 1/4 buildtools: Add tool to check EXPERIMENTAL api exports

This tools reads the given version map for a directory, and checks to ensure that, for each symbol listed in the export list, the corresponding definition is tagged as __experimental, erroring out if its not. In this way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 buildtools/experimentalsyms.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100755 buildtools/experimentalsyms.sh
buildtools/experimentalsyms.sh new file +34 -0
new file mode 100755
index 000000000..dc01f71ba
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+MAPFILE=$1
+OBJFILE=$2
+
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
+if [ -d $OBJFILE ]
+then
+	exit 0
+fi
+
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental, but is listed in version map"
+		echo "Please add __experimental to the definition of $SYM"
+		exit 1
+	fi	
+done
+exit 0
+
Signature · 1 line
2.14.3
#2 lore raw

PATCH 2/4 compat: Add __experimental macro

In reply to Neil Horman

The __experimental macro tags a given exported function as being part of the EXPERIMENTAL api. Use of this tag will cause any caller of the function (that isn't removed by dead code elimination) to emit a warning that the user is making use of an API whos stabilty isn't guaranteed. It also places the function in the .text.experimental section, which is used to validate the tag against the corresponding library version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 lib/librte_compat/rte_compat.h | 2 ++
 1 file changed, 2 insertions(+)
lib/librte_compat/rte_compat.h +2 -0
index 41e8032ba..c7c967d86 100644
@@ -101,5 +101,7 @@
  */
 #endif
 
+#define __experimental \
+__attribute__(( deprecated("Symbol is not yet part of stable abi"), section(".text.experimental") ))
 
 #endif /* _RTE_COMPAT_H_ */
Signature · 1 line
2.14.3
#3 lore raw

PATCH 3/4 dpdk: add __experimental tag to appropriate api calls

In reply to Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 lib/librte_eal/common/eal_common_dev.c             |  5 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 ++--
 lib/librte_eal/common/include/rte_dev.h            |  5 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  7 ++--
 lib/librte_eal/common/include/rte_service.h        | 40 +++++++++---------
 .../common/include/rte_service_component.h         | 10 ++---
 lib/librte_eal/common/rte_service.c                | 49 +++++++++++-----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 +++++------
 lib/librte_ether/rte_mtr.h                         | 26 ++++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
 14 files changed, 124 insertions(+), 114 deletions(-)
lib/librte_eal/common/eal_common_dev.c +3 -2
index dda8f5835..8a46ccab6 100644
@@ -37,6 +37,7 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
@@ -133,7 +134,7 @@ full_dev_name(const char *bus, const char *dev, const char *args)
 	return name;
 }
 
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs)
 {
 	struct rte_bus *bus;
@@ -203,7 +204,7 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
 	return ret;
 }
 
-int rte_eal_hotplug_remove(const char *busname, const char *devname)
+int __experimental rte_eal_hotplug_remove(const char *busname, const char *devname)
 {
 	struct rte_bus *bus;
 	struct rte_device *dev;
lib/librte_eal/common/eal_common_devargs.c +4 -3
index 6ac88d6ab..8e46d54bd 100644
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
@@ -85,7 +86,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name)
 	return strncmp(bus->name, name, strlen(bus->name));
 }
 
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 {
 	struct rte_bus *bus = NULL;
@@ -139,7 +140,7 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 	return 0;
 }
 
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da)
 {
 	int ret;
@@ -188,7 +189,7 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
 	return -1;
 }
 
-int
+int __experimental
 rte_eal_devargs_remove(const char *busname, const char *devname)
 {
 	struct rte_devargs *d;
lib/librte_eal/common/include/rte_dev.h +3 -2
index 9342e0cbd..e3e52dcb8 100644
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -209,7 +210,7 @@ int rte_eal_dev_detach(struct rte_device *dev);
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs);
 
 /**
@@ -225,7 +226,7 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_remove(const char *busname, const char *devname);
+int __experimental rte_eal_hotplug_remove(const char *busname, const char *devname);
 
 /**
  * Device comparison function.
lib/librte_eal/common/include/rte_devargs.h +4 -3
index 58d585df6..7148949c9 100644
@@ -50,6 +50,7 @@ extern "C" {
 
 #include <stdio.h>
 #include <sys/queue.h>
+#include <rte_compat.h>
 #include <rte_bus.h>
 
 /**
@@ -136,7 +137,7 @@ int rte_eal_parse_devargs_str(const char *devargs_str,
  *   - 0 on success.
  *   - Negative errno on error.
  */
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev,
 		      struct rte_devargs *da);
 
@@ -150,7 +151,7 @@ rte_eal_devargs_parse(const char *dev,
  *   - 0 on success
  *   - Negative on error.
  */
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da);
 
 /**
@@ -193,7 +194,7 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
  *   <0 on error.
  *   >0 if the devargs was not within the user device list.
  */
-int rte_eal_devargs_remove(const char *busname, const char *devname);
+int __experimental rte_eal_devargs_remove(const char *busname, const char *devname);
 
 /**
  * Count the number of user devices of a specified type
lib/librte_eal/common/include/rte_service.h +20 -20
index 927244065..595f156d2 100644
@@ -84,7 +84,7 @@ extern "C" {
  *
  * @return The number of services registered.
  */
-uint32_t rte_service_get_count(void);
+uint32_t __experimental rte_service_get_count(void);
 
 /**
  * @warning
@@ -111,7 +111,7 @@ uint32_t rte_service_get_count(void);
  * @retval -EINVAL Null *service_id* pointer provided
  * @retval -ENODEV No such service registered
  */
-int32_t rte_service_get_by_name(const char *name, uint32_t *service_id);
+int32_t __experimental rte_service_get_by_name(const char *name, uint32_t *service_id);
 
 /**
  * @warning
@@ -122,7 +122,7 @@ int32_t rte_service_get_by_name(const char *name, uint32_t *service_id);
  * @return A pointer to the name of the service. The returned pointer remains
  *         in ownership of the service, and the application must not free it.
  */
-const char *rte_service_get_name(uint32_t id);
+const char __experimental *rte_service_get_name(uint32_t id);
 
 /**
  * @warning
@@ -135,7 +135,7 @@ const char *rte_service_get_name(uint32_t id);
  * @retval 1 Capability supported by this service instance
  * @retval 0 Capability not supported by this service instance
  */
-int32_t rte_service_probe_capability(uint32_t id, uint32_t capability);
+int32_t __experimental rte_service_probe_capability(uint32_t id, uint32_t capability);
 
 /**
  * @warning
@@ -159,7 +159,7 @@ int32_t rte_service_probe_capability(uint32_t id, uint32_t capability);
  * @retval 0 lcore map updated successfully
  * @retval -EINVAL An invalid service or lcore was provided.
  */
-int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
+int32_t __experimental rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
 				  uint32_t enable);
 
 /**
@@ -175,7 +175,7 @@ int32_t rte_service_map_lcore_set(uint32_t service_id, uint32_t lcore,
  * @retval 0 lcore is not mapped to service
  * @retval -EINVAL An invalid service or lcore was provided.
  */
-int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
+int32_t __experimental rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
 
 /**
  * @warning
@@ -192,7 +192,7 @@ int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore);
  * @retval 0 The service was successfully started
  * @retval -EINVAL Invalid service id
  */
-int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);
+int32_t __experimental rte_service_runstate_set(uint32_t id, uint32_t runstate);
 
 /**
  * @warning
@@ -210,7 +210,7 @@ int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate);
  * @retval 0 Service is stopped
  * @retval -EINVAL Invalid service id
  */
-int32_t rte_service_runstate_get(uint32_t id);
+int32_t __experimental rte_service_runstate_get(uint32_t id);
 
 /**
  * @warning
@@ -226,7 +226,7 @@ int32_t rte_service_runstate_get(uint32_t id);
  * @retval 0 Success
  * @retval -EINVAL Invalid service ID
  */
-int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
+int32_t __experimental rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
 
 /**
  * @warning
@@ -264,7 +264,7 @@ int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable);
  * @retval -ENOEXEC Service is not in a run-able state
  * @retval -EINVAL Invalid service id
  */
-int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
+int32_t __experimental rte_service_run_iter_on_app_lcore(uint32_t id,
 		uint32_t serialize_multithread_unsafe);
 
 /**
@@ -280,7 +280,7 @@ int32_t rte_service_run_iter_on_app_lcore(uint32_t id,
  * @retval -EINVAL Failed to start core. The *lcore_id* passed in is not
  *          currently assigned to be a service core.
  */
-int32_t rte_service_lcore_start(uint32_t lcore_id);
+int32_t __experimental rte_service_lcore_start(uint32_t lcore_id);
 
 /**
  * @warning
@@ -299,7 +299,7 @@ int32_t rte_service_lcore_start(uint32_t lcore_id);
  *          The application must stop the service first, and then stop the
  *          lcore.
  */
-int32_t rte_service_lcore_stop(uint32_t lcore_id);
+int32_t __experimental rte_service_lcore_stop(uint32_t lcore_id);
 
 /**
  * @warning
@@ -315,7 +315,7 @@ int32_t rte_service_lcore_stop(uint32_t lcore_id);
  * @retval -EALREADY lcore is already added to the service core list
  * @retval -EINVAL Invalid lcore provided
  */
-int32_t rte_service_lcore_add(uint32_t lcore);
+int32_t __experimental rte_service_lcore_add(uint32_t lcore);
 
 /**
  * @warning
@@ -329,7 +329,7 @@ int32_t rte_service_lcore_add(uint32_t lcore);
  * @retval -EBUSY Lcore is not stopped, stop service core before removing.
  * @retval -EINVAL failed to add lcore to service core mask.
  */
-int32_t rte_service_lcore_del(uint32_t lcore);
+int32_t __experimental rte_service_lcore_del(uint32_t lcore);
 
 /**
  * @warning
@@ -346,7 +346,7 @@ int32_t rte_service_lcore_del(uint32_t lcore);
  *
  * @return The number of service cores currently configured.
  */
-int32_t rte_service_lcore_count(void);
+int32_t __experimental rte_service_lcore_count(void);
 
 /**
  * @warning
@@ -358,7 +358,7 @@ int32_t rte_service_lcore_count(void);
  *
  * @retval 0 Success
  */
-int32_t rte_service_lcore_reset_all(void);
+int32_t __experimental rte_service_lcore_reset_all(void);
 
 /**
  * @warning
@@ -372,7 +372,7 @@ int32_t rte_service_lcore_reset_all(void);
  * @retval 0 Success
  * @retval -EINVAL Invalid service pointer passed
  */
-int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable);
+int32_t __experimental rte_service_set_stats_enable(uint32_t id, int32_t enable);
 
 /**
  * @warning
@@ -393,7 +393,7 @@ int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable);
  *          service core list. No items have been populated, call this function
  *          with a size of at least *rte_service_core_count* items.
  */
-int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);
+int32_t __experimental rte_service_lcore_list(uint32_t array[], uint32_t n);
 
 /**
  * @warning
@@ -406,7 +406,7 @@ int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);
  * @retval -EINVAL Invalid lcore provided
  * @retval -ENOTSUP The provided lcore is not a service core.
  */
-int32_t rte_service_lcore_count_services(uint32_t lcore);
+int32_t __experimental rte_service_lcore_count_services(uint32_t lcore);
 
 /**
  * @warning
@@ -418,7 +418,7 @@ int32_t rte_service_lcore_count_services(uint32_t lcore);
  * @retval 0 Statistics have been successfully dumped
  * @retval -EINVAL Invalid service id provided
  */
-int32_t rte_service_dump(FILE *f, uint32_t id);
+int32_t __experimental rte_service_dump(FILE *f, uint32_t id);
 
 #ifdef __cplusplus
 }
lib/librte_eal/common/include/rte_service_component.h +5 -5
index ac965cb48..e414df56a 100644
@@ -37,7 +37,7 @@
  * Include this file if you are writing a component that requires CPU cycles to
  * operate, and you wish to run the component using service cores
  */
-
+#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
@@ -101,7 +101,7 @@ struct rte_service_spec {
  *         -EINVAL Attempted to register an invalid service (eg, no callback
  *         set)
  */
-int32_t rte_service_component_register(const struct rte_service_spec *spec,
+int32_t __experimental rte_service_component_register(const struct rte_service_spec *spec,
 				       uint32_t *service_id);
 
 /**
@@ -116,7 +116,7 @@ int32_t rte_service_component_register(const struct rte_service_spec *spec,
  * @retval -EBUSY The service is currently running, stop the service before
  *          calling unregister. No action has been taken.
  */
-int32_t rte_service_component_unregister(uint32_t id);
+int32_t __experimental rte_service_component_unregister(uint32_t id);
 
 /**
  * @warning
@@ -134,7 +134,7 @@ int32_t rte_service_component_unregister(uint32_t id);
  * @retval -ENODEV Error in enabling service lcore on a service
  * @retval -ENOEXEC Error when starting services
  */
-int32_t rte_service_start_with_defaults(void);
+int32_t __experimental rte_service_start_with_defaults(void);
 
 /**
  * @warning
@@ -151,7 +151,7 @@ int32_t rte_service_start_with_defaults(void);
  *
  * @retval 0 Success
  */
-int32_t rte_service_component_runstate_set(uint32_t id, uint32_t runstate);
+int32_t __experimental rte_service_component_runstate_set(uint32_t id, uint32_t runstate);
 
 /**
  * @warning
lib/librte_eal/common/rte_service.c +25 -24

198 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal.c +1 -0
index 229eec9f1..73a0da22c 100644
@@ -53,6 +53,7 @@
 #include <sys/io.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
lib/librte_ether/rte_mtr.c +13 -12
index 4f56f8714..2cbe0bb5a 100644
@@ -34,6 +34,7 @@
 #include <stdint.h>
 
 #include <rte_errno.h>
+#include "rte_compat.h"
 #include "rte_ethdev.h"
 #include "rte_mtr_driver.h"
 #include "rte_mtr.h"
@@ -86,7 +87,7 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error)
 })
 
 /* MTR capabilities get */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error)
@@ -97,7 +98,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
 }
 
 /* MTR meter profile add */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -109,7 +110,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
 }
 
 /** MTR meter profile delete */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error)
@@ -120,7 +121,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
 }
 
 /** MTR object create */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -133,7 +134,7 @@ rte_mtr_create(uint16_t port_id,
 }
 
 /** MTR object destroy */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -144,7 +145,7 @@ rte_mtr_destroy(uint16_t port_id,
 }
 
 /** MTR object meter enable */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -155,7 +156,7 @@ rte_mtr_meter_enable(uint16_t port_id,
 }
 
 /** MTR object meter disable */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -166,7 +167,7 @@ rte_mtr_meter_disable(uint16_t port_id,
 }
 
 /** MTR object meter profile update */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -178,7 +179,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
 }
 
 /** MTR object meter DSCP table update */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -190,7 +191,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
 }
 
 /** MTR object policer action update */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -203,7 +204,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
 }
 
 /** MTR object enabled stats update */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -215,7 +216,7 @@ rte_mtr_stats_update(uint16_t port_id,
 }
 
 /** MTR object stats read */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_ether/rte_mtr.h +13 -13
index f6b6ef3b6..fd8361998 100644
@@ -74,7 +74,7 @@
  * @b EXPERIMENTAL: this API may change without prior notice
  */
 #include <stdint.h>
-
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
@@ -447,7 +447,7 @@ struct rte_mtr_error {
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error);
@@ -470,7 +470,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -491,7 +491,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error);
@@ -519,7 +519,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
  *
  * @see enum rte_flow_action_type::RTE_FLOW_ACTION_TYPE_METER
  */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -542,7 +542,7 @@ rte_mtr_create(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -569,7 +569,7 @@ rte_mtr_destroy(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -590,7 +590,7 @@ rte_mtr_meter_disable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -609,7 +609,7 @@ rte_mtr_meter_enable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -633,7 +633,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -659,7 +659,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -684,7 +684,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -715,7 +715,7 @@ rte_mtr_stats_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_flow_classify/rte_flow_classify.c +7 -6
index e6f448643..6716672fc 100644
@@ -31,6 +31,7 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
 #include <rte_flow_driver.h>
@@ -245,7 +246,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params)
 	return 0;
 }
 
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params)
 {
 	struct rte_flow_classifier *cls;
@@ -291,7 +292,7 @@ rte_flow_classify_table_free(struct rte_table *table)
 		table->ops.f_free(table->h_table);
 }
 
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls)
 {
 	uint32_t i;
@@ -369,7 +370,7 @@ rte_table_check_params(struct rte_flow_classifier *cls,
 	return 0;
 }
 
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 	struct rte_flow_classify_table_params *params,
 	uint32_t *table_id)
@@ -483,7 +484,7 @@ allocate_acl_ipv4_5tuple_rule(void)
 	return rule;
 }
 
-struct rte_flow_classify_rule *
+struct rte_flow_classify_rule * __experimental
 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		int *key_found,
@@ -582,7 +583,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 	return rule;
 }
 
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule)
@@ -659,7 +660,7 @@ action_apply(struct rte_flow_classifier *cls,
 	return ret;
 }
 
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_flow_classify/rte_flow_classify.h +6 -5
index 1211873a1..cd9516f9e 100644
@@ -70,6 +70,7 @@
  *    with rte_flow_classifier_free()
  */
 
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
@@ -176,7 +177,7 @@ struct rte_flow_classify_ipv4_5tuple_stats {
  * @return
  *   Handle to flow classifier instance on success or NULL otherwise
  */
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params);
 
 /**
@@ -187,7 +188,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls);
 
 /**
@@ -203,7 +204,7 @@ rte_flow_classifier_free(struct rte_flow_classifier *cls);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 		struct rte_flow_classify_table_params *params,
 		uint32_t *table_id);
@@ -250,7 +251,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule);
@@ -274,7 +275,7 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_security/rte_security.c +8 -8
index 1227fca8a..958b7273e 100644
@@ -33,12 +33,12 @@
 
 #include <rte_malloc.h>
 #include <rte_dev.h>
-
+#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
 struct rte_security_session *
-rte_security_session_create(struct rte_security_ctx *instance,
+__experimental rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
@@ -61,7 +61,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
 	return sess;
 }
 
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf)
@@ -70,7 +70,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
 	return instance->ops->session_update(instance->device, sess, conf);
 }
 
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats)
@@ -79,7 +79,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 	return instance->ops->session_stats_get(instance->device, sess, stats);
 }
 
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess)
 {
@@ -98,7 +98,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 	return ret;
 }
 
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *m, void *params)
@@ -108,14 +108,14 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 					       sess, m, params);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance)
 {
 	RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->capabilities_get, NULL);
 	return instance->ops->capabilities_get(instance->device);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx)
 {
lib/librte_security/rte_security.h +12 -11
index 653929b99..176378e78 100644
@@ -52,6 +52,7 @@ extern "C" {
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_mbuf.h>
@@ -291,7 +292,7 @@ struct rte_security_session {
  *  - On success, pointer to session
  *  - On failure, NULL
  */
-struct rte_security_session *
+struct rte_security_session * __experimental
 rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
@@ -306,7 +307,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  *  - On success returns 0
  *  - On failure return errno
  */
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf);
@@ -323,7 +324,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *  - -EINVAL if session is NULL.
  *  - -EBUSY if not all device private data has been freed.
  */
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess);
 
@@ -340,7 +341,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *mb, void *params);
@@ -351,7 +352,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  * @param	sym_op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 			      struct rte_security_session *sess)
 {
@@ -360,13 +361,13 @@ __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 	return 0;
 }
 
-static inline void *
+static inline void * __experimental
 get_sec_session_private_data(const struct rte_security_session *sess)
 {
 	return sess->sess_private_data;
 }
 
-static inline void
+static inline void __experimental
 set_sec_session_private_data(struct rte_security_session *sess,
 			     void *private_data)
 {
@@ -382,7 +383,7 @@ set_sec_session_private_data(struct rte_security_session *sess,
  * @param	op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 rte_security_attach_session(struct rte_crypto_op *op,
 			    struct rte_security_session *sess)
 {
@@ -424,7 +425,7 @@ struct rte_security_stats {
  *  - On success return 0
  *  - On failure errno
  */
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats);
@@ -507,7 +508,7 @@ struct rte_security_capability_idx {
  *   - Returns array of security capabilities.
  *   - Return NULL if no capabilities available.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance);
 
 /**
@@ -521,7 +522,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *     index criteria.
  *   - Return NULL if the capability not matched on security instance.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx);
 
Signature · 1 line
2.14.3
#4 lore raw

PATCH 4/4 Makefiles: Add experimental tag check and warnings to trigger on use

In reply to Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add a ALLOW_EXPERIMENTAL_FUNCTIONS variable check to allow for in-tree dpdk libraries to override those checks.

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 app/test-eventdev/Makefile                 |  2 ++
 app/test-pmd/Makefile                      |  2 ++
 drivers/event/sw/Makefile                  |  2 ++
 drivers/net/failsafe/Makefile              |  2 ++
 drivers/net/ixgbe/Makefile                 |  2 ++
 examples/eventdev_pipeline_sw_pmd/Makefile |  2 ++
 examples/flow_classify/Makefile            |  2 ++
 examples/ipsec-secgw/Makefile              |  2 ++
 examples/service_cores/Makefile            |  2 ++
 lib/librte_eal/linuxapp/Makefile           |  2 ++
 lib/librte_eal/linuxapp/eal/Makefile       |  4 ++++
 lib/librte_eventdev/Makefile               |  3 +++
 lib/librte_security/Makefile               |  3 +++
 mk/internal/rte.compile-pre.mk             | 14 ++++++++++++--
 mk/toolchain/clang/rte.vars.mk             |  2 +-
 mk/toolchain/gcc/rte.vars.mk               |  2 +-
 mk/toolchain/icc/rte.vars.mk               |  4 ++--
 17 files changed, 46 insertions(+), 6 deletions(-)
app/test-eventdev/Makefile +2 -0
index dcb2ac476..e68870828 100644
@@ -32,6 +32,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 APP = dpdk-test-eventdev
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
app/test-pmd/Makefile +2 -0
index d21308fcd..f0262a369 100644
@@ -33,6 +33,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 ifeq ($(CONFIG_RTE_TEST_PMD),y)
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 #
 # library name
 #
drivers/event/sw/Makefile +2 -0
index 2f2b67bac..0711ce46e 100644
@@ -33,6 +33,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 # library name
 LIB = librte_pmd_sw_event.a
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
drivers/net/failsafe/Makefile +2 -0
index ea2a8fe46..795da9d56 100644
@@ -36,6 +36,8 @@ LIB = librte_pmd_failsafe.a
 
 EXPORT_MAP := rte_pmd_failsafe_version.map
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 LIBABIVER := 1
 
 # Sources are stored in SRCS-y
drivers/net/ixgbe/Makefile +2 -0
index 511a64eb0..b8431600a 100644
@@ -36,6 +36,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_ixgbe.a
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/eventdev_pipeline_sw_pmd/Makefile +2 -0
index de4e22c88..4272caf93 100644
@@ -32,6 +32,8 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
examples/flow_classify/Makefile +2 -0
index eecdde14c..b04747c40 100644
@@ -33,6 +33,8 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
examples/ipsec-secgw/Makefile +2 -0
index 9fd33cb7f..90a4feca1 100644
@@ -33,6 +33,8 @@ ifeq ($(RTE_SDK),)
 	$(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
examples/service_cores/Makefile +2 -0
index bd4a345dc..ba731e259 100644
@@ -32,6 +32,8 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
lib/librte_eal/linuxapp/Makefile +2 -0
index 2ebdf3139..11ee59e42 100644
@@ -31,6 +31,8 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 2
+
 DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal
 DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio
 DIRS-$(CONFIG_RTE_KNI_KMOD) += kni
lib/librte_eal/linuxapp/eal/Makefile +4 -0
index 5a7b8b2ac..84f8edf39 100644
@@ -34,6 +34,10 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_eal.a
 
 ARCH_DIR ?= $(RTE_ARCH)
+
+#Allow the use of experimental functions without warning
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1 
+
 EXPORT_MAP := ../../rte_eal_version.map
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
lib/librte_eventdev/Makefile +3 -0
index 5ac22cde7..8ae9e16f3 100644
@@ -36,6 +36,9 @@ LIB = librte_eventdev.a
 # library version
 LIBABIVER := 3
 
+# Allow the use of experimental functions 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
lib/librte_security/Makefile +3 -0
index bb93ec33d..c2815fab8 100644
@@ -36,6 +36,9 @@ LIB = librte_security.a
 # library version
 LIBABIVER := 1
 
+# Allow the use of experimental functions without warnings
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
mk/internal/rte.compile-pre.mk +12 -2
index da8dda498..f67048d75 100644
@@ -72,18 +72,27 @@ CMDS-all := $(CMDS-y) $(CMDS-n) $(CMDS-)
 
 -include $(DEPS-y) $(CMDS-y)
 
+ifdef ALLOW_EXPERIMENTAL_FUNCTIONS
+EXPERIMENTAL_CFLAGS := $(subst 1, -Wno-deprecated-declarations -Wno-deprecated -Wno-error=deprecated-declarations -Wno-error=deprecated, $(ALLOW_EXPERIMENTAL_FUNCTIONS))
+else
+EXPERIMENTAL_CFLAGS := 
+endif
+
 # command to compile a .c file to generate an object
 ifeq ($(USE_HOST),1)
 C_TO_O = $(HOSTCC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(HOST_CPPFLAGS) $(HOST_CFLAGS) \
-	$(CFLAGS_$(@)) $(HOST_EXTRA_CPPFLAGS) $(HOST_EXTRA_CFLAGS) -o $@ -c $<
+	$(CFLAGS_$(@)) $(HOST_EXTRA_CPPFLAGS) $(HOST_EXTRA_CFLAGS) $(EXPERIMENTAL_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  HOSTCC $(@)")
 else
 C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \
-	$(CFLAGS_$(@)) $(EXTRA_CPPFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
+	$(CFLAGS_$(@)) $(EXTRA_CPPFLAGS) $(EXTRA_CFLAGS) $(EXPERIMENTAL_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
 endif
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
+
 PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ [email protected]
 PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o [email protected] [email protected]
 PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o [email protected] [email protected] $@
@@ -100,6 +109,7 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
mk/toolchain/clang/rte.vars.mk +1 -1
index dde922d22..3cfe92545 100644
@@ -67,7 +67,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/gcc/rte.vars.mk +1 -1
index 3b907e201..3356a37c8 100644
@@ -75,7 +75,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/icc/rte.vars.mk +2 -2
index 33a8ba79e..b4b992e0e 100644
@@ -70,10 +70,10 @@ TOOLCHAIN_ASFLAGS =
 #   error #15527: loop was not vectorized: function call to fprintf cannot be vectorize
 #                   was declared "deprecated"
 #   Warning #11074, 11076: to prevent "inline-max-size" warnings.
-WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478
+WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478 
 WERROR_FLAGS += -diag-disable 13368 -diag-disable 15527
 WERROR_FLAGS += -diag-disable 188
-WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076
+WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror-all
Signature · 1 line
2.14.3
#5 lore raw

v2 cover dpdk: enhance EXPERIMENTAL api tagging

In reply to Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_FUNCTIONS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

#6 lore raw

PATCH v2 1/4 buildtools: Add tool to check EXPERIMENTAL api exports

This tools reads the given version map for a directory, and checks to ensure that, for each symbol listed in the export list, the corresponding definition is tagged as __experimental, erroring out if its not. In this way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 buildtools/experimentalsyms.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 buildtools/experimentalsyms.sh
buildtools/experimentalsyms.sh new file +35 -0
new file mode 100755
index 000000000..7342ec9b3
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+MAPFILE=$1
+OBJFILE=$2
+
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
+if [ -d $OBJFILE ]
+then
+	exit 0
+fi
+
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental"
+		echo "but is listed in version map"
+		echo "Please add __experimental to the definition of $SYM"
+		exit 1
+	fi
+done
+exit 0
+
Signature · 1 line
2.14.3
#7 lore raw

PATCH v2 2/4 compat: Add __experimental macro

In reply to Neil Horman

The __experimental macro tags a given exported function as being part of the EXPERIMENTAL api. Use of this tag will cause any caller of the function (that isn't removed by dead code elimination) to emit a warning that the user is making use of an API whos stabilty isn't guaranteed. It also places the function in the .text.experimental section, which is used to validate the tag against the corresponding library version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 lib/librte_compat/rte_compat.h | 3 +++
 1 file changed, 3 insertions(+)
lib/librte_compat/rte_compat.h +3 -0
index 41e8032ba..3365a0345 100644
@@ -101,5 +101,8 @@
  */
 #endif
 
+#define __experimental \
+__attribute__((deprecated("Symbol is not yet part of stable abi"), \
+section(".text.experimental")))
 
 #endif /* _RTE_COMPAT_H_ */
Signature · 1 line
2.14.3
#8 lore raw

PATCH v2 3/4 Makefiles: Add experimental tag check and warnings to trigger on use

In reply to Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add a ALLOW_EXPERIMENTAL_FUNCTIONS variable check to allow for in-tree dpdk libraries to override those checks.

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 app/test-eventdev/Makefile                 |  2 ++
 app/test-pmd/Makefile                      |  2 ++
 drivers/event/sw/Makefile                  |  2 ++
 drivers/net/failsafe/Makefile              |  2 ++
 drivers/net/ixgbe/Makefile                 |  2 ++
 examples/eventdev_pipeline_sw_pmd/Makefile |  2 ++
 examples/flow_classify/Makefile            |  2 ++
 examples/ipsec-secgw/Makefile              |  2 ++
 examples/service_cores/Makefile            |  2 ++
 lib/librte_eal/bsdapp/eal/Makefile         |  2 ++
 lib/librte_eal/linuxapp/Makefile           |  2 ++
 lib/librte_eal/linuxapp/eal/Makefile       |  4 ++++
 lib/librte_eventdev/Makefile               |  3 +++
 lib/librte_security/Makefile               |  3 +++
 mk/internal/rte.compile-pre.mk             | 14 ++++++++++++--
 mk/toolchain/clang/rte.vars.mk             |  2 +-
 mk/toolchain/gcc/rte.vars.mk               |  2 +-
 mk/toolchain/icc/rte.vars.mk               |  2 +-
 18 files changed, 47 insertions(+), 5 deletions(-)
app/test-eventdev/Makefile +2 -0
index dcb2ac476..e68870828 100644
@@ -32,6 +32,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 APP = dpdk-test-eventdev
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
app/test-pmd/Makefile +2 -0
index d21308fcd..f0262a369 100644
@@ -33,6 +33,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 ifeq ($(CONFIG_RTE_TEST_PMD),y)
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 #
 # library name
 #
drivers/event/sw/Makefile +2 -0
index 2f2b67bac..0711ce46e 100644
@@ -33,6 +33,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 # library name
 LIB = librte_pmd_sw_event.a
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
drivers/net/failsafe/Makefile +2 -0
index ea2a8fe46..795da9d56 100644
@@ -36,6 +36,8 @@ LIB = librte_pmd_failsafe.a
 
 EXPORT_MAP := rte_pmd_failsafe_version.map
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 LIBABIVER := 1
 
 # Sources are stored in SRCS-y
drivers/net/ixgbe/Makefile +2 -0
index 511a64eb0..b8431600a 100644
@@ -36,6 +36,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_ixgbe.a
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/eventdev_pipeline_sw_pmd/Makefile +2 -0
index de4e22c88..4272caf93 100644
@@ -32,6 +32,8 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
examples/flow_classify/Makefile +2 -0
index eecdde14c..b04747c40 100644
@@ -33,6 +33,8 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
examples/ipsec-secgw/Makefile +2 -0
index 9fd33cb7f..90a4feca1 100644
@@ -33,6 +33,8 @@ ifeq ($(RTE_SDK),)
 	$(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
examples/service_cores/Makefile +2 -0
index bd4a345dc..ba731e259 100644
@@ -32,6 +32,8 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
lib/librte_eal/bsdapp/eal/Makefile +2 -0
index afa117de4..936010cd6 100644
@@ -33,6 +33,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 LIB = librte_eal.a
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 ARCH_DIR ?= $(RTE_ARCH)
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
lib/librte_eal/linuxapp/Makefile +2 -0
index 2ebdf3139..11ee59e42 100644
@@ -31,6 +31,8 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
+ALLOW_EXPERIMENTAL_FUNCTIONS := 2
+
 DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal
 DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio
 DIRS-$(CONFIG_RTE_KNI_KMOD) += kni
lib/librte_eal/linuxapp/eal/Makefile +4 -0
index 5a7b8b2ac..36d17efb6 100644
@@ -34,6 +34,10 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_eal.a
 
 ARCH_DIR ?= $(RTE_ARCH)
+
+#Allow the use of experimental functions without warning
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 EXPORT_MAP := ../../rte_eal_version.map
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
lib/librte_eventdev/Makefile +3 -0
index 5ac22cde7..e37de2820 100644
@@ -36,6 +36,9 @@ LIB = librte_eventdev.a
 # library version
 LIBABIVER := 3
 
+# Allow the use of experimental functions
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
lib/librte_security/Makefile +3 -0
index bb93ec33d..c2815fab8 100644
@@ -36,6 +36,9 @@ LIB = librte_security.a
 # library version
 LIBABIVER := 1
 
+# Allow the use of experimental functions without warnings
+ALLOW_EXPERIMENTAL_FUNCTIONS := 1
+
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
mk/internal/rte.compile-pre.mk +12 -2
index da8dda498..dea7f01a2 100644
@@ -72,18 +72,27 @@ CMDS-all := $(CMDS-y) $(CMDS-n) $(CMDS-)
 
 -include $(DEPS-y) $(CMDS-y)
 
+ifdef ALLOW_EXPERIMENTAL_FUNCTIONS
+EXPERIMENTAL_CFLAGS := $(subst 1, -Wno-deprecated-declarations -Wno-deprecated -Wno-error=deprecated-declarations -Wno-error=deprecated, $(ALLOW_EXPERIMENTAL_FUNCTIONS))
+else
+EXPERIMENTAL_CFLAGS :=
+endif
+
 # command to compile a .c file to generate an object
 ifeq ($(USE_HOST),1)
 C_TO_O = $(HOSTCC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(HOST_CPPFLAGS) $(HOST_CFLAGS) \
-	$(CFLAGS_$(@)) $(HOST_EXTRA_CPPFLAGS) $(HOST_EXTRA_CFLAGS) -o $@ -c $<
+	$(CFLAGS_$(@)) $(HOST_EXTRA_CPPFLAGS) $(HOST_EXTRA_CFLAGS) $(EXPERIMENTAL_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  HOSTCC $(@)")
 else
 C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \
-	$(CFLAGS_$(@)) $(EXTRA_CPPFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
+	$(CFLAGS_$(@)) $(EXTRA_CPPFLAGS) $(EXTRA_CFLAGS) $(EXPERIMENTAL_CFLAGS) -o $@ -c $<
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
 endif
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
+
 PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ [email protected]
 PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o [email protected] [email protected]
 PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o [email protected] [email protected] $@
@@ -100,6 +109,7 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
mk/toolchain/clang/rte.vars.mk +1 -1
index dde922d22..3cfe92545 100644
@@ -67,7 +67,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/gcc/rte.vars.mk +1 -1
index 3b907e201..3356a37c8 100644
@@ -75,7 +75,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/icc/rte.vars.mk +1 -1
index 33a8ba79e..58940602e 100644
@@ -73,7 +73,7 @@ TOOLCHAIN_ASFLAGS =
 WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478
 WERROR_FLAGS += -diag-disable 13368 -diag-disable 15527
 WERROR_FLAGS += -diag-disable 188
-WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076
+WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror-all
Signature · 1 line
2.14.3
#9 lore raw

Re: [PATCHv2 3/4] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 10 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add a ALLOW_EXPERIMENTAL_FUNCTIONS variable check to allow for in-tree dpdk libraries to override those checks.

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>

---

Hi Neil,

if I read the patch functionality correctly, the ALLOW_EXPERIMENTAL_FUNCTIONS variable simply suppresses all errors for deprecated functions. However, what we really want is just to suppress the errors for the experimental functions, and not any that really are deprecated. While we may not have any now in DPDK, that doesn't mean it might not be useful to have some in future.

Therefore, would an alternative scheme work where the experimental tag is set to empty if the ALLOW_EXPERIMENTAL_FUNCTIONS define is set when compiling?

/Bruce

#10 lore raw

Re: [PATCHv2 3/4] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 12 lines · Bruce Richardson
Quoted 10 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add a ALLOW_EXPERIMENTAL_FUNCTIONS variable check to allow for in-tree dpdk libraries to override those checks.

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>

---

Quoted 9 lines

Hi Neil,

if I read the patch functionality correctly, the ALLOW_EXPERIMENTAL_FUNCTIONS variable simply suppresses all errors for deprecated functions. However, what we really want is just to suppress the errors for the experimental functions, and not any that really are deprecated. While we may not have any now in DPDK, that doesn't mean it might not be useful to have some in future.

Well, they are all deprecated by the stict definition of the term, which is to say that their usage is discouraged/disapproved. What I think you are saying is that you would like to differentiate reasons for deprecation (i.e. deprecation because an api is experimental, vs deprecation because an api is broken or going to be removed). I'm not sure I see that we will get there anytime soon, but yes, that seems like it would be a good ability to add in here.

Quoted 4 lines

Therefore, would an alternative scheme work where the experimental tag is set to empty if the ALLOW_EXPERIMENTAL_FUNCTIONS define is set when compiling?

Yes, I think that could work. Perhaps what we can do is modify ALLOW_EXPERIMENTAL_FUNCTIONS to set a CFLAGS like:
-DSUPPRESS_EXPERIMENTAL

And use that to toggle the definition on rte_compat.h between something that deprecates the API call and an empty definition

Neil

Quoted 2 lines

/Bruce

#11 lore raw

Re: [PATCHv2 3/4] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 33 lines · Neil Horman
Quoted 12 lines · Bruce Richardson
Quoted 10 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add a ALLOW_EXPERIMENTAL_FUNCTIONS variable check to allow for in-tree dpdk libraries to override those checks.

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>

---

Quoted 9 lines

Hi Neil,

if I read the patch functionality correctly, the ALLOW_EXPERIMENTAL_FUNCTIONS variable simply suppresses all errors for deprecated functions. However, what we really want is just to suppress the errors for the experimental functions, and not any that really are deprecated. While we may not have any now in DPDK, that doesn't mean it might not be useful to have some in future.

Well, they are all deprecated by the stict definition of the term, which is to say that their usage is discouraged/disapproved. What I think you are saying is that you would like to differentiate reasons for deprecation (i.e. deprecation because an api is experimental, vs deprecation because an api is broken or going to be removed). I'm not sure I see that we will get there anytime soon, but yes, that seems like it would be a good ability to add in here.

Quoted 4 lines

Therefore, would an alternative scheme work where the experimental tag is set to empty if the ALLOW_EXPERIMENTAL_FUNCTIONS define is set when compiling?

Quoted 7 lines

Yes, I think that could work. Perhaps what we can do is modify ALLOW_EXPERIMENTAL_FUNCTIONS to set a CFLAGS like:
-DSUPPRESS_EXPERIMENTAL

And use that to toggle the definition on rte_compat.h between something that deprecates the API call and an empty definition

Yes, exactly what I was thinking, but failed to express so clearly.

Also, would the flag be best set globally when building DPDK itself, rather than changing individual makefiles per library?

#12 lore raw

Re: [PATCHv2 3/4] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 38 lines · Bruce Richardson
Quoted 37 lines · Neil Horman
Quoted 12 lines · Bruce Richardson
Quoted 10 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add a ALLOW_EXPERIMENTAL_FUNCTIONS variable check to allow for in-tree dpdk libraries to override those checks.

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>

---

Quoted 9 lines

Hi Neil,

if I read the patch functionality correctly, the ALLOW_EXPERIMENTAL_FUNCTIONS variable simply suppresses all errors for deprecated functions. However, what we really want is just to suppress the errors for the experimental functions, and not any that really are deprecated. While we may not have any now in DPDK, that doesn't mean it might not be useful to have some in future.

Well, they are all deprecated by the stict definition of the term, which is to say that their usage is discouraged/disapproved. What I think you are saying is that you would like to differentiate reasons for deprecation (i.e. deprecation because an api is experimental, vs deprecation because an api is broken or going to be removed). I'm not sure I see that we will get there anytime soon, but yes, that seems like it would be a good ability to add in here.

Quoted 4 lines

Therefore, would an alternative scheme work where the experimental tag is set to empty if the ALLOW_EXPERIMENTAL_FUNCTIONS define is set when compiling?

Yes, I think that could work. Perhaps what we can do is modify ALLOW_EXPERIMENTAL_FUNCTIONS to set a CFLAGS like:
-DSUPPRESS_EXPERIMENTAL

Quoted 9 lines
Quoted 3 lines

And use that to toggle the definition on rte_compat.h between something that deprecates the API call and an empty definition

Yes, exactly what I was thinking, but failed to express so clearly.

Also, would the flag be best set globally when building DPDK itself, rather than changing individual makefiles per library?

My personal opinion would be that the ability to set allowances on a fine grained scale would be preferable to a global exception. I say that because I could envision a new library getting written in which the author would not want to use experimental APIS and would like the option to catch that during development. I would like to think that adding -DALLOW_EXPERIMENTAL_APIS to any new makefile in the DPDK build would be both little enough trouble to do without irritation, and significant enough of a bump during development as to force the developer to make a conscious choice about enabling experimental APIS. The idea here is not to prevent developers from using experimental APIS (especially not in the core dpdk library, as I noted previously), but to make them consciously choose to use them, rather than just do so out of hand.

That said, I could be swayed if there was a sufficiently motivating reason to grant a global exception.

Neil

#13 lore raw

PATCH v2 4/4 dpdk: add __experimental tag to appropriate api calls

In reply to Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
 14 files changed, 139 insertions(+), 116 deletions(-)
lib/librte_eal/common/eal_common_dev.c +4 -2
index dda8f5835..ee866ddd2 100644
@@ -37,6 +37,7 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
@@ -133,7 +134,7 @@ full_dev_name(const char *bus, const char *dev, const char *args)
 	return name;
 }
 
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs)
 {
 	struct rte_bus *bus;
@@ -203,7 +204,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
 	return ret;
 }
 
-int rte_eal_hotplug_remove(const char *busname, const char *devname)
+int __experimental
+rte_eal_hotplug_remove(const char *busname, const char *devname)
 {
 	struct rte_bus *bus;
 	struct rte_device *dev;
lib/librte_eal/common/eal_common_devargs.c +4 -3
index 6ac88d6ab..8e46d54bd 100644
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
@@ -85,7 +86,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name)
 	return strncmp(bus->name, name, strlen(bus->name));
 }
 
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 {
 	struct rte_bus *bus = NULL;
@@ -139,7 +140,7 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 	return 0;
 }
 
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da)
 {
 	int ret;
@@ -188,7 +189,7 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
 	return -1;
 }
 
-int
+int __experimental
 rte_eal_devargs_remove(const char *busname, const char *devname)
 {
 	struct rte_devargs *d;
lib/librte_eal/common/include/rte_dev.h +4 -2
index 9342e0cbd..ddb0a09a7 100644
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -209,7 +210,7 @@ int rte_eal_dev_detach(struct rte_device *dev);
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs);
 
 /**
@@ -225,7 +226,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_remove(const char *busname, const char *devname);
+int __experimental rte_eal_hotplug_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Device comparison function.
lib/librte_eal/common/include/rte_devargs.h +5 -3
index 58d585df6..e4c10b6c5 100644
@@ -50,6 +50,7 @@ extern "C" {
 
 #include <stdio.h>
 #include <sys/queue.h>
+#include <rte_compat.h>
 #include <rte_bus.h>
 
 /**
@@ -136,7 +137,7 @@ int rte_eal_parse_devargs_str(const char *devargs_str,
  *   - 0 on success.
  *   - Negative errno on error.
  */
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev,
 		      struct rte_devargs *da);
 
@@ -150,7 +151,7 @@ rte_eal_devargs_parse(const char *dev,
  *   - 0 on success
  *   - Negative on error.
  */
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da);
 
 /**
@@ -193,7 +194,8 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
  *   <0 on error.
  *   >0 if the devargs was not within the user device list.
  */
-int rte_eal_devargs_remove(const char *busname, const char *devname);
+int __experimental rte_eal_devargs_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Count the number of user devices of a specified type
lib/librte_eal/common/include/rte_service.h +26 -21

167 lines not on this page · raw message

lib/librte_eal/common/include/rte_service_component.h +8 -6
index ac965cb48..a129258eb 100644
@@ -37,7 +37,7 @@
  * Include this file if you are writing a component that requires CPU cycles to
  * operate, and you wish to run the component using service cores
  */
-
+#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
@@ -101,8 +101,9 @@ struct rte_service_spec {
  *         -EINVAL Attempted to register an invalid service (eg, no callback
  *         set)
  */
-int32_t rte_service_component_register(const struct rte_service_spec *spec,
-				       uint32_t *service_id);
+int32_t __experimental
+rte_service_component_register(const struct rte_service_spec *spec,
+			       uint32_t *service_id);
 
 /**
  * @warning
@@ -116,7 +117,7 @@ int32_t rte_service_component_register(const struct rte_service_spec *spec,
  * @retval -EBUSY The service is currently running, stop the service before
  *          calling unregister. No action has been taken.
  */
-int32_t rte_service_component_unregister(uint32_t id);
+int32_t __experimental rte_service_component_unregister(uint32_t id);
 
 /**
  * @warning
@@ -134,7 +135,7 @@ int32_t rte_service_component_unregister(uint32_t id);
  * @retval -ENODEV Error in enabling service lcore on a service
  * @retval -ENOEXEC Error when starting services
  */
-int32_t rte_service_start_with_defaults(void);
+int32_t __experimental rte_service_start_with_defaults(void);
 
 /**
  * @warning
@@ -151,7 +152,8 @@ int32_t rte_service_start_with_defaults(void);
  *
  * @retval 0 Success
  */
-int32_t rte_service_component_runstate_set(uint32_t id, uint32_t runstate);
+int32_t __experimental rte_service_component_runstate_set(uint32_t id,
+							  uint32_t runstate);
 
 /**
  * @warning
lib/librte_eal/common/rte_service.c +28 -24

201 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal.c +1 -0
index 229eec9f1..73a0da22c 100644
@@ -53,6 +53,7 @@
 #include <sys/io.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
lib/librte_ether/rte_mtr.c +13 -12
index 4f56f8714..2cbe0bb5a 100644
@@ -34,6 +34,7 @@
 #include <stdint.h>
 
 #include <rte_errno.h>
+#include "rte_compat.h"
 #include "rte_ethdev.h"
 #include "rte_mtr_driver.h"
 #include "rte_mtr.h"
@@ -86,7 +87,7 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error)
 })
 
 /* MTR capabilities get */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error)
@@ -97,7 +98,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
 }
 
 /* MTR meter profile add */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -109,7 +110,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
 }
 
 /** MTR meter profile delete */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error)
@@ -120,7 +121,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
 }
 
 /** MTR object create */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -133,7 +134,7 @@ rte_mtr_create(uint16_t port_id,
 }
 
 /** MTR object destroy */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -144,7 +145,7 @@ rte_mtr_destroy(uint16_t port_id,
 }
 
 /** MTR object meter enable */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -155,7 +156,7 @@ rte_mtr_meter_enable(uint16_t port_id,
 }
 
 /** MTR object meter disable */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -166,7 +167,7 @@ rte_mtr_meter_disable(uint16_t port_id,
 }
 
 /** MTR object meter profile update */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -178,7 +179,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
 }
 
 /** MTR object meter DSCP table update */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -190,7 +191,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
 }
 
 /** MTR object policer action update */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -203,7 +204,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
 }
 
 /** MTR object enabled stats update */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -215,7 +216,7 @@ rte_mtr_stats_update(uint16_t port_id,
 }
 
 /** MTR object stats read */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_ether/rte_mtr.h +13 -13
index f6b6ef3b6..fd8361998 100644
@@ -74,7 +74,7 @@
  * @b EXPERIMENTAL: this API may change without prior notice
  */
 #include <stdint.h>
-
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
@@ -447,7 +447,7 @@ struct rte_mtr_error {
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error);
@@ -470,7 +470,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -491,7 +491,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error);
@@ -519,7 +519,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
  *
  * @see enum rte_flow_action_type::RTE_FLOW_ACTION_TYPE_METER
  */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -542,7 +542,7 @@ rte_mtr_create(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -569,7 +569,7 @@ rte_mtr_destroy(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -590,7 +590,7 @@ rte_mtr_meter_disable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -609,7 +609,7 @@ rte_mtr_meter_enable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -633,7 +633,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -659,7 +659,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -684,7 +684,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -715,7 +715,7 @@ rte_mtr_stats_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_flow_classify/rte_flow_classify.c +7 -6
index e6f448643..6716672fc 100644
@@ -31,6 +31,7 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
 #include <rte_flow_driver.h>
@@ -245,7 +246,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params)
 	return 0;
 }
 
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params)
 {
 	struct rte_flow_classifier *cls;
@@ -291,7 +292,7 @@ rte_flow_classify_table_free(struct rte_table *table)
 		table->ops.f_free(table->h_table);
 }
 
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls)
 {
 	uint32_t i;
@@ -369,7 +370,7 @@ rte_table_check_params(struct rte_flow_classifier *cls,
 	return 0;
 }
 
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 	struct rte_flow_classify_table_params *params,
 	uint32_t *table_id)
@@ -483,7 +484,7 @@ allocate_acl_ipv4_5tuple_rule(void)
 	return rule;
 }
 
-struct rte_flow_classify_rule *
+struct rte_flow_classify_rule * __experimental
 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		int *key_found,
@@ -582,7 +583,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 	return rule;
 }
 
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule)
@@ -659,7 +660,7 @@ action_apply(struct rte_flow_classifier *cls,
 	return ret;
 }
 
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_flow_classify/rte_flow_classify.h +6 -5
index 1211873a1..cd9516f9e 100644
@@ -70,6 +70,7 @@
  *    with rte_flow_classifier_free()
  */
 
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
@@ -176,7 +177,7 @@ struct rte_flow_classify_ipv4_5tuple_stats {
  * @return
  *   Handle to flow classifier instance on success or NULL otherwise
  */
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params);
 
 /**
@@ -187,7 +188,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls);
 
 /**
@@ -203,7 +204,7 @@ rte_flow_classifier_free(struct rte_flow_classifier *cls);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 		struct rte_flow_classify_table_params *params,
 		uint32_t *table_id);
@@ -250,7 +251,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule);
@@ -274,7 +275,7 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_security/rte_security.c +8 -8
index 1227fca8a..958b7273e 100644
@@ -33,12 +33,12 @@
 
 #include <rte_malloc.h>
 #include <rte_dev.h>
-
+#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
 struct rte_security_session *
-rte_security_session_create(struct rte_security_ctx *instance,
+__experimental rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
@@ -61,7 +61,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
 	return sess;
 }
 
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf)
@@ -70,7 +70,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
 	return instance->ops->session_update(instance->device, sess, conf);
 }
 
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats)
@@ -79,7 +79,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 	return instance->ops->session_stats_get(instance->device, sess, stats);
 }
 
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess)
 {
@@ -98,7 +98,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 	return ret;
 }
 
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *m, void *params)
@@ -108,14 +108,14 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 					       sess, m, params);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance)
 {
 	RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->capabilities_get, NULL);
 	return instance->ops->capabilities_get(instance->device);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx)
 {
lib/librte_security/rte_security.h +12 -11
index 653929b99..176378e78 100644
@@ -52,6 +52,7 @@ extern "C" {
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_mbuf.h>
@@ -291,7 +292,7 @@ struct rte_security_session {
  *  - On success, pointer to session
  *  - On failure, NULL
  */
-struct rte_security_session *
+struct rte_security_session * __experimental
 rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
@@ -306,7 +307,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  *  - On success returns 0
  *  - On failure return errno
  */
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf);
@@ -323,7 +324,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *  - -EINVAL if session is NULL.
  *  - -EBUSY if not all device private data has been freed.
  */
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess);
 
@@ -340,7 +341,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *mb, void *params);
@@ -351,7 +352,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  * @param	sym_op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 			      struct rte_security_session *sess)
 {
@@ -360,13 +361,13 @@ __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 	return 0;
 }
 
-static inline void *
+static inline void * __experimental
 get_sec_session_private_data(const struct rte_security_session *sess)
 {
 	return sess->sess_private_data;
 }
 
-static inline void
+static inline void __experimental
 set_sec_session_private_data(struct rte_security_session *sess,
 			     void *private_data)
 {
@@ -382,7 +383,7 @@ set_sec_session_private_data(struct rte_security_session *sess,
  * @param	op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 rte_security_attach_session(struct rte_crypto_op *op,
 			    struct rte_security_session *sess)
 {
@@ -424,7 +425,7 @@ struct rte_security_stats {
  *  - On success return 0
  *  - On failure errno
  */
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats);
@@ -507,7 +508,7 @@ struct rte_security_capability_idx {
  *   - Returns array of security capabilities.
  *   - Return NULL if no capabilities available.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance);
 
 /**
@@ -521,7 +522,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *     index criteria.
  *   - Return NULL if the capability not matched on security instance.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx);
 
Signature · 1 line
2.14.3
#14 lore raw

v3 cover dpdk: enhance EXPERIMENTAL api tagging

In reply to Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

#15 lore raw

PATCH v3 1/4 buildtools: Add tool to check EXPERIMENTAL api exports

This tools reads the given version map for a directory, and checks to ensure that, for each symbol listed in the export list, the corresponding definition is tagged as __experimental, erroring out if its not. In this way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 buildtools/experimentalsyms.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 buildtools/experimentalsyms.sh
buildtools/experimentalsyms.sh new file +35 -0
new file mode 100755
index 000000000..7342ec9b3
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+MAPFILE=$1
+OBJFILE=$2
+
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
+if [ -d $OBJFILE ]
+then
+	exit 0
+fi
+
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental"
+		echo "but is listed in version map"
+		echo "Please add __experimental to the definition of $SYM"
+		exit 1
+	fi
+done
+exit 0
+
Signature · 1 line
2.14.3
#16 lore raw

PATCH v3 2/4 compat: Add __experimental macro

In reply to Neil Horman

The __experimental macro tags a given exported function as being part of the EXPERIMENTAL api. Use of this tag will cause any caller of the function (that isn't removed by dead code elimination) to emit a warning that the user is making use of an API whos stabilty isn't guaranteed. It also places the function in the .text.experimental section, which is used to validate the tag against the corresponding library version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 lib/librte_compat/rte_compat.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
lib/librte_compat/rte_compat.h +11 -0
index 41e8032ba..450dd542c 100644
@@ -101,5 +101,16 @@
  */
 #endif
 
+#ifndef ALLOW_EXPERIMENTAL_APIS
 
+#define __experimental \
+__attribute__((deprecated("Symbol is not yet part of stable abi"), \
+section(".text.experimental")))
+
+#else
+
+#define __experimental \
+__attribute__((section(".text.experimental")))
+
+#endif
 #endif /* _RTE_COMPAT_H_ */
Signature · 1 line
2.14.3
#17 lore raw

PATCH v3 3/4 Makefiles: Add experimental tag check and warnings to trigger on use

In reply to Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +1 -0
index dcb2ac476..78bae7633 100644
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
app/test-pmd/Makefile +1 -0
index d21308fcd..23f9ddb86 100644
@@ -38,6 +38,7 @@ ifeq ($(CONFIG_RTE_TEST_PMD),y)
 #
 APP = testpmd
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
drivers/event/sw/Makefile +1 -0
index 2f2b67bac..e54477ec5 100644
@@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_pmd_sw_event.a
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 # for older GCC versions, allow us to initialize an event using
drivers/net/failsafe/Makefile +1 -0
index ea2a8fe46..29f1f0ff2 100644
@@ -50,6 +50,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_flow.c
 # No exported include files
 
 # Basic CFLAGS:
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -std=gnu99 -Wextra
 CFLAGS += -O3
 CFLAGS += -I.
drivers/net/ixgbe/Makefile +1 -0
index 511a64eb0..c1cf226f1 100644
@@ -36,6 +36,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_ixgbe.a
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/eventdev_pipeline_sw_pmd/Makefile +1 -0
index de4e22c88..dc54b0df2 100644
@@ -43,6 +43,7 @@ APP = eventdev_pipeline_sw_pmd
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/flow_classify/Makefile +1 -0
index eecdde14c..905a11cef 100644
@@ -45,6 +45,7 @@ APP = flow_classify
 # all source are stored in SRCS-y
 SRCS-y := flow_classify.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/ipsec-secgw/Makefile +1 -0
index 9fd33cb7f..84ba9fd29 100644
@@ -46,6 +46,7 @@ endif
 
 APP = ipsec-secgw
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3 -gdwarf-2
 CFLAGS += $(WERROR_FLAGS)
 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
examples/service_cores/Makefile +1 -0
index bd4a345dc..1f0448e27 100644
@@ -43,6 +43,7 @@ APP = service_cores
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
lib/librte_eal/bsdapp/eal/Makefile +1 -0
index afa117de4..ed595f104 100644
@@ -37,6 +37,7 @@ ARCH_DIR ?= $(RTE_ARCH)
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -I$(SRCDIR)/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
lib/librte_eal/linuxapp/Makefile +2 -0
index 2ebdf3139..37367fc88 100644
@@ -36,4 +36,6 @@ DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio
 DIRS-$(CONFIG_RTE_KNI_KMOD) += kni
 DEPDIRS-kni := eal
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
+
 include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 5a7b8b2ac..ec810d92b 100644
@@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_eal.a
 
 ARCH_DIR ?= $(RTE_ARCH)
+
 EXPORT_MAP := ../../rte_eal_version.map
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
@@ -41,6 +42,7 @@ LIBABIVER := 6
 
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -I$(SRCDIR)/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
lib/librte_eventdev/Makefile +1 -0
index 5ac22cde7..96afc3be8 100644
@@ -37,6 +37,7 @@ LIB = librte_eventdev.a
 LIBABIVER := 3
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_ring -lrte_ethdev -lrte_hash
lib/librte_security/Makefile +1 -0
index bb93ec33d..d433937a5 100644
@@ -37,6 +37,7 @@ LIB = librte_security.a
 LIBABIVER := 1
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mempool
mk/internal/rte.compile-pre.mk +4 -0
index da8dda498..83a53c202 100644
@@ -84,6 +84,9 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
 endif
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
+
 PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ [email protected]
 PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o [email protected] [email protected]
 PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o [email protected] [email protected] $@
@@ -100,6 +103,7 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
mk/toolchain/clang/rte.vars.mk +1 -1
index dde922d22..3cfe92545 100644
@@ -67,7 +67,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/gcc/rte.vars.mk +1 -1
index 3b907e201..3356a37c8 100644
@@ -75,7 +75,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/icc/rte.vars.mk +1 -1
index 33a8ba79e..58940602e 100644
@@ -73,7 +73,7 @@ TOOLCHAIN_ASFLAGS =
 WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478
 WERROR_FLAGS += -diag-disable 13368 -diag-disable 15527
 WERROR_FLAGS += -diag-disable 188
-WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076
+WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror-all
Signature · 1 line
2.14.3
#18 lore raw

PATCH v3 4/4 dpdk: add __experimental tag to appropriate api calls

In reply to Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
 14 files changed, 139 insertions(+), 116 deletions(-)
lib/librte_eal/common/eal_common_dev.c +4 -2
index dda8f5835..ee866ddd2 100644
@@ -37,6 +37,7 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
@@ -133,7 +134,7 @@ full_dev_name(const char *bus, const char *dev, const char *args)
 	return name;
 }
 
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs)
 {
 	struct rte_bus *bus;
@@ -203,7 +204,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
 	return ret;
 }
 
-int rte_eal_hotplug_remove(const char *busname, const char *devname)
+int __experimental
+rte_eal_hotplug_remove(const char *busname, const char *devname)
 {
 	struct rte_bus *bus;
 	struct rte_device *dev;
lib/librte_eal/common/eal_common_devargs.c +4 -3
index 6ac88d6ab..8e46d54bd 100644
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
@@ -85,7 +86,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name)
 	return strncmp(bus->name, name, strlen(bus->name));
 }
 
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 {
 	struct rte_bus *bus = NULL;
@@ -139,7 +140,7 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 	return 0;
 }
 
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da)
 {
 	int ret;
@@ -188,7 +189,7 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
 	return -1;
 }
 
-int
+int __experimental
 rte_eal_devargs_remove(const char *busname, const char *devname)
 {
 	struct rte_devargs *d;
lib/librte_eal/common/include/rte_dev.h +4 -2
index 9342e0cbd..ddb0a09a7 100644
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -209,7 +210,7 @@ int rte_eal_dev_detach(struct rte_device *dev);
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs);
 
 /**
@@ -225,7 +226,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_remove(const char *busname, const char *devname);
+int __experimental rte_eal_hotplug_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Device comparison function.
lib/librte_eal/common/include/rte_devargs.h +5 -3
index 58d585df6..e4c10b6c5 100644
@@ -50,6 +50,7 @@ extern "C" {
 
 #include <stdio.h>
 #include <sys/queue.h>
+#include <rte_compat.h>
 #include <rte_bus.h>
 
 /**
@@ -136,7 +137,7 @@ int rte_eal_parse_devargs_str(const char *devargs_str,
  *   - 0 on success.
  *   - Negative errno on error.
  */
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev,
 		      struct rte_devargs *da);
 
@@ -150,7 +151,7 @@ rte_eal_devargs_parse(const char *dev,
  *   - 0 on success
  *   - Negative on error.
  */
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da);
 
 /**
@@ -193,7 +194,8 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
  *   <0 on error.
  *   >0 if the devargs was not within the user device list.
  */
-int rte_eal_devargs_remove(const char *busname, const char *devname);
+int __experimental rte_eal_devargs_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Count the number of user devices of a specified type
lib/librte_eal/common/include/rte_service.h +26 -21

167 lines not on this page · raw message

lib/librte_eal/common/include/rte_service_component.h +8 -6
index ac965cb48..a129258eb 100644
@@ -37,7 +37,7 @@
  * Include this file if you are writing a component that requires CPU cycles to
  * operate, and you wish to run the component using service cores
  */
-
+#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
@@ -101,8 +101,9 @@ struct rte_service_spec {
  *         -EINVAL Attempted to register an invalid service (eg, no callback
  *         set)
  */
-int32_t rte_service_component_register(const struct rte_service_spec *spec,
-				       uint32_t *service_id);
+int32_t __experimental
+rte_service_component_register(const struct rte_service_spec *spec,
+			       uint32_t *service_id);
 
 /**
  * @warning
@@ -116,7 +117,7 @@ int32_t rte_service_component_register(const struct rte_service_spec *spec,
  * @retval -EBUSY The service is currently running, stop the service before
  *          calling unregister. No action has been taken.
  */
-int32_t rte_service_component_unregister(uint32_t id);
+int32_t __experimental rte_service_component_unregister(uint32_t id);
 
 /**
  * @warning
@@ -134,7 +135,7 @@ int32_t rte_service_component_unregister(uint32_t id);
  * @retval -ENODEV Error in enabling service lcore on a service
  * @retval -ENOEXEC Error when starting services
  */
-int32_t rte_service_start_with_defaults(void);
+int32_t __experimental rte_service_start_with_defaults(void);
 
 /**
  * @warning
@@ -151,7 +152,8 @@ int32_t rte_service_start_with_defaults(void);
  *
  * @retval 0 Success
  */
-int32_t rte_service_component_runstate_set(uint32_t id, uint32_t runstate);
+int32_t __experimental rte_service_component_runstate_set(uint32_t id,
+							  uint32_t runstate);
 
 /**
  * @warning
lib/librte_eal/common/rte_service.c +28 -24

201 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal.c +1 -0
index 229eec9f1..73a0da22c 100644
@@ -53,6 +53,7 @@
 #include <sys/io.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
lib/librte_ether/rte_mtr.c +13 -12
index 4f56f8714..2cbe0bb5a 100644
@@ -34,6 +34,7 @@
 #include <stdint.h>
 
 #include <rte_errno.h>
+#include "rte_compat.h"
 #include "rte_ethdev.h"
 #include "rte_mtr_driver.h"
 #include "rte_mtr.h"
@@ -86,7 +87,7 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error)
 })
 
 /* MTR capabilities get */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error)
@@ -97,7 +98,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
 }
 
 /* MTR meter profile add */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -109,7 +110,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
 }
 
 /** MTR meter profile delete */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error)
@@ -120,7 +121,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
 }
 
 /** MTR object create */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -133,7 +134,7 @@ rte_mtr_create(uint16_t port_id,
 }
 
 /** MTR object destroy */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -144,7 +145,7 @@ rte_mtr_destroy(uint16_t port_id,
 }
 
 /** MTR object meter enable */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -155,7 +156,7 @@ rte_mtr_meter_enable(uint16_t port_id,
 }
 
 /** MTR object meter disable */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -166,7 +167,7 @@ rte_mtr_meter_disable(uint16_t port_id,
 }
 
 /** MTR object meter profile update */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -178,7 +179,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
 }
 
 /** MTR object meter DSCP table update */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -190,7 +191,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
 }
 
 /** MTR object policer action update */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -203,7 +204,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
 }
 
 /** MTR object enabled stats update */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -215,7 +216,7 @@ rte_mtr_stats_update(uint16_t port_id,
 }
 
 /** MTR object stats read */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_ether/rte_mtr.h +13 -13
index f6b6ef3b6..fd8361998 100644
@@ -74,7 +74,7 @@
  * @b EXPERIMENTAL: this API may change without prior notice
  */
 #include <stdint.h>
-
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
@@ -447,7 +447,7 @@ struct rte_mtr_error {
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error);
@@ -470,7 +470,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -491,7 +491,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error);
@@ -519,7 +519,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
  *
  * @see enum rte_flow_action_type::RTE_FLOW_ACTION_TYPE_METER
  */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -542,7 +542,7 @@ rte_mtr_create(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -569,7 +569,7 @@ rte_mtr_destroy(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -590,7 +590,7 @@ rte_mtr_meter_disable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -609,7 +609,7 @@ rte_mtr_meter_enable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -633,7 +633,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -659,7 +659,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -684,7 +684,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -715,7 +715,7 @@ rte_mtr_stats_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_flow_classify/rte_flow_classify.c +7 -6
index e6f448643..6716672fc 100644
@@ -31,6 +31,7 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
 #include <rte_flow_driver.h>
@@ -245,7 +246,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params)
 	return 0;
 }
 
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params)
 {
 	struct rte_flow_classifier *cls;
@@ -291,7 +292,7 @@ rte_flow_classify_table_free(struct rte_table *table)
 		table->ops.f_free(table->h_table);
 }
 
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls)
 {
 	uint32_t i;
@@ -369,7 +370,7 @@ rte_table_check_params(struct rte_flow_classifier *cls,
 	return 0;
 }
 
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 	struct rte_flow_classify_table_params *params,
 	uint32_t *table_id)
@@ -483,7 +484,7 @@ allocate_acl_ipv4_5tuple_rule(void)
 	return rule;
 }
 
-struct rte_flow_classify_rule *
+struct rte_flow_classify_rule * __experimental
 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		int *key_found,
@@ -582,7 +583,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 	return rule;
 }
 
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule)
@@ -659,7 +660,7 @@ action_apply(struct rte_flow_classifier *cls,
 	return ret;
 }
 
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_flow_classify/rte_flow_classify.h +6 -5
index 1211873a1..cd9516f9e 100644
@@ -70,6 +70,7 @@
  *    with rte_flow_classifier_free()
  */
 
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
@@ -176,7 +177,7 @@ struct rte_flow_classify_ipv4_5tuple_stats {
  * @return
  *   Handle to flow classifier instance on success or NULL otherwise
  */
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params);
 
 /**
@@ -187,7 +188,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls);
 
 /**
@@ -203,7 +204,7 @@ rte_flow_classifier_free(struct rte_flow_classifier *cls);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 		struct rte_flow_classify_table_params *params,
 		uint32_t *table_id);
@@ -250,7 +251,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule);
@@ -274,7 +275,7 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_security/rte_security.c +8 -8
index 1227fca8a..958b7273e 100644
@@ -33,12 +33,12 @@
 
 #include <rte_malloc.h>
 #include <rte_dev.h>
-
+#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
 struct rte_security_session *
-rte_security_session_create(struct rte_security_ctx *instance,
+__experimental rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
@@ -61,7 +61,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
 	return sess;
 }
 
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf)
@@ -70,7 +70,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
 	return instance->ops->session_update(instance->device, sess, conf);
 }
 
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats)
@@ -79,7 +79,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 	return instance->ops->session_stats_get(instance->device, sess, stats);
 }
 
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess)
 {
@@ -98,7 +98,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 	return ret;
 }
 
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *m, void *params)
@@ -108,14 +108,14 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 					       sess, m, params);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance)
 {
 	RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->capabilities_get, NULL);
 	return instance->ops->capabilities_get(instance->device);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx)
 {
lib/librte_security/rte_security.h +12 -11
index 653929b99..176378e78 100644
@@ -52,6 +52,7 @@ extern "C" {
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_mbuf.h>
@@ -291,7 +292,7 @@ struct rte_security_session {
  *  - On success, pointer to session
  *  - On failure, NULL
  */
-struct rte_security_session *
+struct rte_security_session * __experimental
 rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
@@ -306,7 +307,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  *  - On success returns 0
  *  - On failure return errno
  */
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf);
@@ -323,7 +324,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *  - -EINVAL if session is NULL.
  *  - -EBUSY if not all device private data has been freed.
  */
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess);
 
@@ -340,7 +341,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *mb, void *params);
@@ -351,7 +352,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  * @param	sym_op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 			      struct rte_security_session *sess)
 {
@@ -360,13 +361,13 @@ __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 	return 0;
 }
 
-static inline void *
+static inline void * __experimental
 get_sec_session_private_data(const struct rte_security_session *sess)
 {
 	return sess->sess_private_data;
 }
 
-static inline void
+static inline void __experimental
 set_sec_session_private_data(struct rte_security_session *sess,
 			     void *private_data)
 {
@@ -382,7 +383,7 @@ set_sec_session_private_data(struct rte_security_session *sess,
  * @param	op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 rte_security_attach_session(struct rte_crypto_op *op,
 			    struct rte_security_session *sess)
 {
@@ -424,7 +425,7 @@ struct rte_security_stats {
  *  - On success return 0
  *  - On failure errno
  */
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats);
@@ -507,7 +508,7 @@ struct rte_security_capability_idx {
  *   - Returns array of security capabilities.
  *   - Return NULL if no capabilities available.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance);
 
 /**
@@ -521,7 +522,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *     index criteria.
  *   - Return NULL if the capability not matched on security instance.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx);
 
Signature · 1 line
2.14.3
Acked-by on the v3 series
#19 lore raw
In reply to Neil Horman
Quoted 54 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

Quoted 6 lines

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

Despite the fact that this is making yet more work for porting to a new build system, I think this is a good idea to have. As such,

#20 lore raw
Quoted 62 lines · Bruce Richardson
Quoted 54 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

Quoted 6 lines

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

Quoted 6 lines

Despite the fact that this is making yet more work for porting to a new build system, I think this is a good idea to have. As such,

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

thanks
Neil

#21 lore raw
Quoted 70 lines · Neil Horman
Quoted 62 lines · Bruce Richardson
Quoted 54 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

Quoted 6 lines

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

Quoted 6 lines

Despite the fact that this is making yet more work for porting to a new build system, I think this is a good idea to have. As such,

Quoted 9 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Neil

#22 lore raw

04/01/2018 13:56, Neil Horman:

Quoted 7 lines · Neil Horman
Quoted 6 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

Quoted 8 lines
Quoted 3 lines

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Unfortunately, I have no clues about this setup.
The report is sent by [email protected].
Adding Qian as Cc.

The error is "buildtools/experimentalsyms.sh: Permission denied" And the file mode is 100755.

Anyone from Intel to check what happens please?

#23 lore raw
Quoted 17 lines · Thomas Monjalon

04/01/2018 13:56, Neil Horman:

Quoted 7 lines · Neil Horman
Quoted 6 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

Quoted 8 lines
Quoted 3 lines

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Quoted 9 lines

Unfortunately, I have no clues about this setup.
The report is sent by [email protected].
Adding Qian as Cc.

The error is "buildtools/experimentalsyms.sh: Permission denied" And the file mode is 100755.

Anyone from Intel to check what happens please?

Thank you Thomas. I would really like to get this pushed in, as others have acked it, but the lack of visibility into the CI errors is quite frustrating Neil

#24 lore raw
Quoted 22 lines · Neil Horman
Quoted 21 lines · Thomas Monjalon

04/01/2018 13:56, Neil Horman:

Quoted 7 lines · Neil Horman
Quoted 6 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

Quoted 8 lines
Quoted 3 lines

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Unfortunately, I have no clues about this setup.
The report is sent by [email protected].
Adding Qian as Cc.

Quoted 10 lines
Quoted 5 lines

The error is "buildtools/experimentalsyms.sh: Permission denied" And the file mode is 100755.

Anyone from Intel to check what happens please?

Thank you Thomas. I would really like to get this pushed in, as others have acked it, but the lack of visibility into the CI errors is quite frustrating Neil

So I'm not sure where to go with this. I've emailed the ci group on their list, I've asked them directly on this list, and asked you, Thomas for assistance in getting hold of the ci maintainers, and there has been no response in over a week now. This patch has been acked by a few people, and the builds work on clang and gcc locally just fine. I'm inclined to ask you to take these patches despite the ci errors. If the CI maintainers can't respond to needs for visibility into the system, I don't think its reasonable to block patches based on CI results.

Thoughts?
Neil

#25 lore raw

09/01/2018 02:32, Neil Horman:

Quoted 42 lines · Neil Horman
Quoted 22 lines · Thomas Monjalon
Quoted 21 lines

04/01/2018 13:56, Neil Horman:

Quoted 7 lines · Neil Horman
Quoted 6 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

Quoted 8 lines
Quoted 3 lines

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Unfortunately, I have no clues about this setup.
The report is sent by [email protected].
Adding Qian as Cc.

Quoted 10 lines
Quoted 5 lines

The error is "buildtools/experimentalsyms.sh: Permission denied" And the file mode is 100755.

Anyone from Intel to check what happens please?

Thank you Thomas. I would really like to get this pushed in, as others have acked it, but the lack of visibility into the CI errors is quite frustrating Neil

So I'm not sure where to go with this. I've emailed the ci group on their list, I've asked them directly on this list, and asked you, Thomas for assistance in getting hold of the ci maintainers, and there has been no response in over a week now. This patch has been acked by a few people, and the builds work on clang and gcc locally just fine. I'm inclined to ask you to take these patches despite the ci errors. If the CI maintainers can't respond to needs for visibility into the system, I don't think its reasonable to block patches based on CI results.

Quoted 2 lines

Thoughts?
Neil

Yes, you're right, we can bypass this CI test.

#26 lore raw
Quoted 43 lines · Thomas Monjalon

09/01/2018 02:32, Neil Horman:

Quoted 42 lines · Neil Horman
Quoted 22 lines · Thomas Monjalon
Quoted 21 lines

04/01/2018 13:56, Neil Horman:

Quoted 7 lines · Neil Horman
Quoted 6 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

Quoted 8 lines
Quoted 3 lines

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Unfortunately, I have no clues about this setup.
The report is sent by [email protected].
Adding Qian as Cc.

Quoted 10 lines
Quoted 5 lines

The error is "buildtools/experimentalsyms.sh: Permission denied" And the file mode is 100755.

Anyone from Intel to check what happens please?

Thank you Thomas. I would really like to get this pushed in, as others have acked it, but the lack of visibility into the CI errors is quite frustrating Neil

So I'm not sure where to go with this. I've emailed the ci group on their list, I've asked them directly on this list, and asked you, Thomas for assistance in getting hold of the ci maintainers, and there has been no response in over a week now. This patch has been acked by a few people, and the builds work on clang and gcc locally just fine. I'm inclined to ask you to take these patches despite the ci errors. If the CI maintainers can't respond to needs for visibility into the system, I don't think its reasonable to block patches based on CI results.

Quoted 5 lines
Quoted 2 lines

Thoughts?
Neil

Yes, you're right, we can bypass this CI test.

Thank you, much appreciated.
Neil

#27 lore raw
In reply to Thomas Monjalon
Quoted 43 lines · Thomas Monjalon

09/01/2018 02:32, Neil Horman:

Quoted 42 lines · Neil Horman
Quoted 22 lines · Thomas Monjalon
Quoted 21 lines

04/01/2018 13:56, Neil Horman:

Quoted 7 lines · Neil Horman
Quoted 6 lines

Thomas-
I just noticed that the ci tests are failing on the intel compiler, which
makes very little sense to me, as the error is a permission error on a bash script that added in this series, which works during the gcc compilation. Can you take a look at that please?

Quoted 8 lines
Quoted 3 lines

thanks
Neil

Ping again Thomas, I've still heard nothing from you or the CI group about getting more visibility into the odd permission problem in the CI runs this seems to be encountering. I'd love to fix it, but the information in the report is insufficient to have any idea whats going on and the problem does not occur on local builds. Please advise.

Unfortunately, I have no clues about this setup.
The report is sent by [email protected].
Adding Qian as Cc.

Quoted 10 lines
Quoted 5 lines

The error is "buildtools/experimentalsyms.sh: Permission denied" And the file mode is 100755.

Anyone from Intel to check what happens please?

Thank you Thomas. I would really like to get this pushed in, as others have acked it, but the lack of visibility into the CI errors is quite frustrating Neil

So I'm not sure where to go with this. I've emailed the ci group on their list, I've asked them directly on this list, and asked you, Thomas for assistance in getting hold of the ci maintainers, and there has been no response in over a week now. This patch has been acked by a few people, and the builds work on clang and gcc locally just fine. I'm inclined to ask you to take these patches despite the ci errors. If the CI maintainers can't respond to needs for visibility into the system, I don't think its reasonable to block patches based on CI results.

Quoted 5 lines
Quoted 2 lines

Thoughts?
Neil

Yes, you're right, we can bypass this CI test.

Ping, I thought you were going to integrate this? Its been sitting here for over a month now.
Neil

#28 lore raw
In reply to Neil Horman
Quoted 10 lines

-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Monday, December 11, 2017 7:36 PM
To: [email protected]
Cc: [email protected]; Mcnamara, John <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCHv3 0/4] dpdk: enhance EXPERIMENTAL api tagging

Quoted 6 lines

Hey all-
A few days ago, I was lamenting the fact that, when reviewing
patches I would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

Hi Neil,

Thanks for this and apologies in advance for making more work for you but it would be good to have a short section in the Contributors Guide on how to add/check experimental APIs. I think the information in this cover letter could be repurposed along with a few code and shell examples.

Probably as a new high level section in the Contributors Guides:

http://dpdk.org/doc/guides/contributing/index.html

Thanks,

John

#29 lore raw
Quoted 24 lines · John
Quoted 10 lines

-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Monday, December 11, 2017 7:36 PM
To: [email protected]
Cc: [email protected]; Mcnamara, John <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCHv3 0/4] dpdk: enhance EXPERIMENTAL api tagging

Quoted 6 lines

Hey all-
A few days ago, I was lamenting the fact that, when reviewing
patches I would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

Hi Neil,

Thanks for this and apologies in advance for making more work for you but it would be good to have a short section in the Contributors Guide on how to add/check experimental APIs. I think the information in this cover letter could be repurposed along with a few code and shell examples.

Quoted 8 lines

Probably as a new high level section in the Contributors Guides:

http://dpdk.org/doc/guides/contributing/index.html

Thanks,

John

Thats ok, I was actually trying to think of where to add documentation for this thing, but couldnt find a really appropriate place. I'll add that in and repost.

Neil

#30 lore raw
In reply to Neil Horman
Quoted 11 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

Quoted 2 lines

In thinking about the problem I identified two issues that I think we
can improve on in this area:

One question is how does this effect the ABI map files or does it? If an API is exposed in the map file does it need any type of special indicator on that API line? It may not make much difference, but I was thinking it could be an indicator the API is experimental and may not exist. If the new experimental API is included in the map file then it could become a problem for systems expecting all of the APIs in the map file to be solid.

Regards,
Keith

#31 lore raw
Quoted 11 lines · Keith
Quoted 11 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

Quoted 9 lines
Quoted 2 lines

In thinking about the problem I identified two issues that I think we
can improve on in this area:

One question is how does this effect the ABI map files or does it? If an API is exposed in the map file does it need any type of special indicator on that API line? It may not make much difference, but I was thinking it could be an indicator the API is experimental and may not exist. If the new experimental API is included in the map file then it could become a problem for systems expecting all of the APIs in the map file to be solid.

Regards,
Keith

So, thats a few questions that are all interconnected, I'll try to answer them as completely as I can:

1) Despite being experimental API's, they still need to be part of the version map files. This is an always condition, and there are no ecpetions to that. Failure to put an api call in the map file means it won't get exported when we build as a shared library and so is unusable. This has been the case since we introduced the map files. You'll note that each map file which exports experimental APIS has an EXPERIMENTAL clause in the map for expressly this purpose

2) One of the problems that I identified in my cover letter was that, when reviewing patches (and when using API's), there was no clear indicator that the patch we were reviewing was part of an experimental API (without simeoultaneously consulting the map file). That was part of what this patch set was meant to address (visual clues in the patch that told reviewers this was part of an experimental API).

3) The __experimental tag is expressly meant to go on function definitions and forward declarations to address the concern in (2) expressly

4) The __experimental tag is also meant to trigger a warning to users that build code using experimental apis. At compile time a warning is generated for any call made to said tagged api (unless -DALLOW_EXPERIMENTAL_APIS is set)

5) The one issue I had with this patch set was that there was a need to manually keep in sync items tagged with __experimental and the symbols listed in the EXPERIMENTAL section of a map file. The first patch in this series addresses that by adding a build check to make sure that symbols in the map file are tagged with __experimental in the source.

Hope that answers all your questions
Neil

#32 lore raw

v4 cover dpdk: enhance EXPERIMENTAL api tagging

In reply to Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

v4)
* Added documentation patch to contributors guide

#33 lore raw

PATCH v4 1/5 buildtools: Add tool to check EXPERIMENTAL api exports

This tools reads the given version map for a directory, and checks to ensure that, for each symbol listed in the export list, the corresponding definition is tagged as __experimental, erroring out if its not. In this way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 buildtools/experimentalsyms.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 buildtools/experimentalsyms.sh
buildtools/experimentalsyms.sh new file +35 -0
new file mode 100755
index 000000000..7342ec9b3
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+MAPFILE=$1
+OBJFILE=$2
+
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
+if [ -d $OBJFILE ]
+then
+	exit 0
+fi
+
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental"
+		echo "but is listed in version map"
+		echo "Please add __experimental to the definition of $SYM"
+		exit 1
+	fi
+done
+exit 0
+
Signature · 1 line
2.14.3
#34 lore raw

Re: [PATCHv4 1/5] buildtools: Add tool to check EXPERIMENTAL api exports

Hi Neil,

Sorry for the very late review.
I thought review had been done by others but it seems not. Please find my comments below.

13/12/2017 16:17, Neil Horman:

Quoted 1 line
 create mode 100755 buildtools/experimentalsyms.sh

When adding a new file, you must reference it in MAINTAINERS. Please add it in the section "ABI versioning".

buildtools/experimentalsyms.sh

Quoted 2 lines
buildtools/experimentalsyms.sh new file +0 -0

I think the file name should include the word "check". What about check-experimental-syms.sh ?

buildtools/experimentalsyms.sh line 1

Quoted 2 lines
buildtools/experimentalsyms.sh new file +1 -0
@@ -0,0 +1,35 @@
+#!/bin/sh

You must insert a SPDX license and copyright here.

buildtools/experimentalsyms.sh line 14

Quoted 9 lines
buildtools/experimentalsyms.sh new file +9 -0
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
+if [ -d $OBJFILE ]
+then
+	exit 0
+fi

Why checking for not being a directory?
I guess you could check being a readable file (-r)? Should it return an error?

Quoted 9 lines
buildtools/experimentalsyms.sh new file +9 -0
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"

buildtools/experimentalsyms.sh line 34

Quoted 10 lines
buildtools/experimentalsyms.sh new file +10 -0
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental"
+		echo "but is listed in version map"
+		echo "Please add __experimental to the definition of $SYM"
+		exit 1
+	fi
+done
+exit 0

exit 0 is useless at the end of a script.

#35 lore raw

Re: [PATCHv4 1/5] buildtools: Add tool to check EXPERIMENTAL api exports

Quoted 6 lines · Thomas Monjalon

Hi Neil,

Sorry for the very late review.
I thought review had been done by others but it seems not. Please find my comments below.

Quoted 6 lines

13/12/2017 16:17, Neil Horman:

Quoted 1 line
 create mode 100755 buildtools/experimentalsyms.sh

When adding a new file, you must reference it in MAINTAINERS. Please add it in the section "ABI versioning".

yup

Quoted 11 lines

buildtools/experimentalsyms.sh

Quoted 2 lines
buildtools/experimentalsyms.sh new file +0 -0

I think the file name should include the word "check". What about check-experimental-syms.sh ?

buildtools/experimentalsyms.sh line 1

Quoted 2 lines
buildtools/experimentalsyms.sh new file +1 -0
@@ -0,0 +1,35 @@
+#!/bin/sh

You must insert a SPDX license and copyright here.

Will do.

Quoted 5 lines
Quoted 5 lines
buildtools/experimentalsyms.sh new file +5 -0
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
Quoted 9 lines

buildtools/experimentalsyms.sh line 14

Quoted 4 lines
buildtools/experimentalsyms.sh new file +4 -0
+if [ -d $OBJFILE ]
+then
+	exit 0
+fi

Why checking for not being a directory?
I guess you could check being a readable file (-r)? Should it return an error?

The objfile check is out of date (had it in place initially, and is no longer needed). the mapfile check is there because dpdk apps use the same C_TO_O rule and have no mapfile variable set.

Quoted 13 lines
Quoted 13 lines
buildtools/experimentalsyms.sh new file +13 -0
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental"
Quoted 8 lines

buildtools/experimentalsyms.sh line 34

Quoted 6 lines
buildtools/experimentalsyms.sh new file +6 -0
+		echo "but is listed in version map"
+		echo "Please add __experimental to the definition of $SYM"
+		exit 1
+	fi
+done
+exit 0

exit 0 is useless at the end of a script.

Its there for clarity of exit value. I prefer to be expicit in that. Neil

#36 lore raw

PATCH v4 2/5 compat: Add __experimental macro

In reply to Neil Horman

The __experimental macro tags a given exported function as being part of the EXPERIMENTAL api. Use of this tag will cause any caller of the function (that isn't removed by dead code elimination) to emit a warning that the user is making use of an API whos stabilty isn't guaranteed. It also places the function in the .text.experimental section, which is used to validate the tag against the corresponding library version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 lib/librte_compat/rte_compat.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
lib/librte_compat/rte_compat.h +11 -0
index 41e8032ba..450dd542c 100644
@@ -101,5 +101,16 @@
  */
 #endif
 
+#ifndef ALLOW_EXPERIMENTAL_APIS
 
+#define __experimental \
+__attribute__((deprecated("Symbol is not yet part of stable abi"), \
+section(".text.experimental")))
+
+#else
+
+#define __experimental \
+__attribute__((section(".text.experimental")))
+
+#endif
 #endif /* _RTE_COMPAT_H_ */
Signature · 1 line
2.14.3
#37 lore raw

Re: [PATCHv4 2/5] compat: Add __experimental macro

Hi,

I know I should have spotted these comments earlier, I'm sorry to be late on this review.

13/12/2017 16:17, Neil Horman:

lib/librte_compat/rte_compat.h line 106

Quoted 3 lines
lib/librte_compat/rte_compat.h +2 -0
+#ifndef ALLOW_EXPERIMENTAL_APIS
 
+#define __experimental \

These macros should be in the DPDK namespace:
RTE_ALLOW_EXPERIMENTAL_API (no need of S)
__rte_experimental

Quoted 1 line

+__attribute__((deprecated("Symbol is not yet part of stable abi"), \

Nit: s/abi/ABI/

#38 lore raw

PATCH v4 3/5 Makefiles: Add experimental tag check and warnings to trigger on use

In reply to Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +1 -0
index dcb2ac476..78bae7633 100644
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
app/test-pmd/Makefile +1 -0
index d21308fcd..23f9ddb86 100644
@@ -38,6 +38,7 @@ ifeq ($(CONFIG_RTE_TEST_PMD),y)
 #
 APP = testpmd
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
drivers/event/sw/Makefile +1 -0
index 2f2b67bac..e54477ec5 100644
@@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_pmd_sw_event.a
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 # for older GCC versions, allow us to initialize an event using
drivers/net/failsafe/Makefile +1 -0
index ea2a8fe46..29f1f0ff2 100644
@@ -50,6 +50,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_flow.c
 # No exported include files
 
 # Basic CFLAGS:
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -std=gnu99 -Wextra
 CFLAGS += -O3
 CFLAGS += -I.
drivers/net/ixgbe/Makefile +1 -0
index 511a64eb0..c1cf226f1 100644
@@ -36,6 +36,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_ixgbe.a
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/eventdev_pipeline_sw_pmd/Makefile +1 -0
index de4e22c88..dc54b0df2 100644
@@ -43,6 +43,7 @@ APP = eventdev_pipeline_sw_pmd
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/flow_classify/Makefile +1 -0
index eecdde14c..905a11cef 100644
@@ -45,6 +45,7 @@ APP = flow_classify
 # all source are stored in SRCS-y
 SRCS-y := flow_classify.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/ipsec-secgw/Makefile +1 -0
index 9fd33cb7f..84ba9fd29 100644
@@ -46,6 +46,7 @@ endif
 
 APP = ipsec-secgw
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3 -gdwarf-2
 CFLAGS += $(WERROR_FLAGS)
 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
examples/service_cores/Makefile +1 -0
index bd4a345dc..1f0448e27 100644
@@ -43,6 +43,7 @@ APP = service_cores
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
lib/librte_eal/bsdapp/eal/Makefile +1 -0
index afa117de4..ed595f104 100644
@@ -37,6 +37,7 @@ ARCH_DIR ?= $(RTE_ARCH)
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -I$(SRCDIR)/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
lib/librte_eal/linuxapp/Makefile +2 -0
index 2ebdf3139..37367fc88 100644
@@ -36,4 +36,6 @@ DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio
 DIRS-$(CONFIG_RTE_KNI_KMOD) += kni
 DEPDIRS-kni := eal
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
+
 include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 5a7b8b2ac..ec810d92b 100644
@@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_eal.a
 
 ARCH_DIR ?= $(RTE_ARCH)
+
 EXPORT_MAP := ../../rte_eal_version.map
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
@@ -41,6 +42,7 @@ LIBABIVER := 6
 
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -I$(SRCDIR)/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
lib/librte_eventdev/Makefile +1 -0
index 5ac22cde7..96afc3be8 100644
@@ -37,6 +37,7 @@ LIB = librte_eventdev.a
 LIBABIVER := 3
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_ring -lrte_ethdev -lrte_hash
lib/librte_security/Makefile +1 -0
index bb93ec33d..d433937a5 100644
@@ -37,6 +37,7 @@ LIB = librte_security.a
 LIBABIVER := 1
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mempool
mk/internal/rte.compile-pre.mk +4 -0
index da8dda498..83a53c202 100644
@@ -84,6 +84,9 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
 endif
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
+
 PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ [email protected]
 PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o [email protected] [email protected]
 PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o [email protected] [email protected] $@
@@ -100,6 +103,7 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
mk/toolchain/clang/rte.vars.mk +1 -1
index dde922d22..3cfe92545 100644
@@ -67,7 +67,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/gcc/rte.vars.mk +1 -1
index 3b907e201..3356a37c8 100644
@@ -75,7 +75,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/icc/rte.vars.mk +1 -1
index 33a8ba79e..58940602e 100644
@@ -73,7 +73,7 @@ TOOLCHAIN_ASFLAGS =
 WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478
 WERROR_FLAGS += -diag-disable 13368 -diag-disable 15527
 WERROR_FLAGS += -diag-disable 188
-WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076
+WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror-all
Signature · 1 line
2.14.3
#39 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 36 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +0 -0
index dcb2ac476..78bae7633 100644

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 4 lines
app/test-eventdev/Makefile +1 -0
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

Quoted 3 lines
app/test-eventdev/Makefile +0 -0
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 

<...>

#40 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 38 lines · Ferruh Yigit
Quoted 37 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +0 -0
index dcb2ac476..78bae7633 100644
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
Quoted 7 lines

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 3 lines
app/test-eventdev/Makefile +1 -0
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

I'm not sure what you're asking here. As I mentioned in the initial post, I think we should give blanket permission to any in-tree dpdk library to allow the use of experimental API's, but that doesn't really imply that all developers would wan't it disabled all the time. That is to say, I could envision a library author who, early in development would want to get a warning issued if they used an unstable API, and, only once they were happy with their design and choice of API usage, turn the warning off.

Quoted 4 lines

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

For the reason I gave above. We certainly could enable this in a more top-level makefile so that for in-library systems it was opt-in rather than opt-out, but I chose a more granular approach because I could envision newer libraries wanting it on. I also felt, generally speaking, that where warning flags were concerned, it generally desireous to have them on by default, and make people explicitly choose to turn them off.

Regards
Neil

Quoted 7 lines
Quoted 3 lines
app/test-eventdev/Makefile +0 -0
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 

<...>

#41 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 46 lines · Neil Horman
Quoted 38 lines · Ferruh Yigit
Quoted 37 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +0 -0
index dcb2ac476..78bae7633 100644
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
Quoted 7 lines

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 3 lines
app/test-eventdev/Makefile +1 -0
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

Quoted 7 lines

I'm not sure what you're asking here. As I mentioned in the initial post, I think we should give blanket permission to any in-tree dpdk library to allow the use of experimental API's, but that doesn't really imply that all developers would wan't it disabled all the time. That is to say, I could envision a library author who, early in development would want to get a warning issued if they used an unstable API, and, only once they were happy with their design and choice of API usage, turn the warning off.

I got your point, but I think whoever using an experimental API in another component in DPDK is almost always the author of the that experimental API, so not sure this check is ever really needed within dpdk.

But OK, I guess it won't hurt to have more granular approach.

Quoted 23 lines
Quoted 5 lines

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

For the reason I gave above. We certainly could enable this in a more top-level makefile so that for in-library systems it was opt-in rather than opt-out, but I chose a more granular approach because I could envision newer libraries wanting it on. I also felt, generally speaking, that where warning flags were concerned, it generally desireous to have them on by default, and make people explicitly choose to turn them off.

Regards
Neil

Quoted 7 lines
Quoted 3 lines
app/test-eventdev/Makefile +0 -0
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 

<...>

#42 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 55 lines · Ferruh Yigit
Quoted 46 lines · Neil Horman
Quoted 38 lines · Ferruh Yigit
Quoted 37 lines · Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +0 -0
index dcb2ac476..78bae7633 100644
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
Quoted 7 lines

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 3 lines
app/test-eventdev/Makefile +1 -0
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

Quoted 7 lines

I'm not sure what you're asking here. As I mentioned in the initial post, I think we should give blanket permission to any in-tree dpdk library to allow the use of experimental API's, but that doesn't really imply that all developers would wan't it disabled all the time. That is to say, I could envision a library author who, early in development would want to get a warning issued if they used an unstable API, and, only once they were happy with their design and choice of API usage, turn the warning off.

Quoted 4 lines

I got your point, but I think whoever using an experimental API in another component in DPDK is almost always the author of the that experimental API, so not sure this check is ever really needed within dpdk.

I would have thought so too, but it doesn't really bear up. The example I used to convince myself of a more granular approach was commit 9c38b704d280ac128003238d7d80bf07fa556a7d where the rte_service API was introduced as experimental by Nikhil Rao, and then later used in the eal library as part of commit a894d4815f79b0d76527d9c42b23327de1501711 by Harry van Haaren. Its no big deal because, as we agree, internal usage should be considered safe, but it seemed clear that differing authors were using each others code (potentially oblivious to the experimental nature of those APIs)

Quoted 27 lines

But OK, I guess it won't hurt to have more granular approach.

Quoted 23 lines
Quoted 5 lines

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

For the reason I gave above. We certainly could enable this in a more top-level makefile so that for in-library systems it was opt-in rather than opt-out, but I chose a more granular approach because I could envision newer libraries wanting it on. I also felt, generally speaking, that where warning flags were concerned, it generally desireous to have them on by default, and make people explicitly choose to turn them off.

Regards
Neil

Quoted 7 lines
Quoted 3 lines
app/test-eventdev/Makefile +0 -0
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 

<...>

#43 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

12/01/2018 13:44, Neil Horman:

Quoted 27 lines · Ferruh Yigit
Quoted 22 lines · Neil Horman
Quoted 13 lines · Ferruh Yigit
Quoted 5 lines · Neil Horman
Quoted 4 lines
app/test-eventdev/Makefile +0 -0
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
Quoted 7 lines

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 3 lines
app/test-eventdev/Makefile +1 -0
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

Quoted 7 lines

I'm not sure what you're asking here. As I mentioned in the initial post, I think we should give blanket permission to any in-tree dpdk library to allow the use of experimental API's, but that doesn't really imply that all developers would wan't it disabled all the time. That is to say, I could envision a library author who, early in development would want to get a warning issued if they used an unstable API, and, only once they were happy with their design and choice of API usage, turn the warning off.

Quoted 4 lines

I got your point, but I think whoever using an experimental API in another component in DPDK is almost always the author of the that experimental API, so not sure this check is ever really needed within dpdk.

Quoted 22 lines

I would have thought so too, but it doesn't really bear up. The example I used to convince myself of a more granular approach was commit 9c38b704d280ac128003238d7d80bf07fa556a7d where the rte_service API was introduced as experimental by Nikhil Rao, and then later used in the eal library as part of commit a894d4815f79b0d76527d9c42b23327de1501711 by Harry van Haaren. Its no big deal because, as we agree, internal usage should be considered safe, but it seemed clear that differing authors were using each others code (potentially oblivious to the experimental nature of those APIs)

Quoted 13 lines

But OK, I guess it won't hurt to have more granular approach.

Quoted 11 lines
Quoted 5 lines

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

For the reason I gave above. We certainly could enable this in a more top-level makefile so that for in-library systems it was opt-in rather than opt-out, but I chose a more granular approach because I could envision newer libraries wanting it on. I also felt, generally speaking, that where warning flags were concerned, it generally desireous to have them on by default, and make people explicitly choose to turn them off.

I think DPDK developpers look at the EXPERIMENTAL warning in the doxygen above the prototype.
And when API will be switched to stable, we probably won't remove the flag in the makefile to disable allowing experimental.
So at the end, we could just allow experimental API for all internal libs.

#44 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 51 lines · Thomas Monjalon

12/01/2018 13:44, Neil Horman:

Quoted 27 lines · Ferruh Yigit
Quoted 22 lines · Neil Horman
Quoted 13 lines · Ferruh Yigit
Quoted 5 lines · Neil Horman
Quoted 4 lines
app/test-eventdev/Makefile +0 -0
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
Quoted 7 lines

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 3 lines
app/test-eventdev/Makefile +1 -0
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

Quoted 7 lines

I'm not sure what you're asking here. As I mentioned in the initial post, I think we should give blanket permission to any in-tree dpdk library to allow the use of experimental API's, but that doesn't really imply that all developers would wan't it disabled all the time. That is to say, I could envision a library author who, early in development would want to get a warning issued if they used an unstable API, and, only once they were happy with their design and choice of API usage, turn the warning off.

Quoted 4 lines

I got your point, but I think whoever using an experimental API in another component in DPDK is almost always the author of the that experimental API, so not sure this check is ever really needed within dpdk.

Quoted 22 lines

I would have thought so too, but it doesn't really bear up. The example I used to convince myself of a more granular approach was commit 9c38b704d280ac128003238d7d80bf07fa556a7d where the rte_service API was introduced as experimental by Nikhil Rao, and then later used in the eal library as part of commit a894d4815f79b0d76527d9c42b23327de1501711 by Harry van Haaren. Its no big deal because, as we agree, internal usage should be considered safe, but it seemed clear that differing authors were using each others code (potentially oblivious to the experimental nature of those APIs)

Quoted 13 lines

But OK, I guess it won't hurt to have more granular approach.

Quoted 11 lines
Quoted 5 lines

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

For the reason I gave above. We certainly could enable this in a more top-level makefile so that for in-library systems it was opt-in rather than opt-out, but I chose a more granular approach because I could envision newer libraries wanting it on. I also felt, generally speaking, that where warning flags were concerned, it generally desireous to have them on by default, and make people explicitly choose to turn them off.

Quoted 2 lines

I think DPDK developpers look at the EXPERIMENTAL warning in the doxygen above the prototype.

I'm not sure I agree with that, but regardless, my initial reasoning for writing this tag was to call attention to experimental API's during review, rather than their use during development, so I didn't gripe about ABI changes on expemted
code. Additionally, weather they look at the docs or not, they can
pre-emptively turn off the warning if they choose.

Quoted 2 lines

And when API will be switched to stable, we probably won't remove the flag in the makefile to disable allowing experimental.

Well, that remains to be seen I suppose.

Quoted 1 line

So at the end, we could just allow experimental API for all internal libs.

Thats a rather bootstrapping argument. You are effecitvely saying that no one developing will ever want to be warned of using experimental APIs in DPDK, so lets just turn it off everyone. I would really rather let individual developers make that call at the time they author something new.

Quoted 1 line
#45 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

22/01/2018 02:34, Neil Horman:

Quoted 62 lines · Thomas Monjalon
Quoted 51 lines

12/01/2018 13:44, Neil Horman:

Quoted 27 lines · Ferruh Yigit
Quoted 22 lines · Neil Horman
Quoted 13 lines · Ferruh Yigit
Quoted 5 lines · Neil Horman
Quoted 4 lines
app/test-eventdev/Makefile +0 -0
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
Quoted 7 lines

app/test-eventdev/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 35

Quoted 3 lines
app/test-eventdev/Makefile +1 -0
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

Do we need this internally in DPDK? For application developers this is great, they will get warning unless explicitly stated that they are OK with it.

Quoted 7 lines

I'm not sure what you're asking here. As I mentioned in the initial post, I think we should give blanket permission to any in-tree dpdk library to allow the use of experimental API's, but that doesn't really imply that all developers would wan't it disabled all the time. That is to say, I could envision a library author who, early in development would want to get a warning issued if they used an unstable API, and, only once they were happy with their design and choice of API usage, turn the warning off.

Quoted 4 lines

I got your point, but I think whoever using an experimental API in another component in DPDK is almost always the author of the that experimental API, so not sure this check is ever really needed within dpdk.

Quoted 22 lines

I would have thought so too, but it doesn't really bear up. The example I used to convince myself of a more granular approach was commit 9c38b704d280ac128003238d7d80bf07fa556a7d where the rte_service API was introduced as experimental by Nikhil Rao, and then later used in the eal library as part of commit a894d4815f79b0d76527d9c42b23327de1501711 by Harry van Haaren. Its no big deal because, as we agree, internal usage should be considered safe, but it seemed clear that differing authors were using each others code (potentially oblivious to the experimental nature of those APIs)

Quoted 13 lines

But OK, I guess it won't hurt to have more granular approach.

Quoted 11 lines
Quoted 5 lines

Do we have any option than allowing them in DPDK library? And when experimental API modified the users in the DPDK library internally guaranteed to be updated. Why not globally allow this for all DPDK internally?

For the reason I gave above. We certainly could enable this in a more top-level makefile so that for in-library systems it was opt-in rather than opt-out, but I chose a more granular approach because I could envision newer libraries wanting it on. I also felt, generally speaking, that where warning flags were concerned, it generally desireous to have them on by default, and make people explicitly choose to turn them off.

Quoted 2 lines

I think DPDK developpers look at the EXPERIMENTAL warning in the doxygen above the prototype.

I'm not sure I agree with that, but regardless, my initial reasoning for writing this tag was to call attention to experimental API's during review, rather than their use during development, so I didn't gripe about ABI changes on expemted
code. Additionally, weather they look at the docs or not, they can
pre-emptively turn off the warning if they choose.

Quoted 2 lines

And when API will be switched to stable, we probably won't remove the flag in the makefile to disable allowing experimental.

Quoted 7 lines

Well, that remains to be seen I suppose.

Quoted 1 line

So at the end, we could just allow experimental API for all internal libs.

Thats a rather bootstrapping argument. You are effecitvely saying that no one developing will ever want to be warned of using experimental APIs in DPDK, so lets just turn it off everyone. I would really rather let individual developers make that call at the time they author something new.

I don't see the benefit,
but I am OK to keep it like this.

#46 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

In reply to Neil Horman

13/12/2017 16:17, Neil Horman:

lib/librte_eal/linuxapp/eal/Makefile

Quoted 3 lines
lib/librte_eal/linuxapp/eal/Makefile +1 -0
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

We can define this flag for the whole DPDK libraries,

	in mk/rte.vars.mk
	inside the block ifneq ($(BUILDING_RTE_SDK),)

mk/internal/rte.compile-pre.mk C_TO_O_DO = @set -e; \ · line 106

Quoted 9 lines
mk/internal/rte.compile-pre.mk +3 -0
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
 
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \

Inserting this check looks good.

#47 lore raw

Re: [PATCHv4 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

Quoted 5 lines · Thomas Monjalon

13/12/2017 16:17, Neil Horman:

lib/librte_eal/linuxapp/eal/Makefile

Quoted 3 lines
lib/librte_eal/linuxapp/eal/Makefile +1 -0
+CFLAGS += -DALLOW_EXPERIMENTAL_APIS

I think I addressed this in an earlier thread, but I'm opposed to doing this. I'm strongly in favor of granting an exception to any developer who wants to use experimental apis for in-tree code, but I would like for them to have to opt into that decision, rather than just have a blanket allowance. I think theres value in a developer having to make tha conscious decision when writing new code.

Quoted 17 lines

We can define this flag for the whole DPDK libraries,

	in mk/rte.vars.mk
	inside the block ifneq ($(BUILDING_RTE_SDK),)

mk/internal/rte.compile-pre.mk C_TO_O_DO = @set -e; \ · line 106

Quoted 9 lines
mk/internal/rte.compile-pre.mk +3 -0
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
 
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \

Inserting this check looks good.

#48 lore raw

PATCH v4 4/5 dpdk: add __experimental tag to appropriate api calls

In reply to Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
 14 files changed, 139 insertions(+), 116 deletions(-)
lib/librte_eal/common/eal_common_dev.c +4 -2
index dda8f5835..ee866ddd2 100644
@@ -37,6 +37,7 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
@@ -133,7 +134,7 @@ full_dev_name(const char *bus, const char *dev, const char *args)
 	return name;
 }
 
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs)
 {
 	struct rte_bus *bus;
@@ -203,7 +204,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
 	return ret;
 }
 
-int rte_eal_hotplug_remove(const char *busname, const char *devname)
+int __experimental
+rte_eal_hotplug_remove(const char *busname, const char *devname)
 {
 	struct rte_bus *bus;
 	struct rte_device *dev;
lib/librte_eal/common/eal_common_devargs.c +4 -3
index 6ac88d6ab..8e46d54bd 100644
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
@@ -85,7 +86,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name)
 	return strncmp(bus->name, name, strlen(bus->name));
 }
 
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 {
 	struct rte_bus *bus = NULL;
@@ -139,7 +140,7 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 	return 0;
 }
 
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da)
 {
 	int ret;
@@ -188,7 +189,7 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
 	return -1;
 }
 
-int
+int __experimental
 rte_eal_devargs_remove(const char *busname, const char *devname)
 {
 	struct rte_devargs *d;
lib/librte_eal/common/include/rte_dev.h +4 -2
index 9342e0cbd..ddb0a09a7 100644
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -209,7 +210,7 @@ int rte_eal_dev_detach(struct rte_device *dev);
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs);
 
 /**
@@ -225,7 +226,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_remove(const char *busname, const char *devname);
+int __experimental rte_eal_hotplug_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Device comparison function.
lib/librte_eal/common/include/rte_devargs.h +5 -3
index 58d585df6..e4c10b6c5 100644
@@ -50,6 +50,7 @@ extern "C" {
 
 #include <stdio.h>
 #include <sys/queue.h>
+#include <rte_compat.h>
 #include <rte_bus.h>
 
 /**
@@ -136,7 +137,7 @@ int rte_eal_parse_devargs_str(const char *devargs_str,
  *   - 0 on success.
  *   - Negative errno on error.
  */
-int
+int __experimental
 rte_eal_devargs_parse(const char *dev,
 		      struct rte_devargs *da);
 
@@ -150,7 +151,7 @@ rte_eal_devargs_parse(const char *dev,
  *   - 0 on success
  *   - Negative on error.
  */
-int
+int __experimental
 rte_eal_devargs_insert(struct rte_devargs *da);
 
 /**
@@ -193,7 +194,8 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
  *   <0 on error.
  *   >0 if the devargs was not within the user device list.
  */
-int rte_eal_devargs_remove(const char *busname, const char *devname);
+int __experimental rte_eal_devargs_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Count the number of user devices of a specified type
lib/librte_eal/common/include/rte_service.h +26 -21

167 lines not on this page · raw message

lib/librte_eal/common/include/rte_service_component.h +8 -6
index ac965cb48..a129258eb 100644
@@ -37,7 +37,7 @@
  * Include this file if you are writing a component that requires CPU cycles to
  * operate, and you wish to run the component using service cores
  */
-
+#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
@@ -101,8 +101,9 @@ struct rte_service_spec {
  *         -EINVAL Attempted to register an invalid service (eg, no callback
  *         set)
  */
-int32_t rte_service_component_register(const struct rte_service_spec *spec,
-				       uint32_t *service_id);
+int32_t __experimental
+rte_service_component_register(const struct rte_service_spec *spec,
+			       uint32_t *service_id);
 
 /**
  * @warning
@@ -116,7 +117,7 @@ int32_t rte_service_component_register(const struct rte_service_spec *spec,
  * @retval -EBUSY The service is currently running, stop the service before
  *          calling unregister. No action has been taken.
  */
-int32_t rte_service_component_unregister(uint32_t id);
+int32_t __experimental rte_service_component_unregister(uint32_t id);
 
 /**
  * @warning
@@ -134,7 +135,7 @@ int32_t rte_service_component_unregister(uint32_t id);
  * @retval -ENODEV Error in enabling service lcore on a service
  * @retval -ENOEXEC Error when starting services
  */
-int32_t rte_service_start_with_defaults(void);
+int32_t __experimental rte_service_start_with_defaults(void);
 
 /**
  * @warning
@@ -151,7 +152,8 @@ int32_t rte_service_start_with_defaults(void);
  *
  * @retval 0 Success
  */
-int32_t rte_service_component_runstate_set(uint32_t id, uint32_t runstate);
+int32_t __experimental rte_service_component_runstate_set(uint32_t id,
+							  uint32_t runstate);
 
 /**
  * @warning
lib/librte_eal/common/rte_service.c +28 -24

201 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal.c +1 -0
index 229eec9f1..73a0da22c 100644
@@ -53,6 +53,7 @@
 #include <sys/io.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
lib/librte_ether/rte_mtr.c +13 -12
index 4f56f8714..2cbe0bb5a 100644
@@ -34,6 +34,7 @@
 #include <stdint.h>
 
 #include <rte_errno.h>
+#include "rte_compat.h"
 #include "rte_ethdev.h"
 #include "rte_mtr_driver.h"
 #include "rte_mtr.h"
@@ -86,7 +87,7 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error)
 })
 
 /* MTR capabilities get */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error)
@@ -97,7 +98,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
 }
 
 /* MTR meter profile add */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -109,7 +110,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
 }
 
 /** MTR meter profile delete */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error)
@@ -120,7 +121,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
 }
 
 /** MTR object create */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -133,7 +134,7 @@ rte_mtr_create(uint16_t port_id,
 }
 
 /** MTR object destroy */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -144,7 +145,7 @@ rte_mtr_destroy(uint16_t port_id,
 }
 
 /** MTR object meter enable */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -155,7 +156,7 @@ rte_mtr_meter_enable(uint16_t port_id,
 }
 
 /** MTR object meter disable */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -166,7 +167,7 @@ rte_mtr_meter_disable(uint16_t port_id,
 }
 
 /** MTR object meter profile update */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -178,7 +179,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
 }
 
 /** MTR object meter DSCP table update */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -190,7 +191,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
 }
 
 /** MTR object policer action update */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -203,7 +204,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
 }
 
 /** MTR object enabled stats update */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -215,7 +216,7 @@ rte_mtr_stats_update(uint16_t port_id,
 }
 
 /** MTR object stats read */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_ether/rte_mtr.h +13 -13
index f6b6ef3b6..fd8361998 100644
@@ -74,7 +74,7 @@
  * @b EXPERIMENTAL: this API may change without prior notice
  */
 #include <stdint.h>
-
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
@@ -447,7 +447,7 @@ struct rte_mtr_error {
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error);
@@ -470,7 +470,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -491,7 +491,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error);
@@ -519,7 +519,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
  *
  * @see enum rte_flow_action_type::RTE_FLOW_ACTION_TYPE_METER
  */
-int
+int __experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -542,7 +542,7 @@ rte_mtr_create(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -569,7 +569,7 @@ rte_mtr_destroy(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -590,7 +590,7 @@ rte_mtr_meter_disable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -609,7 +609,7 @@ rte_mtr_meter_enable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -633,7 +633,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -659,7 +659,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -684,7 +684,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -715,7 +715,7 @@ rte_mtr_stats_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_flow_classify/rte_flow_classify.c +7 -6
index e6f448643..6716672fc 100644
@@ -31,6 +31,7 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
 #include <rte_flow_driver.h>
@@ -245,7 +246,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params)
 	return 0;
 }
 
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params)
 {
 	struct rte_flow_classifier *cls;
@@ -291,7 +292,7 @@ rte_flow_classify_table_free(struct rte_table *table)
 		table->ops.f_free(table->h_table);
 }
 
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls)
 {
 	uint32_t i;
@@ -369,7 +370,7 @@ rte_table_check_params(struct rte_flow_classifier *cls,
 	return 0;
 }
 
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 	struct rte_flow_classify_table_params *params,
 	uint32_t *table_id)
@@ -483,7 +484,7 @@ allocate_acl_ipv4_5tuple_rule(void)
 	return rule;
 }
 
-struct rte_flow_classify_rule *
+struct rte_flow_classify_rule * __experimental
 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		int *key_found,
@@ -582,7 +583,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 	return rule;
 }
 
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule)
@@ -659,7 +660,7 @@ action_apply(struct rte_flow_classifier *cls,
 	return ret;
 }
 
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_flow_classify/rte_flow_classify.h +6 -5
index 1211873a1..cd9516f9e 100644
@@ -70,6 +70,7 @@
  *    with rte_flow_classifier_free()
  */
 
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
@@ -176,7 +177,7 @@ struct rte_flow_classify_ipv4_5tuple_stats {
  * @return
  *   Handle to flow classifier instance on success or NULL otherwise
  */
-struct rte_flow_classifier *
+struct rte_flow_classifier * __experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params);
 
 /**
@@ -187,7 +188,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls);
 
 /**
@@ -203,7 +204,7 @@ rte_flow_classifier_free(struct rte_flow_classifier *cls);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 		struct rte_flow_classify_table_params *params,
 		uint32_t *table_id);
@@ -250,7 +251,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule);
@@ -274,7 +275,7 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_security/rte_security.c +8 -8
index 1227fca8a..958b7273e 100644
@@ -33,12 +33,12 @@
 
 #include <rte_malloc.h>
 #include <rte_dev.h>
-
+#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
 struct rte_security_session *
-rte_security_session_create(struct rte_security_ctx *instance,
+__experimental rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
@@ -61,7 +61,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
 	return sess;
 }
 
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf)
@@ -70,7 +70,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
 	return instance->ops->session_update(instance->device, sess, conf);
 }
 
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats)
@@ -79,7 +79,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 	return instance->ops->session_stats_get(instance->device, sess, stats);
 }
 
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess)
 {
@@ -98,7 +98,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 	return ret;
 }
 
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *m, void *params)
@@ -108,14 +108,14 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 					       sess, m, params);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance)
 {
 	RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->capabilities_get, NULL);
 	return instance->ops->capabilities_get(instance->device);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx)
 {
lib/librte_security/rte_security.h +12 -11
index 653929b99..176378e78 100644
@@ -52,6 +52,7 @@ extern "C" {
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_mbuf.h>
@@ -291,7 +292,7 @@ struct rte_security_session {
  *  - On success, pointer to session
  *  - On failure, NULL
  */
-struct rte_security_session *
+struct rte_security_session * __experimental
 rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
@@ -306,7 +307,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  *  - On success returns 0
  *  - On failure return errno
  */
-int
+int __experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf);
@@ -323,7 +324,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *  - -EINVAL if session is NULL.
  *  - -EBUSY if not all device private data has been freed.
  */
-int
+int __experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess);
 
@@ -340,7 +341,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+int __experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *mb, void *params);
@@ -351,7 +352,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  * @param	sym_op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 			      struct rte_security_session *sess)
 {
@@ -360,13 +361,13 @@ __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 	return 0;
 }
 
-static inline void *
+static inline void * __experimental
 get_sec_session_private_data(const struct rte_security_session *sess)
 {
 	return sess->sess_private_data;
 }
 
-static inline void
+static inline void __experimental
 set_sec_session_private_data(struct rte_security_session *sess,
 			     void *private_data)
 {
@@ -382,7 +383,7 @@ set_sec_session_private_data(struct rte_security_session *sess,
  * @param	op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __experimental
 rte_security_attach_session(struct rte_crypto_op *op,
 			    struct rte_security_session *sess)
 {
@@ -424,7 +425,7 @@ struct rte_security_stats {
  *  - On success return 0
  *  - On failure errno
  */
-int
+int __experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats);
@@ -507,7 +508,7 @@ struct rte_security_capability_idx {
  *   - Returns array of security capabilities.
  *   - Return NULL if no capabilities available.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance);
 
 /**
@@ -521,7 +522,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *     index criteria.
  *   - Return NULL if the capability not matched on security instance.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx);
 
Signature · 1 line
2.14.3
#49 lore raw

Re: [PATCHv4 4/5] dpdk: add __experimental tag to appropriate api calls

Quoted 7 lines · Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
Quoted 15 lines
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----

It may not be the responsibility of this patchset, but there are more experimental APIs in DPDK.

Using EXPERIMENTAL tag in linker script is relatively new approach and this was not a requirement, so many experimental APIs are documented in API documentation (header file doxygen comment).
Sample: librte_member

It is required to scan all header files and update their linker scripts for the experimental APIs.

Quoted 1 line
 14 files changed, 139 insertions(+), 116 deletions(-)

<...>

#50 lore raw

Re: [PATCHv4 4/5] dpdk: add __experimental tag to appropriate api calls

Quoted 24 lines · Ferruh Yigit
Quoted 7 lines · Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
Quoted 15 lines
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
Quoted 3 lines

It may not be the responsibility of this patchset, but there are more experimental APIs in DPDK.

Thats an interesting statement to make. This patchset creates a build time check that compares symbols located in the EXPERIMENTAL version section of a libraries' version map file to the symbols that are marked with this new tag, throwing an error if they don't match. I believe what you say in that there may be additional APIs that are experimental, but given that, I would have to conclude one of the following:

1) The missing API's are macros or static inline functions that are not exported from libraries directly

2) The documentation for experimental API's are out of sync, in that they have legitimately moved to be supported API's and the documentation needs to be updated

3) There are API's which are experimental that have been incorrectly placed in a versioned tag.

I made a pretty good effort to scan comments for the word EXPERIMENTAL so that I could catch item (1). And while I may not have caught them all, I'd like to think I got a good chunk of them. That leaves cleanup of (2) and (3), which I think this patchset can help us idenfity.

Quoted 5 lines

Using EXPERIMENTAL tag in linker script is relatively new approach and this was not a requirement, so many experimental APIs are documented in API documentation (header file doxygen comment).
Sample: librte_member

That sounds like case (3) above.

Thats a bit odd. I understand that the use of the EXPERIMENTAL version tag is new, but once it was introduced it should have been made a requirement. There would have been no penalty for moving the version number (as doing so would not have violated ABI guarantees, given that those API's were appropriately documented as experimental). If they have not been, then the use of the EXPERIMENTAL tag isn't overly useful, as it doesn't provide any segregation of the stable ABI from the unstable ABI.

Quoted 3 lines

It is required to scan all header files and update their linker scripts for the experimental APIs.

Yes and no. If a given library is not marked as experimental in its version map, this change won't flag it as a problem, but if its intended to be experimental (i.e. if its likely to have its ABI fluctuate), then yes, we should take the appropriate steps to flag it as such properly.

If a given library is intended to be experimental, I would say yes, the author should make the appropriate chage to the version map, and then the corresponding change to the headers and c files with this new tag. Alternatively, they might choose to simply update the documentation to reflect the fact that the ABI for that library is now stable.

The thing that should definately not hapen though, is a half measure. We shouldn't allow libraries to call themselves experimental, and then excuse them from any rules we have regarding their in-code representation. If we have an EXPERIMENTAL version in the map, we should require its use, and by extension require this tag when its merged for the reasons previously outlined

Neil

Quoted 5 lines
Quoted 1 line
 14 files changed, 139 insertions(+), 116 deletions(-)

<...>

#51 lore raw

Re: [PATCHv4 4/5] dpdk: add __experimental tag to appropriate api calls

Quoted 79 lines · Neil Horman
Quoted 24 lines · Ferruh Yigit
Quoted 7 lines · Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
Quoted 15 lines
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
Quoted 3 lines

It may not be the responsibility of this patchset, but there are more experimental APIs in DPDK.

Thats an interesting statement to make. This patchset creates a build time check that compares symbols located in the EXPERIMENTAL version section of a libraries' version map file to the symbols that are marked with this new tag, throwing an error if they don't match. I believe what you say in that there may be additional APIs that are experimental, but given that, I would have to conclude one of the following:

1) The missing API's are macros or static inline functions that are not exported from libraries directly

2) The documentation for experimental API's are out of sync, in that they have legitimately moved to be supported API's and the documentation needs to be updated

3) There are API's which are experimental that have been incorrectly placed in a versioned tag.

I made a pretty good effort to scan comments for the word EXPERIMENTAL so that I could catch item (1). And while I may not have caught them all, I'd like to think I got a good chunk of them. That leaves cleanup of (2) and (3), which I think this patchset can help us idenfity.

Quoted 5 lines

Using EXPERIMENTAL tag in linker script is relatively new approach and this was not a requirement, so many experimental APIs are documented in API documentation (header file doxygen comment).
Sample: librte_member

That sounds like case (3) above.

Thats a bit odd. I understand that the use of the EXPERIMENTAL version tag is new, but once it was introduced it should have been made a requirement. There would have been no penalty for moving the version number (as doing so would not have violated ABI guarantees, given that those API's were appropriately documented as experimental). If they have not been, then the use of the EXPERIMENTAL tag isn't overly useful, as it doesn't provide any segregation of the stable ABI from the unstable ABI.

Quoted 3 lines

It is required to scan all header files and update their linker scripts for the experimental APIs.

Yes and no. If a given library is not marked as experimental in its version map, this change won't flag it as a problem, but if its intended to be experimental (i.e. if its likely to have its ABI fluctuate), then yes, we should take the appropriate steps to flag it as such properly.

If a given library is intended to be experimental, I would say yes, the author should make the appropriate chage to the version map, and then the corresponding change to the headers and c files with this new tag. Alternatively, they might choose to simply update the documentation to reflect the fact that the ABI for that library is now stable.

Quoted 5 lines

The thing that should definately not hapen though, is a half measure. We shouldn't allow libraries to call themselves experimental, and then excuse them from any rules we have regarding their in-code representation. If we have an EXPERIMENTAL version in the map, we should require its use, and by extension require this tag when its merged for the reasons previously outlined

My comment is for your item (3), but it is not fair to say "incorrectly placed" because if I don't miss anything this has never been documented as correct way to do, and lots of the existing usage is _before_ we start using EXPERIMENTAL tag in the linker script, so they were doing right thing for that time.

Question is, is this patchset should fix them, since now this patchset defines using EXPERIMENTAL tag in linker script as way to do it, or should we wait maintainers to fix it after this has been documented. Waiting for maintainer may take time because not all maintainers are following the mail list closely to capture all expectations.

Quoted 9 lines

Neil

Quoted 5 lines
Quoted 1 line
 14 files changed, 139 insertions(+), 116 deletions(-)

<...>

#52 lore raw

Re: [PATCHv4 4/5] dpdk: add __experimental tag to appropriate api calls

Quoted 86 lines · Ferruh Yigit
Quoted 79 lines · Neil Horman
Quoted 24 lines · Ferruh Yigit
Quoted 7 lines · Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
Quoted 15 lines
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
Quoted 3 lines

It may not be the responsibility of this patchset, but there are more experimental APIs in DPDK.

Thats an interesting statement to make. This patchset creates a build time check that compares symbols located in the EXPERIMENTAL version section of a libraries' version map file to the symbols that are marked with this new tag, throwing an error if they don't match. I believe what you say in that there may be additional APIs that are experimental, but given that, I would have to conclude one of the following:

1) The missing API's are macros or static inline functions that are not exported from libraries directly

2) The documentation for experimental API's are out of sync, in that they have legitimately moved to be supported API's and the documentation needs to be updated

3) There are API's which are experimental that have been incorrectly placed in a versioned tag.

I made a pretty good effort to scan comments for the word EXPERIMENTAL so that I could catch item (1). And while I may not have caught them all, I'd like to think I got a good chunk of them. That leaves cleanup of (2) and (3), which I think this patchset can help us idenfity.

Quoted 5 lines

Using EXPERIMENTAL tag in linker script is relatively new approach and this was not a requirement, so many experimental APIs are documented in API documentation (header file doxygen comment).
Sample: librte_member

That sounds like case (3) above.

Thats a bit odd. I understand that the use of the EXPERIMENTAL version tag is new, but once it was introduced it should have been made a requirement. There would have been no penalty for moving the version number (as doing so would not have violated ABI guarantees, given that those API's were appropriately documented as experimental). If they have not been, then the use of the EXPERIMENTAL tag isn't overly useful, as it doesn't provide any segregation of the stable ABI from the unstable ABI.

Quoted 3 lines

It is required to scan all header files and update their linker scripts for the experimental APIs.

Yes and no. If a given library is not marked as experimental in its version map, this change won't flag it as a problem, but if its intended to be experimental (i.e. if its likely to have its ABI fluctuate), then yes, we should take the appropriate steps to flag it as such properly.

If a given library is intended to be experimental, I would say yes, the author should make the appropriate chage to the version map, and then the corresponding change to the headers and c files with this new tag. Alternatively, they might choose to simply update the documentation to reflect the fact that the ABI for that library is now stable.

Quoted 5 lines

The thing that should definately not hapen though, is a half measure. We shouldn't allow libraries to call themselves experimental, and then excuse them from any rules we have regarding their in-code representation. If we have an EXPERIMENTAL version in the map, we should require its use, and by extension require this tag when its merged for the reasons previously outlined

Quoted 5 lines

My comment is for your item (3), but it is not fair to say "incorrectly placed" because if I don't miss anything this has never been documented as correct way to do, and lots of the existing usage is _before_ we start using EXPERIMENTAL tag in the linker script, so they were doing right thing for that time.

Ok, Apologies, perhaps incorrectly placed isn't a fair term to use. Perhaps it would be better to say the experimental specification was insufficiently documented? The point however remains. Defining an API category that conveys a freedom of modification of ABI needs to follow rules for identification, and providing a mechanism to tag said ABIs in the code without a requirement to use it creates an confusing situation to say the least (i.e. some APIS will be listed as belonging to the EXPERIMENTAL version, others won't, but will be documented as such, creating an ambiguous status).

Quoted 6 lines

Question is, is this patchset should fix them, since now this patchset defines using EXPERIMENTAL tag in linker script as way to do it, or should we wait maintainers to fix it after this has been documented. Waiting for maintainer may take time because not all maintainers are following the mail list closely to capture all expectations.

In answer, I think waiting for maintainers to correct their experimental use isn't going to get anything done. As you said, not all maintainers monitor all conversations closely enough to pick up on the need, and as we move forward this effort will likely get de-prioitized, as the status quo will just continue to exist. I would propose that we accept this patch, and then I subsequently preform an audit on the documentation to find other APIs which are documented as EXPERIMENTAL, but not tagged as such in their version files. I can submit subsequent patches to reconcile those APIs that I find, which should get on the respective maintainers radars. Does that sound reasonable?

Neil

Quoted 11 lines
Quoted 9 lines

Neil

Quoted 5 lines
Quoted 1 line
 14 files changed, 139 insertions(+), 116 deletions(-)

<...>

Acked-by
#53 lore raw

Re: [PATCHv4 4/5] dpdk: add __experimental tag to appropriate api calls

Quoted 108 lines · Neil Horman
Quoted 86 lines · Ferruh Yigit
Quoted 79 lines · Neil Horman
Quoted 24 lines · Ferruh Yigit
Quoted 7 lines · Neil Horman

Append the __experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
Quoted 15 lines
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
Quoted 3 lines

It may not be the responsibility of this patchset, but there are more experimental APIs in DPDK.

Thats an interesting statement to make. This patchset creates a build time check that compares symbols located in the EXPERIMENTAL version section of a libraries' version map file to the symbols that are marked with this new tag, throwing an error if they don't match. I believe what you say in that there may be additional APIs that are experimental, but given that, I would have to conclude one of the following:

1) The missing API's are macros or static inline functions that are not exported from libraries directly

2) The documentation for experimental API's are out of sync, in that they have legitimately moved to be supported API's and the documentation needs to be updated

3) There are API's which are experimental that have been incorrectly placed in a versioned tag.

I made a pretty good effort to scan comments for the word EXPERIMENTAL so that I could catch item (1). And while I may not have caught them all, I'd like to think I got a good chunk of them. That leaves cleanup of (2) and (3), which I think this patchset can help us idenfity.

Quoted 5 lines

Using EXPERIMENTAL tag in linker script is relatively new approach and this was not a requirement, so many experimental APIs are documented in API documentation (header file doxygen comment).
Sample: librte_member

That sounds like case (3) above.

Thats a bit odd. I understand that the use of the EXPERIMENTAL version tag is new, but once it was introduced it should have been made a requirement. There would have been no penalty for moving the version number (as doing so would not have violated ABI guarantees, given that those API's were appropriately documented as experimental). If they have not been, then the use of the EXPERIMENTAL tag isn't overly useful, as it doesn't provide any segregation of the stable ABI from the unstable ABI.

Quoted 3 lines

It is required to scan all header files and update their linker scripts for the experimental APIs.

Yes and no. If a given library is not marked as experimental in its version map, this change won't flag it as a problem, but if its intended to be experimental (i.e. if its likely to have its ABI fluctuate), then yes, we should take the appropriate steps to flag it as such properly.

If a given library is intended to be experimental, I would say yes, the author should make the appropriate chage to the version map, and then the corresponding change to the headers and c files with this new tag. Alternatively, they might choose to simply update the documentation to reflect the fact that the ABI for that library is now stable.

Quoted 5 lines

The thing that should definately not hapen though, is a half measure. We shouldn't allow libraries to call themselves experimental, and then excuse them from any rules we have regarding their in-code representation. If we have an EXPERIMENTAL version in the map, we should require its use, and by extension require this tag when its merged for the reasons previously outlined

Quoted 5 lines

My comment is for your item (3), but it is not fair to say "incorrectly placed" because if I don't miss anything this has never been documented as correct way to do, and lots of the existing usage is _before_ we start using EXPERIMENTAL tag in the linker script, so they were doing right thing for that time.

Ok, Apologies, perhaps incorrectly placed isn't a fair term to use. Perhaps it would be better to say the experimental specification was insufficiently documented? The point however remains. Defining an API category that conveys a freedom of modification of ABI needs to follow rules for identification, and providing a mechanism to tag said ABIs in the code without a requirement to use it creates an confusing situation to say the least (i.e. some APIS will be listed as belonging to the EXPERIMENTAL version, others won't, but will be documented as such, creating an ambiguous status).

Quoted 6 lines

Question is, is this patchset should fix them, since now this patchset defines using EXPERIMENTAL tag in linker script as way to do it, or should we wait maintainers to fix it after this has been documented. Waiting for maintainer may take time because not all maintainers are following the mail list closely to capture all expectations.

Quoted 9 lines

In answer, I think waiting for maintainers to correct their experimental use isn't going to get anything done. As you said, not all maintainers monitor all conversations closely enough to pick up on the need, and as we move forward this effort will likely get de-prioitized, as the status quo will just continue to exist. I would propose that we accept this patch, and then I subsequently preform an audit on the documentation to find other APIs which are documented as EXPERIMENTAL, but not tagged as such in their version files. I can submit subsequent patches to reconcile those APIs that I find, which should get on the respective maintainers radars. Does that sound reasonable?

Sounds good to me, hence

Series

Quoted 14 lines

Neil

Quoted 11 lines
Quoted 9 lines

Neil

Quoted 5 lines
Quoted 1 line
 14 files changed, 139 insertions(+), 116 deletions(-)

<...>

#54 lore raw

PATCH v4 5/5 doc: Add ABI __experimental tag documentation

In reply to Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 doc/guides/contributing/versioning.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
doc/guides/contributing/versioning.rst +9 -0
index 400090628..53f56397e 100644
@@ -50,6 +50,15 @@ those new APIs and start finding issues with them, new DPDK APIs will be
 automatically marked as ``experimental`` to allow for a period of stabilization
 before they become part of a tracked ABI.
 
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.
+
 ABI versions, once released, are available until such time as their
 deprecation has been noted in the Release Notes for at least one major release
 cycle. For example consider the case where the ABI for DPDK 2.0 has been
Signature · 1 line
2.14.3
#55 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 17 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 doc/guides/contributing/versioning.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
doc/guides/contributing/versioning.rst +0 -0
index 400090628..53f56397e 100644
@@ -50,6 +50,15 @@ those new APIs and start finding issues with them, new DPDK APIs will be
 automatically marked as ``experimental`` to allow for a period of stabilization
 before they become part of a tracked ABI.

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 61

Quoted 10 lines
doc/guides/contributing/versioning.rst +9 -0
 
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.
+

Minor typo s/preform/perform/

Quoted 6 lines
doc/guides/contributing/versioning.rst +0 -0
 ABI versions, once released, are available until such time as their
 deprecation has been noted in the Release Notes for at least one major release
 cycle. For example consider the case where the ABI for DPDK 2.0 has been
Signature · 1 line
2.14.3
#56 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

In reply to Neil Horman
Quoted 16 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 doc/guides/contributing/versioning.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
doc/guides/contributing/versioning.rst +0 -0
index 400090628..53f56397e 100644
@@ -50,6 +50,15 @@ those new APIs and start finding issues with them, new DPDK APIs will be
 automatically marked as ``experimental`` to allow for a period of stabilization

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 60

Quoted 10 lines
doc/guides/contributing/versioning.rst +8 -0
 before they become part of a tracked ABI.
 
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.

There are more steps we historically do to mark an API as experimental:
- Add to function header comment experimental for API documentation, preferably with a warning tag to highlight it:

/**
* @warning
* @b EXPERIMENTAL:
....
*/

- If whole APIs in header file are experimental, add same experimental warning doxygen comment in file comment, again preferably with warning.

- If whole library is experimental, put EXPERIMENTAL tag into maintainers file as well.

Quoted 5 lines
doc/guides/contributing/versioning.rst +1 -0
+
 ABI versions, once released, are available until such time as their
 deprecation has been noted in the Release Notes for at least one major release
 cycle. For example consider the case where the ABI for DPDK 2.0 has been
#57 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 38 lines · Ferruh Yigit
Quoted 16 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 doc/guides/contributing/versioning.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
doc/guides/contributing/versioning.rst +0 -0
index 400090628..53f56397e 100644
@@ -50,6 +50,15 @@ those new APIs and start finding issues with them, new DPDK APIs will be
 automatically marked as ``experimental`` to allow for a period of stabilization

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 60

Quoted 10 lines
doc/guides/contributing/versioning.rst +8 -0
 before they become part of a tracked ABI.
 
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.

There are more steps we historically do to mark an API as experimental:
- Add to function header comment experimental for API documentation, preferably with a warning tag to highlight it:

/**
* @warning
* @b EXPERIMENTAL:
....
*/

Quoted 6 lines

- If whole APIs in header file are experimental, add same experimental warning doxygen comment in file comment, again preferably with warning.

- If whole library is experimental, put EXPERIMENTAL tag into maintainers file as well.

Is that documented somewhere? I'd like to add this to the same location that it otherwise is written out. The above location was the only place in the guide that I could find reference to experimental markings.

Quoted 7 lines
Quoted 5 lines
doc/guides/contributing/versioning.rst +1 -0
+
 ABI versions, once released, are available until such time as their
 deprecation has been noted in the Release Notes for at least one major release
 cycle. For example consider the case where the ABI for DPDK 2.0 has been
#58 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 8 lines · Neil Horman
Quoted 7 lines · Ferruh Yigit
Quoted 6 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>

<...>

Quoted 1 line
Quoted 1 line
Quoted 1 line

automatically marked as ``experimental`` to allow for a period of stabilization>>> before they become part of a tracked ABI.

Full sentences for above statement:
"
Since changes to APIs are most likely immediately after their introduction, as users begin to take advantage of those new APIs and start finding issues with them, new DPDK APIs will be automatically marked as experimental to allow for a period of stabilization before they become part of a tracked ABI. "

This part is not related to this patchset, but it will be hard to maintain above behavior, "automatically marked" is not automatic now and moving them to stable after one release is also not automatic. Do you have any suggestion on how to manage this, do you think can your script be expanded to cover these checks?

Quoted 23 lines
Quoted 23 lines

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 60

Quoted 9 lines
doc/guides/contributing/versioning.rst +8 -0
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.

There are more steps we historically do to mark an API as experimental:
- Add to function header comment experimental for API documentation, preferably with a warning tag to highlight it:

/**
* @warning
* @b EXPERIMENTAL:
....
*/

- If whole APIs in header file are experimental, add same experimental warning doxygen comment in file comment, again preferably with warning.

Quoted 6 lines
Quoted 3 lines

- If whole library is experimental, put EXPERIMENTAL tag into maintainers file as well.

Is that documented somewhere? I'd like to add this to the same location that it otherwise is written out. The above location was the only place in the guide that I could find reference to experimental markings.

As far as I know how to mark an API as experimental is not documented. What do you think making a new section for this information?

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

+
ABI versions, once released, are available until such time as their deprecation has been noted in the Release Notes for at least one major release cycle. For example consider the case where the ABI for DPDK 2.0 has been

#59 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 22 lines · Ferruh Yigit
Quoted 8 lines · Neil Horman
Quoted 7 lines · Ferruh Yigit
Quoted 6 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>

<...>

Quoted 1 line
Quoted 1 line
Quoted 1 line

automatically marked as ``experimental`` to allow for a period of stabilization>>> before they become part of a tracked ABI.

Full sentences for above statement:
"
Since changes to APIs are most likely immediately after their introduction, as users begin to take advantage of those new APIs and start finding issues with them, new DPDK APIs will be automatically marked as experimental to allow for a period of stabilization before they become part of a tracked ABI. "

Quoted 5 lines

This part is not related to this patchset, but it will be hard to maintain above behavior, "automatically marked" is not automatic now and moving them to stable after one release is also not automatic. Do you have any suggestion on how to manage this, do you think can your script be expanded to cover these checks?

I would make the argument that this was never the case, but rather a statement of principle. I assert that because I can find no mechanism anywhere in our build system that 'automatically' documented or marked a new API as experimental (please correct me if I'm wrong here). I think this was more meant to be a directive to developers to do whatever coding was needed to preform such marking/documentation in whatever style/format was current. E.g. introducers of a new API should document everything as EXPERIMENTAL using the appropriate doxygen tag and version map tag.

In answer to your question, While we might be able to expand my script to check for new API's and ensure they are marked as experimental, I don't think thats the right place to do it, because that script is run at build time, where the state of the tree is transient. A better place to do it would be with a git hook at checkin time, or in the checkpatch script to flag new apis as experimental right before those new API's are comitted. Though I'm not a huge fan of that either (at least not of the former suggestion). I say that because I think we need to allow developers the freedom to determine the supported status of any new API that they add. For example, it seems pretty clear that a new library might want to have its entire API marked as experimental, but someone adding a single new function to an existing API might be confident that the new function is needed and should be immediately supported..

I think the better solution is to define the use of the EXPERIMENTAL tag in the version map as the canonical location to define unstable API functions. Doing so immediately commits an author to ensuring that the corresponding function definitions are marked with the __experimental tags, which in turn will cause any downstream users to be alerted to the fact that they might be using those API's in their code, so they can take appropriate action. It still allows for the Documentation to be out of sync, but alerting authors doing development I think is the more important element here, as Documentation can be corrected more easily than code in the field.

Thoughts?
Neil

Quoted 43 lines
Quoted 23 lines
Quoted 23 lines

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 60

Quoted 9 lines
doc/guides/contributing/versioning.rst +8 -0
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.

There are more steps we historically do to mark an API as experimental:
- Add to function header comment experimental for API documentation, preferably with a warning tag to highlight it:

/**
* @warning
* @b EXPERIMENTAL:
....
*/

- If whole APIs in header file are experimental, add same experimental warning doxygen comment in file comment, again preferably with warning.

Quoted 6 lines
Quoted 3 lines

- If whole library is experimental, put EXPERIMENTAL tag into maintainers file as well.

Is that documented somewhere? I'd like to add this to the same location that it otherwise is written out. The above location was the only place in the guide that I could find reference to experimental markings.

As far as I know how to mark an API as experimental is not documented. What do you think making a new section for this information?

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

+
ABI versions, once released, are available until such time as their deprecation has been noted in the Release Notes for at least one major release cycle. For example consider the case where the ABI for DPDK 2.0 has been

#60 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 61 lines · Neil Horman
Quoted 22 lines · Ferruh Yigit
Quoted 8 lines · Neil Horman
Quoted 7 lines · Ferruh Yigit
Quoted 6 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>

<...>

Quoted 1 line
Quoted 1 line
Quoted 1 line

automatically marked as ``experimental`` to allow for a period of stabilization>>> before they become part of a tracked ABI.

Full sentences for above statement:
"
Since changes to APIs are most likely immediately after their introduction, as users begin to take advantage of those new APIs and start finding issues with them, new DPDK APIs will be automatically marked as experimental to allow for a period of stabilization before they become part of a tracked ABI. "

Quoted 5 lines

This part is not related to this patchset, but it will be hard to maintain above behavior, "automatically marked" is not automatic now and moving them to stable after one release is also not automatic. Do you have any suggestion on how to manage this, do you think can your script be expanded to cover these checks?

I would make the argument that this was never the case, but rather a statement of principle. I assert that because I can find no mechanism anywhere in our build system that 'automatically' documented or marked a new API as experimental (please correct me if I'm wrong here). I think this was more meant to be a directive to developers to do whatever coding was needed to preform such marking/documentation in whatever style/format was current. E.g. introducers of a new API should document everything as EXPERIMENTAL using the appropriate doxygen tag and version map tag.

In answer to your question, While we might be able to expand my script to check for new API's and ensure they are marked as experimental, I don't think thats the right place to do it, because that script is run at build time, where the state of the tree is transient. A better place to do it would be with a git hook at checkin time, or in the checkpatch script to flag new apis as experimental right before those new API's are comitted. Though I'm not a huge fan of that either (at least not of the former suggestion). I say that because I think we need to allow developers the freedom to determine the supported status of any new API that they add. For example, it seems pretty clear that a new library might want to have its entire API marked as experimental, but someone adding a single new function to an existing API might be confident that the new function is needed and should be immediately supported..

I think the better solution is to define the use of the EXPERIMENTAL tag in the version map as the canonical location to define unstable API functions. Doing so immediately commits an author to ensuring that the corresponding function definitions are marked with the __experimental tags, which in turn will cause any downstream users to be alerted to the fact that they might be using those API's in their code, so they can take appropriate action. It still allows for the Documentation to be out of sync, but alerting authors doing development I think is the more important element here, as Documentation can be corrected more easily than code in the field.

Quoted 1 line

Thoughts?

After this point agree to using EXPERIMENTAL tag in the version map as standard, but it will be hard to maintain "API is experimental for first release" without help of any automated tool.

Quoted 45 lines

Neil

Quoted 43 lines
Quoted 23 lines
Quoted 23 lines

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 60

Quoted 9 lines
doc/guides/contributing/versioning.rst +8 -0
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.

There are more steps we historically do to mark an API as experimental:
- Add to function header comment experimental for API documentation, preferably with a warning tag to highlight it:

/**
* @warning
* @b EXPERIMENTAL:
....
*/

- If whole APIs in header file are experimental, add same experimental warning doxygen comment in file comment, again preferably with warning.

Quoted 6 lines
Quoted 3 lines

- If whole library is experimental, put EXPERIMENTAL tag into maintainers file as well.

Is that documented somewhere? I'd like to add this to the same location that it otherwise is written out. The above location was the only place in the guide that I could find reference to experimental markings.

As far as I know how to mark an API as experimental is not documented. What do you think making a new section for this information?

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

+
ABI versions, once released, are available until such time as their deprecation has been noted in the Release Notes for at least one major release cycle. For example consider the case where the ABI for DPDK 2.0 has been

#61 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 62 lines · Ferruh Yigit
Quoted 61 lines · Neil Horman
Quoted 22 lines · Ferruh Yigit
Quoted 8 lines · Neil Horman
Quoted 7 lines · Ferruh Yigit
Quoted 6 lines · Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>

<...>

Quoted 1 line
Quoted 1 line
Quoted 1 line

automatically marked as ``experimental`` to allow for a period of stabilization>>> before they become part of a tracked ABI.

Full sentences for above statement:
"
Since changes to APIs are most likely immediately after their introduction, as users begin to take advantage of those new APIs and start finding issues with them, new DPDK APIs will be automatically marked as experimental to allow for a period of stabilization before they become part of a tracked ABI. "

Quoted 5 lines

This part is not related to this patchset, but it will be hard to maintain above behavior, "automatically marked" is not automatic now and moving them to stable after one release is also not automatic. Do you have any suggestion on how to manage this, do you think can your script be expanded to cover these checks?

I would make the argument that this was never the case, but rather a statement of principle. I assert that because I can find no mechanism anywhere in our build system that 'automatically' documented or marked a new API as experimental (please correct me if I'm wrong here). I think this was more meant to be a directive to developers to do whatever coding was needed to preform such marking/documentation in whatever style/format was current. E.g. introducers of a new API should document everything as EXPERIMENTAL using the appropriate doxygen tag and version map tag.

In answer to your question, While we might be able to expand my script to check for new API's and ensure they are marked as experimental, I don't think thats the right place to do it, because that script is run at build time, where the state of the tree is transient. A better place to do it would be with a git hook at checkin time, or in the checkpatch script to flag new apis as experimental right before those new API's are comitted. Though I'm not a huge fan of that either (at least not of the former suggestion). I say that because I think we need to allow developers the freedom to determine the supported status of any new API that they add. For example, it seems pretty clear that a new library might want to have its entire API marked as experimental, but someone adding a single new function to an existing API might be confident that the new function is needed and should be immediately supported..

I think the better solution is to define the use of the EXPERIMENTAL tag in the version map as the canonical location to define unstable API functions. Doing so immediately commits an author to ensuring that the corresponding function definitions are marked with the __experimental tags, which in turn will cause any downstream users to be alerted to the fact that they might be using those API's in their code, so they can take appropriate action. It still allows for the Documentation to be out of sync, but alerting authors doing development I think is the more important element here, as Documentation can be corrected more easily than code in the field.

Quoted 6 lines
Quoted 1 line

Thoughts?

After this point agree to using EXPERIMENTAL tag in the version map as standard, but it will be hard to maintain "API is experimental for first release" without help of any automated tool.

I completely agree, in fact I would say it is impossible to do without tooling, with or without this change. I think we need to do 1 of 2 things:

1) Add some code to checkpatch.pl to put up a warning if any new apis are added without marking them as experimental

2) Change the documentation to be a suggestion rather than a requirement.

I'll look into doing (1), but I'm wondering if (2) is the more flexible way to go. I'm hesitant to enforce the initial marking of new APIs as experimental. Thoughts?

Neil

#62 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

13/01/2018 01:28, Neil Horman:

Quoted 8 lines · Ferruh Yigit
Quoted 4 lines

After this point agree to using EXPERIMENTAL tag in the version map as standard, but it will be hard to maintain "API is experimental for first release" without help of any automated tool.

I completely agree, in fact I would say it is impossible to do without tooling, with or without this change. I think we need to do 1 of 2 things:

Quoted 8 lines

1) Add some code to checkpatch.pl to put up a warning if any new apis are added without marking them as experimental

2) Change the documentation to be a suggestion rather than a requirement.

I'll look into doing (1), but I'm wondering if (2) is the more flexible way to go. I'm hesitant to enforce the initial marking of new APIs as experimental. Thoughts?

There will be always cases where we are sure that the experimental step is not needed.
Even if it is required and checked by a tool, we can ignore it, right? However, there is no big benefit of bypassing the experimental step.

I am for making mandatory the new API as experimental. We will handle the exceptions case by case if any.

#63 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

Quoted 18 lines · Thomas Monjalon

13/01/2018 01:28, Neil Horman:

Quoted 8 lines · Ferruh Yigit
Quoted 4 lines

After this point agree to using EXPERIMENTAL tag in the version map as standard, but it will be hard to maintain "API is experimental for first release" without help of any automated tool.

I completely agree, in fact I would say it is impossible to do without tooling, with or without this change. I think we need to do 1 of 2 things:

Quoted 8 lines

1) Add some code to checkpatch.pl to put up a warning if any new apis are added without marking them as experimental

2) Change the documentation to be a suggestion rather than a requirement.

I'll look into doing (1), but I'm wondering if (2) is the more flexible way to go. I'm hesitant to enforce the initial marking of new APIs as experimental. Thoughts?

Quoted 8 lines

There will be always cases where we are sure that the experimental step is not needed.
Even if it is required and checked by a tool, we can ignore it, right? However, there is no big benefit of bypassing the experimental step.

I am for making mandatory the new API as experimental. We will handle the exceptions case by case if any.

If the consensus is to require experimental marking by default, and grant exceptions as needed, then I would strongly suggest that we do this in checkpatch as I can modify it to warn people of added API's (which will be reflected in the CI tool, if the CI group is still maintaining it), but we can collectively ignore it if its so clearly trivial that it requires no experimental addition (which I think may freqently be the case).

I'll start work on that on monday

Best
Neil

#64 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

14/01/2018 15:36, Neil Horman:

Quoted 27 lines · Thomas Monjalon
Quoted 18 lines

13/01/2018 01:28, Neil Horman:

Quoted 8 lines · Ferruh Yigit
Quoted 4 lines

After this point agree to using EXPERIMENTAL tag in the version map as standard, but it will be hard to maintain "API is experimental for first release" without help of any automated tool.

I completely agree, in fact I would say it is impossible to do without tooling, with or without this change. I think we need to do 1 of 2 things:

Quoted 8 lines

1) Add some code to checkpatch.pl to put up a warning if any new apis are added without marking them as experimental

2) Change the documentation to be a suggestion rather than a requirement.

I'll look into doing (1), but I'm wondering if (2) is the more flexible way to go. I'm hesitant to enforce the initial marking of new APIs as experimental. Thoughts?

Quoted 8 lines

There will be always cases where we are sure that the experimental step is not needed.
Even if it is required and checked by a tool, we can ignore it, right? However, there is no big benefit of bypassing the experimental step.

I am for making mandatory the new API as experimental. We will handle the exceptions case by case if any.

Quoted 6 lines

If the consensus is to require experimental marking by default, and grant exceptions as needed, then I would strongly suggest that we do this in checkpatch as I can modify it to warn people of added API's (which will be reflected in the CI tool, if the CI group is still maintaining it), but we can collectively ignore it if its so clearly trivial that it requires no experimental addition (which I think may freqently be the case).

I am OK with this approach.

Quoted 1 line

I'll start work on that on monday

Good

I wonder how difficult it can be to implement.
Note: we do not maintain a fork of checkpatch.pl. We just have a shell wrapper checkpatch.sh.

Maybe you should start a different tool. Can it use Coccinelle?

#65 lore raw

Re: [PATCHv4 5/5] doc: Add ABI __experimental tag documentation

In reply to Neil Horman

13/12/2017 16:17, Neil Horman:

doc/guides/contributing/versioning.rst those new APIs and start finding issues with them, new DPDK APIs will be · line 60

Quoted 10 lines
doc/guides/contributing/versioning.rst +8 -0
+Note that marking an API as experimental is a two step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __experimental tag (see rte_compat.h).  The DPDK build makefiles
+preform a check to ensure that the map file and the C code reflect the same
+list of symbols.

Thanks for this text.

Bruce already commented about the type "preform".

Ferruh already commented about adding a string in doxygen header.

Ferruh already commented about adding sentences for new API.

I add that it would be the right place to explain the effect of the attribute, and how it can be disabled at compilation.

#66 lore raw
In reply to Neil Horman
Quoted 53 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

Quoted 9 lines

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

v4)
* Added documentation patch to contributors guide

Series Acked-by: Bruce Richardson <[email protected]>

#67 lore raw
In reply to Neil Horman
Quoted 53 lines · Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued warnings/errors without need

Quoted 10 lines

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in CFLAGS rather than a makefile variable. This is more flexible in that it allows us to suppress this specific feature rather than all uses of the deprecated attribute, as we might use it for other features in the furute

v4)
* Added documentation patch to contributors guide

Ping, can I get some more reviews/acks here please?

Neil

Acked-by on the v4 series
#68 lore raw
In reply to Neil Horman
Quoted 89 lines · Neil Horman

Hey all-
        A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe
because they were part of the EXPERIMENTAL api set.  John M. asked me then what
I might do to improve the situation, and the following patch set is a proposal
that I've come up with.

        In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code.  That is to say,
when reviewing patches, it would be nice to have some sort of visual reference
that indicates that the changes being made are part of an experimental API and
therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that
they can make a more informed decision about the API's they consume in their
application.  We make an effort to document all the experimental API's, but
there is no guarantee that a user will check the documentation before making use
of a new library.

This patch set attempts to achieve both of the above goals.  To do this I've
added an __experimental macro tag, suitable for inserting into api forward
declarations and definitions.

The presence of the tag in the header and c files where the api code resides
increases the likelyhood that any patch submitted against them will include the
tag in the context, making it clear to reviewers that ABI stability isn't a
concern here.

Also, This tag marks each function it is used on with an attibute causing any
use of the fuction to emit a warning during the build with a message indicating that the API call in question is not yet part of the
stable interface.  Developers can then make an informed decision to suppress
that warning or not.

Because there is internal use of several experimental API's, this set also
includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically
suprress these warnings.  I think its fair to assume that, for internal use, we
almost always want to suppress these warnings, as by definition any change to
the apis (even their removal) must be done in parallel with an appropriate
change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued
  warnings/errors without need

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in
  CFLAGS rather than a makefile variable.  This is more flexible in that it
  allows us to suppress this specific feature rather than all uses of the
  deprecated attribute, as we might use it for other features in the furute

Quoted 2 lines

v4)
* Added documentation patch to contributors guide

I really like the idea of showing warnings at build time for users of the libraries, in fact I like it so much I'm going to shamelessly steal it for another few projects I work on where we have an experimental (DRAFT) api system :-)

Signature · 2 lines
Kind regards,
Luca Boccassi
#69 lore raw
Quoted 93 lines · Luca Boccassi
Quoted 89 lines · Neil Horman

Hey all-
        A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe
because they were part of the EXPERIMENTAL api set.  John M. asked me then what
I might do to improve the situation, and the following patch set is a proposal
that I've come up with.

        In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code.  That is to say,
when reviewing patches, it would be nice to have some sort of visual reference
that indicates that the changes being made are part of an experimental API and
therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that
they can make a more informed decision about the API's they consume in their
application.  We make an effort to document all the experimental API's, but
there is no guarantee that a user will check the documentation before making use
of a new library.

This patch set attempts to achieve both of the above goals.  To do this I've
added an __experimental macro tag, suitable for inserting into api forward
declarations and definitions.

The presence of the tag in the header and c files where the api code resides
increases the likelyhood that any patch submitted against them will include the
tag in the context, making it clear to reviewers that ABI stability isn't a
concern here.

Also, This tag marks each function it is used on with an attibute causing any
use of the fuction to emit a warning during the build with a message indicating that the API call in question is not yet part of the
stable interface.  Developers can then make an informed decision to suppress
that warning or not.

Because there is internal use of several experimental API's, this set also
includes a new override macro ALLOW_EXPERIMENTAL_APIS to automatically
suprress these warnings.  I think its fair to assume that, for internal use, we
almost always want to suppress these warnings, as by definition any change to
the apis (even their removal) must be done in parallel with an appropriate
change in the calling locations, lest the dpdk build itself break.

Neil

---
Change Notes:
v2)
* Cleaned up checkpatch errors
* Added Allowance for building experimental on BSD
* Swapped Patch 3 and 4 so that we didn't have a commit level that issued
  warnings/errors without need

v3)
* On suggestion from Bruce, modify ALLOW_EXPERIMENTAL_APIS to be defined in
  CFLAGS rather than a makefile variable.  This is more flexible in that it
  allows us to suppress this specific feature rather than all uses of the
  deprecated attribute, as we might use it for other features in the furute

Quoted 2 lines

v4)
* Added documentation patch to contributors guide

Quoted 7 lines

I really like the idea of showing warnings at build time for users of the libraries, in fact I like it so much I'm going to shamelessly steal it for another few projects I work on where we have an experimental (DRAFT) api system :-)

You're welcome to it :)
Neil

#70 lore raw

cover dpdk: enhance EXPERIMENTAL api tagging

In reply to Neil Horman

Hey all-
A few days ago, I was lamenting the fact that, when reviewing patches I
would frequently complain about ABI changes that were actually considered safe because they were part of the EXPERIMENTAL api set. John M. asked me then what I might do to improve the situation, and the following patch set is a proposal that I've come up with.

In thinking about the problem I identified two issues that I think we
can improve on in this area:

1) Make experimental api calls more visible in the source code. That is to say, when reviewing patches, it would be nice to have some sort of visual reference that indicates that the changes being made are part of an experimental API and therefore ABI concerns need not be addressed

2) Make experimenal api usage more visible to consumers of the DPDK, so that they can make a more informed decision about the API's they consume in their application. We make an effort to document all the experimental API's, but there is no guarantee that a user will check the documentation before making use of a new library.

This patch set attempts to achieve both of the above goals. To do this I've added an __experimental macro tag, suitable for inserting into api forward declarations and definitions.

The presence of the tag in the header and c files where the api code resides increases the likelyhood that any patch submitted against them will include the tag in the context, making it clear to reviewers that ABI stability isn't a concern here.

Also, This tag marks each function it is used on with an attibute causing any use of the fuction to emit a warning during the build
with a message indicating that the API call in question is not yet part of the stable interface. Developers can then make an informed decision to suppress that warning or not.

Because there is internal use of several experimental API's, this set also includes a new override macro ALLOW_EXPERIMENTAL_API to automatically suprress these warnings. I think its fair to assume that, for internal use, we almost always want to suppress these warnings, as by definition any change to the apis (even their removal) must be done in parallel with an appropriate change in the calling locations, lest the dpdk build itself break.

Neil

---
v5 Changes
* Clean ups suggested by Thomas

#71 lore raw

PATCH v5 1/1 1/5] buildtools: Add tool to check EXPERIMENTAL api exports

This tools reads the given version map for a directory, and checks to ensure that, for each symbol listed in the export list, the corresponding definition is tagged as __rte_experimental, erroring out if its not. In this way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 MAINTAINERS                           |  1 +
 buildtools/check-experimental-syms.sh | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100755 buildtools/check-experimental-syms.sh
MAINTAINERS +1 -0
index b51c2d096..446d2545d 100644
@@ -77,6 +77,7 @@ M: Neil Horman <[email protected]>
 F: lib/librte_compat/
 F: doc/guides/rel_notes/deprecation.rst
 F: devtools/validate-abi.sh
+F: buildtools/check-experimental-syms.sh
 
 Driver information
 F: buildtools/pmdinfogen/
buildtools/check-experimental-syms.sh new file +32 -0
new file mode 100755
index 000000000..7d21de35c
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: BSD-3-Clause
+
+MAPFILE=$1
+OBJFILE=$2
+
+if [ -d $MAPFILE ]
+then
+	exit 0
+fi
+
+for i in `awk 'BEGIN {found=0}
+		/.*EXPERIMENTAL.*/ {found=1}
+		/.*}.*;/ {found=0}
+		/.*;/ {if (found == 1) print $1}' $MAPFILE`
+do
+	SYM=`echo $i | sed -e"s/;//"`
+	objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+	IN_TEXT=$?
+	objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+	IN_EXP=$?
+	if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
+	then
+		echo "$SYM is not flagged as experimental"
+		echo "but is listed in version map"
+		echo "Please add __rte_experimental to the definition of $SYM"
+		exit 1
+	fi
+done
+exit 0
+
Signature · 1 line
2.14.3
#72 lore raw

PATCH v5 1/1 5/5] doc: Add ABI __experimental tag documentation

In reply to Neil Horman

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 doc/guides/contributing/versioning.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
doc/guides/contributing/versioning.rst +14 -0
index 400090628..b4de9ed04 100644
@@ -50,6 +50,20 @@ those new APIs and start finding issues with them, new DPDK APIs will be
 automatically marked as ``experimental`` to allow for a period of stabilization
 before they become part of a tracked ABI.
 
+Note that marking an API as experimental is a multi step process.  To mark an API
+as experimental, the symbols which are desired to be exported must be placed in
+an EXPERIMENTAL version block in the corresponding libraries' version map
+script. Secondly, the corresponding definitions of those exported functions, and
+their forward declarations (in the development header files), must be marked
+with the __rte_experimental tag (see rte_compat.h).  The DPDK build makefiles
+perform a check to ensure that the map file and the C code reflect the same
+list of symbols.  This check can be circumvented by defining
+ALLOW_EXPERIMENTAL_API during compilation in the corresponding library Makefile.
+
+In addition to tagging the code with __rte_experimental, the
+doxygen markup must also contain the EXPERIMENTAL string, and the MAINTAINER
+file should note that the library contains EXPERIMENTAL APIs.
+
 ABI versions, once released, are available until such time as their
 deprecation has been noted in the Release Notes for at least one major release
 cycle. For example consider the case where the ABI for DPDK 2.0 has been
Signature · 1 line
2.14.3
Acked-by on v5 1/1
#73 lore raw

Re: [[PATCH v5] 5/5] doc: Add ABI __experimental tag documentation

Quoted 35 lines

-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Monday, January 22, 2018 1:48 AM
To: [email protected]
Cc: Neil Horman <[email protected]>; Thomas Monjalon <[email protected]>; Mcnamara, John <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [[PATCH v5] 5/5] doc: Add ABI __experimental tag documentation

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>

...

(quoted diff) +9 -0
+Note that marking an API as experimental is a multi step process.  To
+mark an API as experimental, the symbols which are desired to be
+exported must be placed in an EXPERIMENTAL version block in the
+corresponding libraries' version map script. Secondly, the
+corresponding definitions of those exported functions, and their
+forward declarations (in the development header files), must be marked
+with the __rte_experimental tag (see rte_compat.h).  The DPDK build
+makefiles perform a check to ensure that the map file and the C code
+reflect the same list of symbols.  This check can be circumvented by

defining ALLOW_EXPERIMENTAL_API during compilation in the corresponding library Makefile.

doc/guides/contributing/versioning.rst +5 -0
+
+In addition to tagging the code with __rte_experimental, the doxygen
+markup must also contain the EXPERIMENTAL string, and the MAINTAINER
+file should note that the library contains EXPERIMENTAL APIs.
+
 ABI versions, once released, are available until such time as their
Quoted 5 lines

deprecation has been noted in the Release Notes for at least one major release cycle. For example consider the case where the ABI for DPDK 2.0 has been
--
2.14.3

Thanks for the update, and this work in general.

The rendered docs would probably look a better better with __rte_experimental and ALLOW_EXPERIMENTAL_API is fixed width backticks ``var`` but that is only a "nice to have" so no need for a respin.

#74 lore raw

Re: [[PATCH v5] 5/5] doc: Add ABI __experimental tag documentation

23/01/2018 11:35, Mcnamara, John:

Quoted 42 lines
Quoted 34 lines

-----Original Message-----
From: Neil Horman [mailto:[email protected]]
Sent: Monday, January 22, 2018 1:48 AM
To: [email protected]
Cc: Neil Horman <[email protected]>; Thomas Monjalon <[email protected]>; Mcnamara, John <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [[PATCH v5] 5/5] doc: Add ABI __experimental tag documentation

Document the need to add the __experimental tag to appropriate functions

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>

...

(quoted diff) +9 -0
+Note that marking an API as experimental is a multi step process.  To
+mark an API as experimental, the symbols which are desired to be
+exported must be placed in an EXPERIMENTAL version block in the
+corresponding libraries' version map script. Secondly, the
+corresponding definitions of those exported functions, and their
+forward declarations (in the development header files), must be marked
+with the __rte_experimental tag (see rte_compat.h).  The DPDK build
+makefiles perform a check to ensure that the map file and the C code
+reflect the same list of symbols.  This check can be circumvented by

defining ALLOW_EXPERIMENTAL_API during compilation in the corresponding library Makefile.

doc/guides/contributing/versioning.rst +5 -0
+
+In addition to tagging the code with __rte_experimental, the doxygen
+markup must also contain the EXPERIMENTAL string, and the MAINTAINER
+file should note that the library contains EXPERIMENTAL APIs.
+
 ABI versions, once released, are available until such time as their
Quoted 5 lines

deprecation has been noted in the Release Notes for at least one major release cycle. For example consider the case where the ABI for DPDK 2.0 has been
--
2.14.3

Thanks for the update, and this work in general.

Quoted 3 lines

The rendered docs would probably look a better better with __rte_experimental and ALLOW_EXPERIMENTAL_API is fixed width backticks ``var`` but that is only a "nice to have" so no need for a respin.

Backticks added on apply.

Also changed the last sentence from
the MAINTAINER file should note that the library contains EXPERIMENTAL APIs.
to
the MAINTAINERS file should note the EXPERIMENTAL libraries.
Indeed, the practice is to note only new libraries as experimental in the MAINTAINERS files.

#75 lore raw

PATCH v5 1/1 2/5] compat: Add __rte_experimental macro

In reply to Neil Horman

The __rte_experimental macro tags a given exported function as being part of the EXPERIMENTAL api. Use of this tag will cause any caller of the function (that isn't removed by dead code elimination) to emit a warning that the user is making use of an API whos stabilty isn't guaranteed. It also places the function in the .text.experimental section, which is used to validate the tag against the corresponding library version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 lib/librte_compat/rte_compat.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
lib/librte_compat/rte_compat.h +11 -0
index 41e8032ba..ad8f81ffe 100644
@@ -101,5 +101,16 @@
  */
 #endif
 
+#ifndef ALLOW_EXPERIMENTAL_API
 
+#define __rte_experimental \
+__attribute__((deprecated("Symbol is not yet part of stable ABI"), \
+section(".text.experimental")))
+
+#else
+
+#define __rte_experimental \
+__attribute__((section(".text.experimental")))
+
+#endif
 #endif /* _RTE_COMPAT_H_ */
Signature · 1 line
2.14.3
#76 lore raw

PATCH v5 1/1 3/5] Makefiles: Add experimental tag check and warnings to trigger on use

In reply to Neil Horman

Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 app/test-eventdev/Makefile                 | 1 +
 app/test-pmd/Makefile                      | 1 +
 drivers/event/sw/Makefile                  | 1 +
 drivers/net/failsafe/Makefile              | 1 +
 drivers/net/ixgbe/Makefile                 | 1 +
 examples/eventdev_pipeline_sw_pmd/Makefile | 1 +
 examples/flow_classify/Makefile            | 1 +
 examples/ipsec-secgw/Makefile              | 1 +
 examples/service_cores/Makefile            | 1 +
 lib/librte_eal/bsdapp/eal/Makefile         | 1 +
 lib/librte_eal/linuxapp/Makefile           | 2 ++
 lib/librte_eal/linuxapp/eal/Makefile       | 2 ++
 lib/librte_eventdev/Makefile               | 1 +
 lib/librte_security/Makefile               | 1 +
 mk/internal/rte.compile-pre.mk             | 4 ++++
 mk/toolchain/clang/rte.vars.mk             | 2 +-
 mk/toolchain/gcc/rte.vars.mk               | 2 +-
 mk/toolchain/icc/rte.vars.mk               | 2 +-
 18 files changed, 23 insertions(+), 3 deletions(-)
app/test-eventdev/Makefile +1 -0
index cfe567a6d..2a9cc1fb1 100644
@@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 APP = dpdk-test-eventdev
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
app/test-pmd/Makefile +1 -0
index 82b3481c0..ce4e578fe 100644
@@ -10,6 +10,7 @@ ifeq ($(CONFIG_RTE_TEST_PMD),y)
 #
 APP = testpmd
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
drivers/event/sw/Makefile +1 -0
index 0ff9a7f28..6c38bf6f6 100644
@@ -7,6 +7,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_pmd_sw_event.a
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 # for older GCC versions, allow us to initialize an event using
drivers/net/failsafe/Makefile +1 -0
index ea2a8fe46..a3b8173aa 100644
@@ -50,6 +50,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_flow.c
 # No exported include files
 
 # Basic CFLAGS:
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -std=gnu99 -Wextra
 CFLAGS += -O3
 CFLAGS += -I.
drivers/net/ixgbe/Makefile +1 -0
index 9efa5a40c..d0804fc5b 100644
@@ -8,6 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 #
 LIB = librte_pmd_ixgbe.a
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/eventdev_pipeline_sw_pmd/Makefile +1 -0
index 241d0c141..66914f633 100644
@@ -16,6 +16,7 @@ APP = eventdev_pipeline_sw_pmd
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/flow_classify/Makefile +1 -0
index 56062486f..a00b75eff 100644
@@ -17,6 +17,7 @@ APP = flow_classify
 # all source are stored in SRCS-y
 SRCS-y := flow_classify.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
examples/ipsec-secgw/Makefile +1 -0
index 9b7bacb3e..c4d07cc9d 100644
@@ -18,6 +18,7 @@ endif
 
 APP = ipsec-secgw
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3 -gdwarf-2
 CFLAGS += $(WERROR_FLAGS)
 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
examples/service_cores/Makefile +1 -0
index 2dc36134b..4f79c9776 100644
@@ -16,6 +16,7 @@ APP = service_cores
 # all source are stored in SRCS-y
 SRCS-y := main.c
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS)
 
 # workaround for a gcc bug with noreturn attribute
lib/librte_eal/bsdapp/eal/Makefile +1 -0
index 3c3407b78..5e6ae5da3 100644
@@ -9,6 +9,7 @@ ARCH_DIR ?= $(RTE_ARCH)
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -I$(SRCDIR)/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
lib/librte_eal/linuxapp/Makefile +2 -0
index 7e94e914a..aa52a01ee 100644
@@ -8,4 +8,6 @@ DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio
 DIRS-$(CONFIG_RTE_KNI_KMOD) += kni
 DEPDIRS-kni := eal
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+
 include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 588c0bdfb..87c1db1f0 100644
@@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_eal.a
 
 ARCH_DIR ?= $(RTE_ARCH)
+
 EXPORT_MAP := ../../rte_eal_version.map
 VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR)
 
@@ -13,6 +14,7 @@ LIBABIVER := 6
 
 VPATH += $(RTE_SDK)/lib/librte_eal/common
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -I$(SRCDIR)/include
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
lib/librte_eventdev/Makefile +1 -0
index 7fd78c7fd..d27dd0707 100644
@@ -11,6 +11,7 @@ LIB = librte_eventdev.a
 LIBABIVER := 3
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_ring -lrte_ethdev -lrte_hash
lib/librte_security/Makefile +1 -0
index bd92343bd..8daebea46 100644
@@ -10,6 +10,7 @@ LIB = librte_security.a
 LIBABIVER := 1
 
 # build flags
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_mempool
mk/internal/rte.compile-pre.mk +4 -0
index d1dd6df02..a734cbbd0 100644
@@ -56,6 +56,9 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \
 C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight
 C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)","  CC $(@)")
 endif
+EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/check-experimental-syms.sh
+CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@
+
 PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ [email protected]
 PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o [email protected] [email protected]
 PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o [email protected] [email protected] $@
@@ -72,6 +75,7 @@ C_TO_O_DO = @set -e; \
 	echo $(C_TO_O_DISP); \
 	$(C_TO_O) && \
 	$(PMDINFO_TO_O) && \
+	$(CHECK_EXPERIMENTAL) && \
 	echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \
 	sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \
 	rm -f $(call obj2dep,$(@)).tmp
mk/toolchain/clang/rte.vars.mk +1 -1
index 52ca9fca3..3c49dc568 100644
@@ -39,7 +39,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/gcc/rte.vars.mk +1 -1
index 7763ba79b..7e4531bab 100644
@@ -47,7 +47,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror
mk/toolchain/icc/rte.vars.mk +1 -1
index ff338d661..aa1422bf1 100644
@@ -45,7 +45,7 @@ TOOLCHAIN_ASFLAGS =
 WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478
 WERROR_FLAGS += -diag-disable 13368 -diag-disable 15527
 WERROR_FLAGS += -diag-disable 188
-WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076
+WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 -Wdeprecated
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror-all
Signature · 1 line
2.14.3
#77 lore raw

PATCH v5 1/1 4/5] dpdk: add __rte_experimental tag to appropriate api calls

In reply to Neil Horman

Append the __rte_experimental tag to api calls appearing in the EXPERIMENTAL section of their libraries version map

CC Thomas Monjalon <[email protected]>
CC "Mcnamara, John" <[email protected]>
CC Bruce Richardson <[email protected]>
---
 lib/librte_eal/common/eal_common_dev.c             |  6 ++-
 lib/librte_eal/common/eal_common_devargs.c         |  7 +--
 lib/librte_eal/common/include/rte_dev.h            |  6 ++-
 lib/librte_eal/common/include/rte_devargs.h        |  8 ++--
 lib/librte_eal/common/include/rte_service.h        | 47 ++++++++++---------
 .../common/include/rte_service_component.h         | 14 +++---
 lib/librte_eal/common/rte_service.c                | 52 ++++++++++++----------
 lib/librte_eal/linuxapp/eal/eal.c                  |  1 +
 lib/librte_ether/rte_mtr.c                         | 25 ++++++-----
 lib/librte_ether/rte_mtr.h                         | 26 +++++------
 lib/librte_flow_classify/rte_flow_classify.c       | 13 +++---
 lib/librte_flow_classify/rte_flow_classify.h       | 11 ++---
 lib/librte_security/rte_security.c                 | 16 +++----
 lib/librte_security/rte_security.h                 | 23 +++++-----
 14 files changed, 139 insertions(+), 116 deletions(-)
lib/librte_eal/common/eal_common_dev.c +4 -2
index dda8f5835..0de1c5d62 100644
@@ -37,6 +37,7 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
@@ -133,7 +134,7 @@ full_dev_name(const char *bus, const char *dev, const char *args)
 	return name;
 }
 
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs)
 {
 	struct rte_bus *bus;
@@ -203,7 +204,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
 	return ret;
 }
 
-int rte_eal_hotplug_remove(const char *busname, const char *devname)
+int __rte_experimental
+rte_eal_hotplug_remove(const char *busname, const char *devname)
 {
 	struct rte_bus *bus;
 	struct rte_device *dev;
lib/librte_eal/common/eal_common_devargs.c +4 -3
index 6ac88d6ab..3db07ee99 100644
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_tailq.h>
@@ -85,7 +86,7 @@ bus_name_cmp(const struct rte_bus *bus, const void *name)
 	return strncmp(bus->name, name, strlen(bus->name));
 }
 
-int
+int __rte_experimental
 rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 {
 	struct rte_bus *bus = NULL;
@@ -139,7 +140,7 @@ rte_eal_devargs_parse(const char *dev, struct rte_devargs *da)
 	return 0;
 }
 
-int
+int __rte_experimental
 rte_eal_devargs_insert(struct rte_devargs *da)
 {
 	int ret;
@@ -188,7 +189,7 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)
 	return -1;
 }
 
-int
+int __rte_experimental
 rte_eal_devargs_remove(const char *busname, const char *devname)
 {
 	struct rte_devargs *d;
lib/librte_eal/common/include/rte_dev.h +4 -2
index 9342e0cbd..9fee224f2 100644
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_compat.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -209,7 +210,7 @@ int rte_eal_dev_detach(struct rte_device *dev);
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_add(const char *busname, const char *devname,
+int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devname,
 			const char *devargs);
 
 /**
@@ -225,7 +226,8 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_hotplug_remove(const char *busname, const char *devname);
+int __rte_experimental rte_eal_hotplug_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Device comparison function.
lib/librte_eal/common/include/rte_devargs.h +5 -3
index 58d585df6..e7579f82a 100644
@@ -50,6 +50,7 @@ extern "C" {
 
 #include <stdio.h>
 #include <sys/queue.h>
+#include <rte_compat.h>
 #include <rte_bus.h>
 
 /**
@@ -136,7 +137,7 @@ int rte_eal_parse_devargs_str(const char *devargs_str,
  *   - 0 on success.
  *   - Negative errno on error.
  */
-int
+int __rte_experimental
 rte_eal_devargs_parse(const char *dev,
 		      struct rte_devargs *da);
 
@@ -150,7 +151,7 @@ rte_eal_devargs_parse(const char *dev,
  *   - 0 on success
  *   - Negative on error.
  */
-int
+int __rte_experimental
 rte_eal_devargs_insert(struct rte_devargs *da);
 
 /**
@@ -193,7 +194,8 @@ int rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str);
  *   <0 on error.
  *   >0 if the devargs was not within the user device list.
  */
-int rte_eal_devargs_remove(const char *busname, const char *devname);
+int __rte_experimental rte_eal_devargs_remove(const char *busname,
+					  const char *devname);
 
 /**
  * Count the number of user devices of a specified type
lib/librte_eal/common/include/rte_service.h +26 -21

167 lines not on this page · raw message

lib/librte_eal/common/include/rte_service_component.h +8 -6
index 849c71d4a..1fe44f172 100644
@@ -9,7 +9,7 @@
  * Include this file if you are writing a component that requires CPU cycles to
  * operate, and you wish to run the component using service cores
  */
-
+#include <rte_compat.h>
 #include <rte_service.h>
 
 /**
@@ -73,8 +73,9 @@ struct rte_service_spec {
  *         -EINVAL Attempted to register an invalid service (eg, no callback
  *         set)
  */
-int32_t rte_service_component_register(const struct rte_service_spec *spec,
-				       uint32_t *service_id);
+int32_t __rte_experimental
+rte_service_component_register(const struct rte_service_spec *spec,
+			       uint32_t *service_id);
 
 /**
  * @warning
@@ -88,7 +89,7 @@ int32_t rte_service_component_register(const struct rte_service_spec *spec,
  * @retval -EBUSY The service is currently running, stop the service before
  *          calling unregister. No action has been taken.
  */
-int32_t rte_service_component_unregister(uint32_t id);
+int32_t __rte_experimental rte_service_component_unregister(uint32_t id);
 
 /**
  * @warning
@@ -106,7 +107,7 @@ int32_t rte_service_component_unregister(uint32_t id);
  * @retval -ENODEV Error in enabling service lcore on a service
  * @retval -ENOEXEC Error when starting services
  */
-int32_t rte_service_start_with_defaults(void);
+int32_t __rte_experimental rte_service_start_with_defaults(void);
 
 /**
  * @warning
@@ -123,7 +124,8 @@ int32_t rte_service_start_with_defaults(void);
  *
  * @retval 0 Success
  */
-int32_t rte_service_component_runstate_set(uint32_t id, uint32_t runstate);
+int32_t __rte_experimental rte_service_component_runstate_set(uint32_t id,
+							  uint32_t runstate);
 
 /**
  * @warning
lib/librte_eal/common/rte_service.c +28 -24

201 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal.c +1 -0
index 229eec9f1..73a0da22c 100644
@@ -53,6 +53,7 @@
 #include <sys/io.h>
 #endif
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
lib/librte_ether/rte_mtr.c +13 -12
index a80f19a5b..1046cb5fd 100644
@@ -5,6 +5,7 @@
 #include <stdint.h>
 
 #include <rte_errno.h>
+#include "rte_compat.h"
 #include "rte_ethdev.h"
 #include "rte_mtr_driver.h"
 #include "rte_mtr.h"
@@ -57,7 +58,7 @@ rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error)
 })
 
 /* MTR capabilities get */
-int
+int __rte_experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error)
@@ -68,7 +69,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
 }
 
 /* MTR meter profile add */
-int
+int __rte_experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -80,7 +81,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
 }
 
 /** MTR meter profile delete */
-int
+int __rte_experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error)
@@ -91,7 +92,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
 }
 
 /** MTR object create */
-int
+int __rte_experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -104,7 +105,7 @@ rte_mtr_create(uint16_t port_id,
 }
 
 /** MTR object destroy */
-int
+int __rte_experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -115,7 +116,7 @@ rte_mtr_destroy(uint16_t port_id,
 }
 
 /** MTR object meter enable */
-int
+int __rte_experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -126,7 +127,7 @@ rte_mtr_meter_enable(uint16_t port_id,
 }
 
 /** MTR object meter disable */
-int
+int __rte_experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error)
@@ -137,7 +138,7 @@ rte_mtr_meter_disable(uint16_t port_id,
 }
 
 /** MTR object meter profile update */
-int
+int __rte_experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -149,7 +150,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
 }
 
 /** MTR object meter DSCP table update */
-int
+int __rte_experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -161,7 +162,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
 }
 
 /** MTR object policer action update */
-int
+int __rte_experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -174,7 +175,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
 }
 
 /** MTR object enabled stats update */
-int
+int __rte_experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -186,7 +187,7 @@ rte_mtr_stats_update(uint16_t port_id,
 }
 
 /** MTR object stats read */
-int
+int __rte_experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_ether/rte_mtr.h +13 -13
index f6b6ef3b6..c4819b274 100644
@@ -74,7 +74,7 @@
  * @b EXPERIMENTAL: this API may change without prior notice
  */
 #include <stdint.h>
-
+#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
@@ -447,7 +447,7 @@ struct rte_mtr_error {
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_capabilities_get(uint16_t port_id,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error);
@@ -470,7 +470,7 @@ rte_mtr_capabilities_get(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_meter_profile_add(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_meter_profile *profile,
@@ -491,7 +491,7 @@ rte_mtr_meter_profile_add(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_meter_profile_delete(uint16_t port_id,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error);
@@ -519,7 +519,7 @@ rte_mtr_meter_profile_delete(uint16_t port_id,
  *
  * @see enum rte_flow_action_type::RTE_FLOW_ACTION_TYPE_METER
  */
-int
+int __rte_experimental
 rte_mtr_create(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_params *params,
@@ -542,7 +542,7 @@ rte_mtr_create(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_destroy(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -569,7 +569,7 @@ rte_mtr_destroy(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_meter_disable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -590,7 +590,7 @@ rte_mtr_meter_disable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_meter_enable(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error);
@@ -609,7 +609,7 @@ rte_mtr_meter_enable(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_meter_profile_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t meter_profile_id,
@@ -633,7 +633,7 @@ rte_mtr_meter_profile_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_meter_dscp_table_update(uint16_t port_id,
 	uint32_t mtr_id,
 	enum rte_mtr_color *dscp_table,
@@ -659,7 +659,7 @@ rte_mtr_meter_dscp_table_update(uint16_t port_id,
  * @return
  *   0 on success, non-zero error code otherwise.
  */
-int
+int __rte_experimental
 rte_mtr_policer_actions_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint32_t action_mask,
@@ -684,7 +684,7 @@ rte_mtr_policer_actions_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __rte_experimental
 rte_mtr_stats_update(uint16_t port_id,
 	uint32_t mtr_id,
 	uint64_t stats_mask,
@@ -715,7 +715,7 @@ rte_mtr_stats_update(uint16_t port_id,
  *
  * @see enum rte_mtr_stats_type
  */
-int
+int __rte_experimental
 rte_mtr_stats_read(uint16_t port_id,
 	uint32_t mtr_id,
 	struct rte_mtr_stats *stats,
lib/librte_flow_classify/rte_flow_classify.c +7 -6
index 65d0a7514..6a4d1eb3d 100644
@@ -2,6 +2,7 @@
  * Copyright(c) 2017 Intel Corporation
  */
 
+#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
 #include <rte_flow_driver.h>
@@ -216,7 +217,7 @@ rte_flow_classifier_check_params(struct rte_flow_classifier_params *params)
 	return 0;
 }
 
-struct rte_flow_classifier *
+struct rte_flow_classifier * __rte_experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params)
 {
 	struct rte_flow_classifier *cls;
@@ -262,7 +263,7 @@ rte_flow_classify_table_free(struct rte_table *table)
 		table->ops.f_free(table->h_table);
 }
 
-int
+int __rte_experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls)
 {
 	uint32_t i;
@@ -340,7 +341,7 @@ rte_table_check_params(struct rte_flow_classifier *cls,
 	return 0;
 }
 
-int
+int __rte_experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 	struct rte_flow_classify_table_params *params,
 	uint32_t *table_id)
@@ -454,7 +455,7 @@ allocate_acl_ipv4_5tuple_rule(void)
 	return rule;
 }
 
-struct rte_flow_classify_rule *
+struct rte_flow_classify_rule * __rte_experimental
 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		int *key_found,
@@ -553,7 +554,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
 	return rule;
 }
 
-int
+int __rte_experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule)
@@ -630,7 +631,7 @@ action_apply(struct rte_flow_classifier *cls,
 	return ret;
 }
 
-int
+int __rte_experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_flow_classify/rte_flow_classify.h +6 -5
index e5f3e61d9..084cb4fa4 100644
@@ -41,6 +41,7 @@
  *    with rte_flow_classifier_free()
  */
 
+#include <rte_compat.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
@@ -147,7 +148,7 @@ struct rte_flow_classify_ipv4_5tuple_stats {
  * @return
  *   Handle to flow classifier instance on success or NULL otherwise
  */
-struct rte_flow_classifier *
+struct rte_flow_classifier * __rte_experimental
 rte_flow_classifier_create(struct rte_flow_classifier_params *params);
 
 /**
@@ -158,7 +159,7 @@ rte_flow_classifier_create(struct rte_flow_classifier_params *params);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __rte_experimental
 rte_flow_classifier_free(struct rte_flow_classifier *cls);
 
 /**
@@ -174,7 +175,7 @@ rte_flow_classifier_free(struct rte_flow_classifier *cls);
  * @return
  *   0 on success, error code otherwise
  */
-int
+int __rte_experimental
 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
 		struct rte_flow_classify_table_params *params,
 		uint32_t *table_id);
@@ -221,7 +222,7 @@ rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __rte_experimental
 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_flow_classify_rule *rule);
@@ -245,7 +246,7 @@ rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
  * @return
  *   0 on success, error code otherwise.
  */
-int
+int __rte_experimental
 rte_flow_classifier_query(struct rte_flow_classifier *cls,
 		uint32_t table_id,
 		struct rte_mbuf **pkts,
lib/librte_security/rte_security.c +8 -8
index 1227fca8a..0a5409ed8 100644
@@ -33,12 +33,12 @@
 
 #include <rte_malloc.h>
 #include <rte_dev.h>
-
+#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
 struct rte_security_session *
-rte_security_session_create(struct rte_security_ctx *instance,
+__rte_experimental rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
@@ -61,7 +61,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
 	return sess;
 }
 
-int
+int __rte_experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf)
@@ -70,7 +70,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
 	return instance->ops->session_update(instance->device, sess, conf);
 }
 
-int
+int __rte_experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats)
@@ -79,7 +79,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 	return instance->ops->session_stats_get(instance->device, sess, stats);
 }
 
-int
+int __rte_experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess)
 {
@@ -98,7 +98,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
 	return ret;
 }
 
-int
+int __rte_experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *m, void *params)
@@ -108,14 +108,14 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 					       sess, m, params);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __rte_experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance)
 {
 	RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->capabilities_get, NULL);
 	return instance->ops->capabilities_get(instance->device);
 }
 
-const struct rte_security_capability *
+const struct rte_security_capability * __rte_experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx)
 {
lib/librte_security/rte_security.h +12 -11
index 653929b99..9fa8bc3f3 100644
@@ -52,6 +52,7 @@ extern "C" {
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 
+#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_mbuf.h>
@@ -291,7 +292,7 @@ struct rte_security_session {
  *  - On success, pointer to session
  *  - On failure, NULL
  */
-struct rte_security_session *
+struct rte_security_session * __rte_experimental
 rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
@@ -306,7 +307,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  *  - On success returns 0
  *  - On failure return errno
  */
-int
+int __rte_experimental
 rte_security_session_update(struct rte_security_ctx *instance,
 			    struct rte_security_session *sess,
 			    struct rte_security_session_conf *conf);
@@ -323,7 +324,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *  - -EINVAL if session is NULL.
  *  - -EBUSY if not all device private data has been freed.
  */
-int
+int __rte_experimental
 rte_security_session_destroy(struct rte_security_ctx *instance,
 			     struct rte_security_session *sess);
 
@@ -340,7 +341,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance,
  *  - On success, zero.
  *  - On failure, a negative value.
  */
-int
+int __rte_experimental
 rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 			      struct rte_security_session *sess,
 			      struct rte_mbuf *mb, void *params);
@@ -351,7 +352,7 @@ rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  * @param	sym_op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __rte_experimental
 __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 			      struct rte_security_session *sess)
 {
@@ -360,13 +361,13 @@ __rte_security_attach_session(struct rte_crypto_sym_op *sym_op,
 	return 0;
 }
 
-static inline void *
+static inline void * __rte_experimental
 get_sec_session_private_data(const struct rte_security_session *sess)
 {
 	return sess->sess_private_data;
 }
 
-static inline void
+static inline void __rte_experimental
 set_sec_session_private_data(struct rte_security_session *sess,
 			     void *private_data)
 {
@@ -382,7 +383,7 @@ set_sec_session_private_data(struct rte_security_session *sess,
  * @param	op	crypto operation
  * @param	sess	security session
  */
-static inline int
+static inline int __rte_experimental
 rte_security_attach_session(struct rte_crypto_op *op,
 			    struct rte_security_session *sess)
 {
@@ -424,7 +425,7 @@ struct rte_security_stats {
  *  - On success return 0
  *  - On failure errno
  */
-int
+int __rte_experimental
 rte_security_session_stats_get(struct rte_security_ctx *instance,
 			       struct rte_security_session *sess,
 			       struct rte_security_stats *stats);
@@ -507,7 +508,7 @@ struct rte_security_capability_idx {
  *   - Returns array of security capabilities.
  *   - Return NULL if no capabilities available.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __rte_experimental
 rte_security_capabilities_get(struct rte_security_ctx *instance);
 
 /**
@@ -521,7 +522,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *     index criteria.
  *   - Return NULL if the capability not matched on security instance.
  */
-const struct rte_security_capability *
+const struct rte_security_capability * __rte_experimental
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx);
 
Signature · 1 line
2.14.3
#78 lore raw
In reply to Neil Horman

22/01/2018 02:48, Neil Horman:

Quoted 2 lines

v5 Changes
* Clean ups suggested by Thomas

There were a lot of new functions to tag when rebasing this v5. Rebased and applied, thanks.

#79 lore raw
Quoted 7 lines · Thomas Monjalon

22/01/2018 02:48, Neil Horman:

Quoted 2 lines

v5 Changes
* Clean ups suggested by Thomas

There were a lot of new functions to tag when rebasing this v5. Rebased and applied, thanks.

Sorry, not clear what you mean by this. Are you saying that there were several
new experimental API's added recently that my initial set of tags missed? If so, thanks for doing that. I will also be sending another patch set soon, to reconcile API's that are documented as experimental but not listed in the version map as such

Neil

#80 lore raw

30/01/2018 16:54, Neil Horman:

Quoted 5 lines · Thomas Monjalon
Quoted 4 lines

22/01/2018 02:48, Neil Horman:

Quoted 2 lines

v5 Changes
* Clean ups suggested by Thomas

Quoted 8 lines
Quoted 3 lines

There were a lot of new functions to tag when rebasing this v5. Rebased and applied, thanks.

Sorry, not clear what you mean by this. Are you saying that there were several
new experimental API's added recently that my initial set of tags missed? If so, thanks for doing that. I will also be sending another patch set soon, to reconcile API's that are documented as experimental but not listed in the version map as such

I meant that I have applied a lot of new experimental functions after you sent the v5.
So I had to add the tag and CFLAGS for these new functions. Usual rebase work.

About reconciling experimental functions and map,
we should also consider upgrading some functions to non-experimental.

#81 lore raw
Quoted 15 lines · Thomas Monjalon

30/01/2018 16:54, Neil Horman:

Quoted 5 lines · Thomas Monjalon
Quoted 4 lines

22/01/2018 02:48, Neil Horman:

Quoted 2 lines

v5 Changes
* Clean ups suggested by Thomas

Quoted 8 lines
Quoted 3 lines

There were a lot of new functions to tag when rebasing this v5. Rebased and applied, thanks.

Sorry, not clear what you mean by this. Are you saying that there were several
new experimental API's added recently that my initial set of tags missed? If so, thanks for doing that. I will also be sending another patch set soon, to reconcile API's that are documented as experimental but not listed in the version map as such

Quoted 5 lines

I meant that I have applied a lot of new experimental functions after you sent the v5.
So I had to add the tag and CFLAGS for these new functions. Usual rebase work.

Understood, thank you.

Quoted 3 lines

About reconciling experimental functions and map,
we should also consider upgrading some functions to non-experimental.

I figured if I were to just do a reconcilliation of everything that is currently documented as experimental, that would be the impetus for their authors to yell at me about their not actually being experimental anymore, and I could fix that up in subsequent versions :)
Neil

Quoted 2 lines
#82 lore raw

31/01/2018 13:18, Neil Horman:

Quoted 23 lines · Thomas Monjalon
Quoted 15 lines

30/01/2018 16:54, Neil Horman:

Quoted 5 lines · Thomas Monjalon
Quoted 4 lines

22/01/2018 02:48, Neil Horman:

Quoted 2 lines

v5 Changes
* Clean ups suggested by Thomas

Quoted 8 lines
Quoted 3 lines

There were a lot of new functions to tag when rebasing this v5. Rebased and applied, thanks.

Sorry, not clear what you mean by this. Are you saying that there were several
new experimental API's added recently that my initial set of tags missed? If so, thanks for doing that. I will also be sending another patch set soon, to reconcile API's that are documented as experimental but not listed in the version map as such

Quoted 5 lines

I meant that I have applied a lot of new experimental functions after you sent the v5.
So I had to add the tag and CFLAGS for these new functions. Usual rebase work.

Understood, thank you.

Quoted 7 lines
Quoted 3 lines

About reconciling experimental functions and map,
we should also consider upgrading some functions to non-experimental.

I figured if I were to just do a reconcilliation of everything that is currently documented as experimental, that would be the impetus for their authors to yell at me about their not actually being experimental anymore, and I could fix that up in subsequent versions :)

OK, sounds like a plan.