summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDan Gora <dg@adax.com>2018-06-18 16:36:18 -0700
committerThomas Monjalon <thomas@monjalon.net>2018-07-13 23:13:52 +0200
commitb1d295e69e75eefaf5aaa8cef0808e36f5b0817e (patch)
treee30a63fc6528636d81d9591a87944f2b4c28790c /examples
parentf5f45caeb049ea52b6e8fd2abe0a46c204dea533 (diff)
downloaddpdk-b1d295e69e75eefaf5aaa8cef0808e36f5b0817e.zip
dpdk-b1d295e69e75eefaf5aaa8cef0808e36f5b0817e.tar.gz
dpdk-b1d295e69e75eefaf5aaa8cef0808e36f5b0817e.tar.xz
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 <dg@adax.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/ipsec-secgw/ipsec.h2
-rw-r--r--examples/ipsec-secgw/sa.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index 9b87278..c998c80 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 d9dcc0e..4ab8e09 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);
}