DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 2/4] examples/ipsec-secgw: use rte fcn to access private area
@ 2018-06-18 23:36 Dan Gora
  2018-07-13 21:10 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Gora @ 2018-06-18 23:36 UTC (permalink / raw)
  To: dev
  Cc: Dan Gora, Remy Horton, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki

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(-)

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 *
-- 
2.18.0.rc1.1.g6f333ff2f

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/4] examples/ipsec-secgw: use rte fcn to access private area
  2018-06-18 23:36 [dpdk-dev] [PATCH v2 2/4] examples/ipsec-secgw: use rte fcn to access private area Dan Gora
@ 2018-07-13 21:10 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2018-07-13 21:10 UTC (permalink / raw)
  To: Dan Gora
  Cc: dev, Remy Horton, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-13 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 23:36 [dpdk-dev] [PATCH v2 2/4] examples/ipsec-secgw: use rte fcn to access private area Dan Gora
2018-07-13 21:10 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).