[v2,2/4] examples/ipsec-secgw: use rte fcn to access private area

Message ID 20180618233618.21729-1-dg@adax.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series mbuf: Add new private data area accessor function. |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Dan Gora June 18, 2018, 11:36 p.m. UTC
Update get_priv() to use rte_mbuf_to_priv() to access the private
area in the mbuf.

Signed-off-by: Dan Gora <dg@adax.com>
---
 examples/ipsec-secgw/ipsec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 13, 2018, 9:10 p.m. UTC | #1
19/06/2018 01:36, Dan Gora:
> Update get_priv() to use rte_mbuf_to_priv() to access the private
> area in the mbuf.
> 
> Signed-off-by: Dan Gora <dg@adax.com>
> ---
> -	return RTE_PTR_ADD(m, sizeof(struct rte_mbuf));
> +	return (ipsec_mbuf_metadata *)rte_mbuf_to_priv(m);

The cast is wrong (struct is missing) and useless.
I will remove it on apply.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index 9b87278c1..3b5c3ec8c 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -191,7 +191,7 @@  ipsec_metadata_size(void)
 static inline struct ipsec_mbuf_metadata *
 get_priv(struct rte_mbuf *m)
 {
-	return RTE_PTR_ADD(m, sizeof(struct rte_mbuf));
+	return (ipsec_mbuf_metadata *)rte_mbuf_to_priv(m);
 }
 
 static inline void *