DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] cocci: add cocci script to rename mbuf offload flags
Date: Wed, 29 Sep 2021 23:48:16 +0200	[thread overview]
Message-ID: <20210929214817.18082-3-olivier.matz@6wind.com> (raw)
In-Reply-To: <20210929214817.18082-1-olivier.matz@6wind.com>

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 in commit d7595795b760 ("doc:
announce renaming of mbuf offload flags"), but dropped by mistake at
commit.

Link: http://inbox.dpdk.org/dev/20210730155700.32574-1-olivier.matz@6wind.com
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 .../cocci/prefix_mbuf_offload_flags.cocci     | 441 ++++++++++++++++++
 1 file changed, 441 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..cac83032b4
--- /dev/null
+++ b/devtools/cocci/prefix_mbuf_offload_flags.cocci
@@ -0,0 +1,441 @@
+//
+// 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 occurences 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,\<PKT_RX_,RTE_MBUF_F_RX_,g' \
+//             -e 's,\<PKT_TX_,RTE_MBUF_F_TX_,g' \
+//             $f
+// done
+//
+@@
+@@
+
+- PKT_RX_VLAN
++ RTE_MBUF_F_RX_VLAN
+
+@@
+@@
+
+- PKT_RX_RSS_HASH
++ RTE_MBUF_F_RX_RSS_HASH
+
+@@
+@@
+
+- PKT_RX_FDIR
++ RTE_MBUF_F_RX_FDIR
+
+@@
+@@
+
+- PKT_RX_L4_CKSUM_BAD
++ RTE_MBUF_F_RX_L4_CKSUM_BAD
+
+@@
+@@
+
+- PKT_RX_IP_CKSUM_BAD
++ RTE_MBUF_F_RX_IP_CKSUM_BAD
+
+@@
+@@
+
+- PKT_RX_OUTER_IP_CKSUM_BAD
++ RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD
+
+@@
+@@
+
+- PKT_RX_EIP_CKSUM_BAD
++ RTE_MBUF_F_RX_EIP_CKSUM_BAD
+
+@@
+@@
+
+- PKT_RX_VLAN_STRIPPED
++ RTE_MBUF_F_RX_VLAN_STRIPPED
+
+@@
+@@
+
+- PKT_RX_IP_CKSUM_MASK
++ RTE_MBUF_F_RX_IP_CKSUM_MASK
+
+@@
+@@
+
+- PKT_RX_IP_CKSUM_UNKNOWN
++ RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN
+
+@@
+@@
+
+- PKT_RX_IP_CKSUM_BAD
++ RTE_MBUF_F_RX_IP_CKSUM_BAD
+
+@@
+@@
+
+- PKT_RX_IP_CKSUM_GOOD
++ RTE_MBUF_F_RX_IP_CKSUM_GOOD
+
+@@
+@@
+
+- PKT_RX_IP_CKSUM_NONE
++ RTE_MBUF_F_RX_IP_CKSUM_NONE
+
+@@
+@@
+
+- PKT_RX_L4_CKSUM_MASK
++ RTE_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LOAD_MASK
++ RTE_MBUF_F_TX_OFFLOAD_MASK
+
+@@
+@@
+
+- EXT_ATTACHED_MBUF
++ RTE_MBUF_F_EXTERNAL
+
+@@
+@@
+
+- IND_ATTACHED_MBUF
++ RTE_MBUF_F_INDIRECT
+
+@@
+@@
+
+- PKT_TX_DYNF_METADATA
++ RTE_MBUF_DYNFLAG_TX_METADATA
+
+@@
+@@
+
+- PKT_RX_DYNF_METADATA
++ RTE_MBUF_DYNFLAG_RX_METADATA
-- 
2.30.2


  parent reply	other threads:[~2021-09-29 21:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 21:48 [dpdk-dev] [PATCH 0/3] mbuf: offload flags namespace Olivier Matz
2021-09-29 21:48 ` [dpdk-dev] [PATCH 1/3] mbuf: remove deprecated offload flags Olivier Matz
2021-10-04  8:29   ` David Marchand
2021-10-04  9:46     ` Olivier Matz
2021-09-29 21:48 ` Olivier Matz [this message]
2021-09-29 21:48 ` [dpdk-dev] [PATCH 3/3] mbuf: add rte prefix to " Olivier Matz
2021-10-15 19:24 ` [dpdk-dev] [PATCH v2 0/4] mbuf: offload flags namespace Olivier Matz
2021-10-15 19:24   ` [dpdk-dev] [PATCH v2 1/4] mbuf: remove duplicate definition of cksum offload flags Olivier Matz
2021-10-16  7:47     ` Andrew Rybchenko
2021-10-15 19:24   ` [dpdk-dev] [PATCH v2 2/4] mbuf: mark old VLAN offload flags as deprecated Olivier Matz
2021-10-16  7:50     ` Andrew Rybchenko
2021-10-17 14:46       ` Ajit Khaparde
2021-10-18  8:10       ` Olivier Matz
2021-10-18 11:15         ` Somnath Kotur
2021-10-15 19:24   ` [dpdk-dev] [PATCH v2 3/4] cocci: add cocci script to rename mbuf offload flags Olivier Matz
2021-10-15 19:24   ` [dpdk-dev] [PATCH v2 4/4] mbuf: add rte prefix to " Olivier Matz
2021-10-16  7:57     ` Andrew Rybchenko
2021-10-17 14:45       ` Ajit Khaparde
2021-10-18 11:15         ` Somnath Kotur
2021-10-24 11:43   ` [dpdk-dev] [PATCH v2 0/4] mbuf: offload flags namespace David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210929214817.18082-3-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).