[v2,1/2] devtools: add check on symbol maps format

Message ID 20230815103651.3577288-1-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/2] devtools: add check on symbol maps format |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Aug. 15, 2023, 10:36 a.m. UTC
  Add a check on symbol maps format (fixing ethdev at the same time).
This will be required by a next commit.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- moved this check in a separate patch,
- fixed ethdev map file,

---
 devtools/check-symbol-maps.sh | 21 +++++++++++++++++++++
 lib/ethdev/version.map        | 30 ++++++++++++++----------------
 2 files changed, 35 insertions(+), 16 deletions(-)
  

Patch

diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
index 8c116bfa9c..1ad48d9243 100755
--- a/devtools/check-symbol-maps.sh
+++ b/devtools/check-symbol-maps.sh
@@ -74,4 +74,25 @@  if [ -n "$empty_maps" ] ; then
     ret=1
 fi
 
+find_bad_format_maps ()
+{
+    for map in $@ ; do
+        cat $map | awk '
+            /^(DPDK_[0-9]*|EXPERIMENTAL|INTERNAL) {$/ { next; } # start of a section
+            /^};$/ { next; } # end of a section
+            /^$/ { next; } # empty line
+            /^\t(global:|local: \*;)$/ { next; } # qualifiers
+            /^\t[a-zA-Z_0-9]*;(| # WINDOWS_NO_EXPORT)$/ { next; } # symbols
+            /^\t# added in [0-9]*\.[0-9]*$/ { next; } # version comments
+            { print $0; }' || echo $map
+    done
+}
+
+bad_format_maps=$(find_bad_format_maps $@)
+if [ -n "$bad_format_maps" ] ; then
+    echo "Found badly formatted maps:"
+    echo "$bad_format_maps"
+    ret=1
+fi
+
 exit $ret
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index b965d6aa52..da4f847116 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -181,7 +181,20 @@  EXPERIMENTAL {
 	__rte_ethdev_trace_tx_burst;
 	rte_flow_get_aged_flows;
 
-	# Marked as experimental in 20.11
+	# added in 20.11
+	rte_eth_hairpin_bind;
+	rte_eth_hairpin_get_peer_ports;
+	rte_eth_hairpin_unbind;
+	rte_eth_link_speed_to_str;
+	rte_eth_link_to_str;
+	rte_eth_fec_get_capability;
+	rte_eth_fec_get;
+	rte_eth_fec_set;
+	rte_flow_tunnel_decap_set;
+	rte_flow_tunnel_match;
+	rte_flow_get_restore_info;
+	rte_flow_tunnel_action_decap_release;
+	rte_flow_tunnel_item_release;
 	rte_tm_capabilities_get;
 	rte_tm_get_number_of_leaf_nodes;
 	rte_tm_hierarchy_commit;
@@ -213,21 +226,6 @@  EXPERIMENTAL {
 	rte_tm_wred_profile_add;
 	rte_tm_wred_profile_delete;
 
-	# added in 20.11
-	rte_eth_hairpin_bind;
-	rte_eth_hairpin_get_peer_ports;
-	rte_eth_hairpin_unbind;
-	rte_eth_link_speed_to_str;
-	rte_eth_link_to_str;
-	rte_eth_fec_get_capability;
-	rte_eth_fec_get;
-	rte_eth_fec_set;
-	rte_flow_tunnel_decap_set;
-	rte_flow_tunnel_match;
-	rte_flow_get_restore_info;
-	rte_flow_tunnel_action_decap_release;
-	rte_flow_tunnel_item_release;
-
 	# added in 21.02
 	rte_eth_get_monitor_addr;