DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] ovs-dpdk: placing the metadata
@ 2015-03-24 17:42 Zoltan Kiss
  2015-03-25 17:04 ` Olivier MATZ
  0 siblings, 1 reply; 4+ messages in thread
From: Zoltan Kiss @ 2015-03-24 17:42 UTC (permalink / raw)
  To: dev, dev


I've noticed in lib/netdev-dpdk.c that __rte_pktmbuf_init() stores the 
packet metadata right after "struct rte_mbuf", and before the buffer data:

     /* start of buffer is just after mbuf structure */
     m->buf_addr = (char *)m + sizeof(struct dp_packet);

(struct dp_packet has the rte_mbuf as first member if DPDK enabled) 	

However, lib/librte_mbuf/rte_mbuf.h seems to codify that the buffer 
should start right after the rte_mbuf:

  * Given the buf_addr returns the pointer to corresponding mbuf.
#define RTE_MBUF_FROM_BADDR(ba)     (((struct rte_mbuf *)(ba)) - 1)

  * Given the pointer to mbuf returns an address where it's  buf_addr
  * should point to.
#define RTE_MBUF_TO_BADDR(mb)       (((struct rte_mbuf *)(mb)) + 1)

These macros are used for attaching/detaching mbuf's to each other. This 
is the way the code retrieves the direct buffer from an indirect one, 
and vica versa. I think if we want to keep the metadata feature (which I 
guess is quite important), we need to add a pointer to rte_mbuf, which 
helps the direct and indirect structs to find each other. Something like:

	struct rte_mbuf *attach;    /**< Points to the other buffer if this one
					 is (in)direct. Otherwise NULL.  */

What do you think?


Zoltan Kiss

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

end of thread, other threads:[~2015-03-26  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 17:42 [dpdk-dev] ovs-dpdk: placing the metadata Zoltan Kiss
2015-03-25 17:04 ` Olivier MATZ
2015-03-25 18:57   ` Zoltan Kiss
2015-03-26  8:44     ` Olivier MATZ

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git