DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 3/5] net/nfp: uniform function name format
Date: Tue,  5 Mar 2024 10:29:21 +0800	[thread overview]
Message-ID: <20240305022923.891544-4-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240305022923.891544-1-chaoyong.he@corigine.com>

From: Long Wu <long.wu@corigine.com>

Uniform function name format and add the same prefix.

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c |  5 ++--
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c |  5 ++--
 drivers/net/nfp/nfp_net_common.c   |  2 +-
 drivers/net/nfp/nfp_net_meta.c     | 38 +++++++++++++++---------------
 drivers/net/nfp/nfp_net_meta.h     |  8 +++----
 drivers/net/nfp/nfp_rxtx.c         |  2 +-
 6 files changed, 29 insertions(+), 31 deletions(-)

diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
index 5fb76ae9d7..7e281ae498 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
+++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
@@ -194,8 +194,7 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 				PMD_DRV_LOG(ERR, "At most 1 layers of vlan is supported");
 				return -EINVAL;
 			}
-
-			nfp_net_set_meta_vlan(meta_data, pkt, layer);
+			nfp_net_meta_set_vlan(meta_data, pkt, layer);
 			vlan_layer++;
 			break;
 		case NFP_NET_META_IPSEC:
@@ -204,7 +203,7 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 				return -EINVAL;
 			}
 
-			nfp_net_set_meta_ipsec(meta_data, txq, pkt, layer, ipsec_layer);
+			nfp_net_meta_set_ipsec(meta_data, txq, pkt, layer, ipsec_layer);
 			ipsec_layer++;
 			break;
 		default:
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 8bdab5d463..b8592b1767 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -228,8 +228,7 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 				PMD_DRV_LOG(ERR, "At most 1 layers of vlan is supported");
 				return -EINVAL;
 			}
-
-			nfp_net_set_meta_vlan(&meta_data, pkt, layer);
+			nfp_net_meta_set_vlan(&meta_data, pkt, layer);
 			vlan_layer++;
 			break;
 		case NFP_NET_META_IPSEC:
@@ -238,7 +237,7 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 				return -EINVAL;
 			}
 
-			nfp_net_set_meta_ipsec(&meta_data, txq, pkt, layer, ipsec_layer);
+			nfp_net_meta_set_ipsec(&meta_data, txq, pkt, layer, ipsec_layer);
 			ipsec_layer++;
 			break;
 		default:
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 384e042dfd..71038d6be9 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -1312,7 +1312,7 @@ nfp_net_common_init(struct rte_pci_device *pci_dev,
 	hw->max_mtu = nn_cfg_readl(&hw->super, NFP_NET_CFG_MAX_MTU);
 	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
-	nfp_net_init_metadata_format(hw);
+	nfp_net_meta_init_format(hw);
 
 	/* Read the Rx offset configured from firmware */
 	if (hw->ver.major < 2)
diff --git a/drivers/net/nfp/nfp_net_meta.c b/drivers/net/nfp/nfp_net_meta.c
index 0fd5ba17a0..2ec20aba7d 100644
--- a/drivers/net/nfp/nfp_net_meta.c
+++ b/drivers/net/nfp/nfp_net_meta.c
@@ -17,7 +17,7 @@ enum nfp_net_meta_ipsec_layer {
 
 /* Parse the chained metadata from packet */
 static bool
-nfp_net_parse_chained_meta(uint8_t *meta_base,
+nfp_net_meta_parse_chained(uint8_t *meta_base,
 		rte_be32_t meta_header,
 		struct nfp_net_meta_parsed *meta)
 {
@@ -73,7 +73,7 @@ nfp_net_parse_chained_meta(uint8_t *meta_base,
  * Get it from metadata area.
  */
 static inline void
-nfp_net_parse_single_meta(uint8_t *meta_base,
+nfp_net_meta_parse_single(uint8_t *meta_base,
 		rte_be32_t meta_header,
 		struct nfp_net_meta_parsed *meta)
 {
@@ -83,7 +83,7 @@ nfp_net_parse_single_meta(uint8_t *meta_base,
 
 /* Set mbuf hash data based on the metadata info */
 static void
-nfp_net_parse_meta_hash(const struct nfp_net_meta_parsed *meta,
+nfp_net_meta_parse_hash(const struct nfp_net_meta_parsed *meta,
 		struct nfp_net_rxq *rxq,
 		struct rte_mbuf *mbuf)
 {
@@ -98,7 +98,7 @@ nfp_net_parse_meta_hash(const struct nfp_net_meta_parsed *meta,
 
 /* Set mbuf vlan_strip data based on metadata info */
 static void
-nfp_net_parse_meta_vlan(const struct nfp_net_meta_parsed *meta,
+nfp_net_meta_parse_vlan(const struct nfp_net_meta_parsed *meta,
 		struct nfp_net_rx_desc *rxd,
 		struct nfp_net_rxq *rxq,
 		struct rte_mbuf *mb)
@@ -146,7 +146,7 @@ nfp_net_parse_meta_vlan(const struct nfp_net_meta_parsed *meta,
  * qinq not set & vlan not set: meta->vlan_layer=0
  */
 static void
-nfp_net_parse_meta_qinq(const struct nfp_net_meta_parsed *meta,
+nfp_net_meta_parse_qinq(const struct nfp_net_meta_parsed *meta,
 		struct nfp_net_rxq *rxq,
 		struct rte_mbuf *mb)
 {
@@ -175,7 +175,7 @@ nfp_net_parse_meta_qinq(const struct nfp_net_meta_parsed *meta,
  * Extract and decode metadata info and set the mbuf ol_flags.
  */
 static void
-nfp_net_parse_meta_ipsec(struct nfp_net_meta_parsed *meta,
+nfp_net_meta_parse_ipsec(struct nfp_net_meta_parsed *meta,
 		struct nfp_net_rxq *rxq,
 		struct rte_mbuf *mbuf)
 {
@@ -202,7 +202,7 @@ nfp_net_parse_meta_ipsec(struct nfp_net_meta_parsed *meta,
 }
 
 static void
-nfp_net_parse_meta_mark(const struct nfp_net_meta_parsed *meta,
+nfp_net_meta_parse_mark(const struct nfp_net_meta_parsed *meta,
 		struct rte_mbuf *mbuf)
 {
 	if (((meta->flags >> NFP_NET_META_MARK) & 0x1) == 0)
@@ -214,7 +214,7 @@ nfp_net_parse_meta_mark(const struct nfp_net_meta_parsed *meta,
 
 /* Parse the metadata from packet */
 void
-nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
+nfp_net_meta_parse(struct nfp_net_rx_desc *rxds,
 		struct nfp_net_rxq *rxq,
 		struct nfp_net_hw *hw,
 		struct rte_mbuf *mb,
@@ -231,20 +231,20 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
 
 	switch (hw->meta_format) {
 	case NFP_NET_METAFORMAT_CHAINED:
-		if (nfp_net_parse_chained_meta(meta_base, meta_header, meta)) {
-			nfp_net_parse_meta_hash(meta, rxq, mb);
-			nfp_net_parse_meta_vlan(meta, rxds, rxq, mb);
-			nfp_net_parse_meta_qinq(meta, rxq, mb);
-			nfp_net_parse_meta_ipsec(meta, rxq, mb);
-			nfp_net_parse_meta_mark(meta, mb);
+		if (nfp_net_meta_parse_chained(meta_base, meta_header, meta)) {
+			nfp_net_meta_parse_hash(meta, rxq, mb);
+			nfp_net_meta_parse_vlan(meta, rxds, rxq, mb);
+			nfp_net_meta_parse_qinq(meta, rxq, mb);
+			nfp_net_meta_parse_ipsec(meta, rxq, mb);
+			nfp_net_meta_parse_mark(meta, mb);
 		} else {
 			PMD_RX_LOG(DEBUG, "RX chained metadata format is wrong!");
 		}
 		break;
 	case NFP_NET_METAFORMAT_SINGLE:
 		if ((rxds->rxd.flags & PCIE_DESC_RX_RSS) != 0) {
-			nfp_net_parse_single_meta(meta_base, meta_header, meta);
-			nfp_net_parse_meta_hash(meta, rxq, mb);
+			nfp_net_meta_parse_single(meta_base, meta_header, meta);
+			nfp_net_meta_parse_hash(meta, rxq, mb);
 		}
 		break;
 	default:
@@ -253,7 +253,7 @@ nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
 }
 
 void
-nfp_net_init_metadata_format(struct nfp_net_hw *hw)
+nfp_net_meta_init_format(struct nfp_net_hw *hw)
 {
 	/*
 	 * ABI 4.x and ctrl vNIC always use chained metadata, in other cases we allow use of
@@ -276,7 +276,7 @@ nfp_net_init_metadata_format(struct nfp_net_hw *hw)
 }
 
 void
-nfp_net_set_meta_vlan(struct nfp_net_meta_raw *meta_data,
+nfp_net_meta_set_vlan(struct nfp_net_meta_raw *meta_data,
 		struct rte_mbuf *pkt,
 		uint8_t layer)
 {
@@ -290,7 +290,7 @@ nfp_net_set_meta_vlan(struct nfp_net_meta_raw *meta_data,
 }
 
 void
-nfp_net_set_meta_ipsec(struct nfp_net_meta_raw *meta_data,
+nfp_net_meta_set_ipsec(struct nfp_net_meta_raw *meta_data,
 		struct nfp_net_txq *txq,
 		struct rte_mbuf *pkt,
 		uint8_t layer,
diff --git a/drivers/net/nfp/nfp_net_meta.h b/drivers/net/nfp/nfp_net_meta.h
index 46caa777da..1d26b089d5 100644
--- a/drivers/net/nfp/nfp_net_meta.h
+++ b/drivers/net/nfp/nfp_net_meta.h
@@ -90,16 +90,16 @@ struct nfp_net_meta_parsed {
 	} vlan[NFP_NET_META_MAX_VLANS];
 };
 
-void nfp_net_init_metadata_format(struct nfp_net_hw *hw);
-void nfp_net_parse_meta(struct nfp_net_rx_desc *rxds,
+void nfp_net_meta_init_format(struct nfp_net_hw *hw);
+void nfp_net_meta_parse(struct nfp_net_rx_desc *rxds,
 		struct nfp_net_rxq *rxq,
 		struct nfp_net_hw *hw,
 		struct rte_mbuf *mb,
 		struct nfp_net_meta_parsed *meta);
-void nfp_net_set_meta_vlan(struct nfp_net_meta_raw *meta_data,
+void nfp_net_meta_set_vlan(struct nfp_net_meta_raw *meta_data,
 		struct rte_mbuf *pkt,
 		uint8_t layer);
-void nfp_net_set_meta_ipsec(struct nfp_net_meta_raw *meta_data,
+void nfp_net_meta_set_ipsec(struct nfp_net_meta_raw *meta_data,
 		struct nfp_net_txq *txq,
 		struct rte_mbuf *pkt,
 		uint8_t layer,
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index e863c42039..716a6af34f 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -498,7 +498,7 @@ nfp_net_recv_pkts(void *rx_queue,
 		mb->port = rxq->port_id;
 
 		struct nfp_net_meta_parsed meta = {};
-		nfp_net_parse_meta(rxds, rxq, hw, mb, &meta);
+		nfp_net_meta_parse(rxds, rxq, hw, mb, &meta);
 
 		nfp_net_parse_ptype(rxq, rxds, mb);
 
-- 
2.39.1


  parent reply	other threads:[~2024-03-05  2:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05  2:29 [PATCH 0/5] add new meta data module Chaoyong He
2024-03-05  2:29 ` [PATCH 1/5] net/nfp: create " Chaoyong He
2024-03-05  2:29 ` [PATCH 2/5] net/nfp: uniform variable name format Chaoyong He
2024-03-05  2:29 ` Chaoyong He [this message]
2024-03-05  2:29 ` [PATCH 4/5] net/nfp: use flag bits to control parsing meta data Chaoyong He
2024-03-05  2:29 ` [PATCH 5/5] net/nfp: use big-endian meta data for packet Chaoyong He
2024-03-12 12:05 ` [PATCH 0/5] add new meta data module Ferruh Yigit

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=20240305022923.891544-4-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    /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).