From 735155ee3b7c126b14ac28c5667d5a2d811ddf4c Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 15 Oct 2021 21:24:07 +0200 Subject: [PATCH] devtools: add cocci script to rename mbuf offload flags The mbuf offload flags do not match the DPDK namespace (they are not prefixed by RTE_). This coccinelle script is used in the next commit to do the replacement in the code. A draft script was initially submitted [1] in commit d7595795b760 ("doc: announce renaming of mbuf offload flags"), but dropped by mistake at commit. 1: http://inbox.dpdk.org/dev/20210730155700.32574-1-olivier.matz@6wind.com Signed-off-by: Olivier Matz --- .../cocci/prefix_mbuf_offload_flags.cocci | 447 ++++++++++++++++++ 1 file changed, 447 insertions(+) create mode 100644 devtools/cocci/prefix_mbuf_offload_flags.cocci diff --git a/devtools/cocci/prefix_mbuf_offload_flags.cocci b/devtools/cocci/prefix_mbuf_offload_flags.cocci new file mode 100644 index 0000000000..6157034682 --- /dev/null +++ b/devtools/cocci/prefix_mbuf_offload_flags.cocci @@ -0,0 +1,447 @@ +// +// Rename mbuf offload flags (and some other defines) to have +// an RTE_ prefix. +// This only replaces usages in C code, so it is advised to +// replace missing occurrences with: +// for f in $(git ls-tree --full-tree -r --name-only HEAD); do +// if [ "$(file -b --mime-encoding $f)" = "binary" ]; then +// continue +// fi +// sed -i \ +// -e 's,EXT_ATTACHED_MBUF,RTE_MBUF_F_EXTERNAL,g' \ +// -e 's,IND_ATTACHED_MBUF,RTE_MBUF_F_INDIRECT,g' \ +// -e 's,EXT_ATTACHED_MBUF,RTE_MBUF_F_EXTERNAL,g' \ +// -e 's,PKT_FIRST_FREE,RTE_MBUF_F_FIRST_FREE,g' \ +// -e 's,PKT_LAST_FREE,RTE_MBUF_F_LAST_FREE,g' \ +// -e 's,PKT_TX_DYNF_METADATA,RTE_MBUF_DYNFLAG_TX_METADATA,g' \ +// -e 's,PKT_RX_DYNF_METADATA,RTE_MBUF_DYNFLAG_RX_METADATA,g' \ +// -e 's,\