From b1d295e69e75eefaf5aaa8cef0808e36f5b0817e Mon Sep 17 00:00:00 2001 From: Dan Gora Date: Mon, 18 Jun 2018 16:36:18 -0700 Subject: [PATCH] examples/ipsec-secgw: use function to access mbuf private Update get_priv() to use rte_mbuf_to_priv() to access the private area in the mbuf. In inbound_sa_check(), use the application's get_priv() function to access the private area in the mbuf. Signed-off-by: Dan Gora --- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/sa.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index 9b87278c1f..c998c8076c 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 rte_mbuf_to_priv(m); } static inline void * diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index d9dcc0e068..4ab8e098a2 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -939,7 +939,7 @@ inbound_sa_check(struct sa_ctx *sa_ctx, struct rte_mbuf *m, uint32_t sa_idx) { struct ipsec_mbuf_metadata *priv; - priv = RTE_PTR_ADD(m, sizeof(struct rte_mbuf)); + priv = get_priv(m); return (sa_ctx->sa[sa_idx].spi == priv->sa->spi); } -- 2.20.1