Skip to contentSkip to conversation

examples/ipsec-secgw: use rte fcn to access private area

PATCH In review Dan Gora 2 participants 2 messages Jun 18, 2018 – Jul 13, 2018

lore
Share & tools
lore

Dan Gora

author
#0 lore raw

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

Update get_priv() to use rte_mbuf_to_priv() to access the private area in the mbuf.

---
 examples/ipsec-secgw/ipsec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/ipsec-secgw/ipsec.h +1 -1
index 9b87278c1..3b5c3ec8c 100644
@@ -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 *
Signature · 1 line
2.18.0.rc1.1.g6f333ff2f
#1 lore raw

19/06/2018 01:36, Dan Gora:

examples/ipsec-secgw/ipsec.h ipsec_metadata_size(void) · line 194

Quoted 7 lines

Update get_priv() to use rte_mbuf_to_priv() to access the private area in the mbuf.

---

examples/ipsec-secgw/ipsec.h +1 -1
-	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.