[dpdk-dev] [PATCH v2 2/2] mbuf: minor cleanup

Morten Brørup mb at smartsharesystems.com
Wed Sep 16 11:09:44 CEST 2020


The mbuf header files had some commenting style errors that affected the
API documentation.
Also, the RTE_ prefix was missing on a macro and a definition.

Note: This patch does not touch the offload and attachment flags that are
also missing the RTE_ prefix.

Changes only affecting documentation:
* Removed the MBUF_INVALID_PORT definition from rte_mbuf.h; it is
  already defined in rte_mbuf_core.h.
  This removal also reestablished the description of the
  rte_pktmbuf_reset() function.
* Corrected the comment related to RTE_MBUF_MAX_NB_SEGS.
* Corrected the comment related to PKT_TX_QINQ_PKT.

Changes regarding missing RTE_ prefix:
* Converted the MBUF_RAW_ALLOC_CHECK() macro to an
  __rte_mbuf_raw_sanity_check() inline function.
  Added backwards compatible macro with the original name.
* Renamed the MBUF_INVALID_PORT definition to RTE_MBUF_PORT_INVALID.
  Added backwards compatible definition with the original name.

v2:
* Use RTE_MBUF_PORT_INVALID intead of MBUF_INVALID_PORT in rte_mbuf.c.

Signed-off-by: Morten Brørup <mb at smartsharesystems.com>
---
 lib/librte_mbuf/rte_mbuf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 8a456e5e6..53a015311 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -104,7 +104,7 @@ rte_pktmbuf_init(struct rte_mempool *mp,
 	/* init some constant fields */
 	m->pool = mp;
 	m->nb_segs = 1;
-	m->port = MBUF_INVALID_PORT;
+	m->port = RTE_MBUF_PORT_INVALID;
 	rte_mbuf_refcnt_set(m, 1);
 	m->next = NULL;
 }
@@ -207,7 +207,7 @@ __rte_pktmbuf_init_extmem(struct rte_mempool *mp,
 	/* init some constant fields */
 	m->pool = mp;
 	m->nb_segs = 1;
-	m->port = MBUF_INVALID_PORT;
+	m->port = RTE_MBUF_PORT_INVALID;
 	m->ol_flags = EXT_ATTACHED_MBUF;
 	rte_mbuf_refcnt_set(m, 1);
 	m->next = NULL;
-- 
2.17.1



More information about the dev mailing list