* Re: [dpdk-dev] [PATCH] doc: add graphic showing layout of mbuf struct [not found] <20190823131007.9000-1-aideen.mcloughlin@intel.com> @ 2019-08-24 12:18 ` Jerin Jacob Kollanukkaran [not found] ` <20190827090230.2057-1-aideen.mcloughlin@intel.com> 1 sibling, 0 replies; 4+ messages in thread From: Jerin Jacob Kollanukkaran @ 2019-08-24 12:18 UTC (permalink / raw) To: A.McLoughlin, John McNamara, Marko Kovacevic, Olivier Matz Cc: dev@dpdk.org, harry.van.haaren@intel.com > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of A.McLoughlin > Sent: Friday, August 23, 2019 6:40 PM > To: John McNamara <john.mcnamara@intel.com>; Marko Kovacevic > <marko.kovacevic@intel.com>; Olivier Matz <olivier.matz@6wind.com> > Cc: dev@dpdk.org; harry.van.haaren@intel.com; A.McLoughlin > <aideen.mcloughlin@intel.com> > Subject: [dpdk-dev] [PATCH] doc: add graphic showing layout of mbuf struct > > This patch adds a graphical overview of the rte_mbuf struct, showing where > each value is stored within the struct. > > Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com> > --- > doc/guides/prog_guide/img/mbuf_graphic.svg | 7285 ++++++++++++++++++++ > doc/guides/prog_guide/mbuf_lib.rst | 9 + > 2 files changed, 7294 insertions(+) > create mode 100644 doc/guides/prog_guide/img/mbuf_graphic.svg The diagram shows uint16_t refcnt(+atomic). I think, +atomic is not need here. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20190827090230.2057-1-aideen.mcloughlin@intel.com>]
* Re: [dpdk-dev] [PATCH v3] doc: add graphic showing layout of mbuf struct [not found] ` <20190827090230.2057-1-aideen.mcloughlin@intel.com> @ 2019-10-17 15:58 ` Olivier Matz 2019-10-18 10:56 ` Jerin Jacob 0 siblings, 1 reply; 4+ messages in thread From: Olivier Matz @ 2019-10-17 15:58 UTC (permalink / raw) To: A.McLoughlin; +Cc: John McNamara, Marko Kovacevic, dev, harry.van.haaren Hi, On Tue, Aug 27, 2019 at 10:02:30AM +0100, A.McLoughlin wrote: > This patch adds a graphical overview of the rte_mbuf struct, showing where > each value is stored within the struct. > > Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com> > --- > v1 -> v2: > * changed uint16_t refcnt(+atomic) to uint16_t refcnt > v2 -> v3: > * added layout of extrenally stored struct rte_mbuf sched sched > * added struct names for named structs > * made variable names bold for differenciation from types > * minor styling changes > * specified that graphic represents layout on 64B machine > --- > doc/guides/prog_guide/img/mbuf_graphic.svg | 6962 ++++++++++++++++++++ > doc/guides/prog_guide/mbuf_lib.rst | 12 + > 2 files changed, 6974 insertions(+) > create mode 100644 doc/guides/prog_guide/img/mbuf_graphic.svg The diagram is nice, however we have to be careful because it has to be kept sync with the code. I tried to edit the svg with inkscape, and it seems the text is described as vector shapes, which make the diagram impossible to update. Couldn't it be replaced by the output of pahole? Or better, just explain how to generate it in the documentation? The user can then be sure that the information is up to date, matches its architecture, and can also check structures other than mbuf. Example of pahole output for mbuf: struct rte_mbuf { MARKER cacheline0; /* 0 0 */ void * buf_addr; /* 0 8 */ union { rte_iova_t buf_iova; /* 8 8 */ rte_iova_t buf_physaddr; /* 8 8 */ }; /* 8 8 */ MARKER64 rearm_data; /* 16 0 */ uint16_t data_off; /* 16 2 */ union { rte_atomic16_t refcnt_atomic; /* 18 2 */ uint16_t refcnt; /* 18 2 */ }; /* 18 2 */ uint16_t nb_segs; /* 20 2 */ uint16_t port; /* 22 2 */ uint64_t ol_flags; /* 24 8 */ MARKER rx_descriptor_fields1; /* 32 0 */ union { uint32_t packet_type; /* 32 4 */ struct { uint32_t l2_type:4; /* 32:28 4 */ uint32_t l3_type:4; /* 32:24 4 */ uint32_t l4_type:4; /* 32:20 4 */ uint32_t tun_type:4; /* 32:16 4 */ /* Bitfield combined with next fields */ union { uint8_t inner_esp_next_proto; /* 34 1 */ struct { uint8_t inner_l2_type:4; /* 34: 4 1 */ uint8_t inner_l3_type:4; /* 34: 0 1 */ }; /* 34 1 */ }; /* 34 1 */ /* Bitfield combined with previous fields */ uint32_t inner_l4_type:4; /* 32: 4 4 */ }; /* 32 4 */ }; /* 32 4 */ uint32_t pkt_len; /* 36 4 */ uint16_t data_len; /* 40 2 */ uint16_t vlan_tci; /* 42 2 */ union { union { uint32_t rss; /* 44 4 */ struct { union { struct { uint16_t hash; /* 44 2 */ uint16_t id; /* 46 2 */ }; /* 44 4 */ uint32_t lo; /* 44 4 */ }; /* 44 4 */ uint32_t hi; /* 48 4 */ } fdir; /* 44 8 */ struct { uint32_t lo; /* 44 4 */ uint32_t hi; /* 48 4 */ } sched; /* 44 8 */ uint32_t usr; /* 44 4 */ } hash; /* 44 8 */ struct { uint32_t tx_metadata; /* 44 4 */ uint32_t reserved; /* 48 4 */ }; /* 44 8 */ }; /* 44 8 */ uint16_t vlan_tci_outer; /* 52 2 */ uint16_t buf_len; /* 54 2 */ uint64_t timestamp; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ MARKER cacheline1; /* 64 0 */ union { void * userdata; /* 64 8 */ uint64_t udata64; /* 64 8 */ }; /* 64 8 */ struct rte_mempool * pool; /* 72 8 */ struct rte_mbuf * next; /* 80 8 */ union { uint64_t tx_offload; /* 88 8 */ struct { uint64_t l2_len:7; /* 88:57 8 */ uint64_t l3_len:9; /* 88:48 8 */ uint64_t l4_len:8; /* 88:40 8 */ uint64_t tso_segsz:16; /* 88:24 8 */ uint64_t outer_l3_len:9; /* 88:15 8 */ uint64_t outer_l2_len:7; /* 88: 8 8 */ }; /* 88 8 */ }; /* 88 8 */ uint16_t priv_size; /* 96 2 */ uint16_t timesync; /* 98 2 */ uint32_t seqn; /* 100 4 */ struct rte_mbuf_ext_shared_info * shinfo; /* 104 8 */ /* size: 128, cachelines: 2, members: 27 */ /* padding: 16 */ }; Olivier ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v3] doc: add graphic showing layout of mbuf struct 2019-10-17 15:58 ` [dpdk-dev] [PATCH v3] " Olivier Matz @ 2019-10-18 10:56 ` Jerin Jacob 2020-05-24 21:24 ` Thomas Monjalon 0 siblings, 1 reply; 4+ messages in thread From: Jerin Jacob @ 2019-10-18 10:56 UTC (permalink / raw) To: Olivier Matz Cc: A.McLoughlin, John McNamara, Marko Kovacevic, dpdk-dev, Van Haaren, Harry On Thu, Oct 17, 2019 at 9:28 PM Olivier Matz <olivier.matz@6wind.com> wrote: > > Hi, > > On Tue, Aug 27, 2019 at 10:02:30AM +0100, A.McLoughlin wrote: > > This patch adds a graphical overview of the rte_mbuf struct, showing where > > each value is stored within the struct. > > > > Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com> > > --- > > v1 -> v2: > > * changed uint16_t refcnt(+atomic) to uint16_t refcnt > > v2 -> v3: > > * added layout of extrenally stored struct rte_mbuf sched sched > > * added struct names for named structs > > * made variable names bold for differenciation from types > > * minor styling changes > > * specified that graphic represents layout on 64B machine > > --- > > doc/guides/prog_guide/img/mbuf_graphic.svg | 6962 ++++++++++++++++++++ > > doc/guides/prog_guide/mbuf_lib.rst | 12 + > > 2 files changed, 6974 insertions(+) > > create mode 100644 doc/guides/prog_guide/img/mbuf_graphic.svg > > The diagram is nice, however we have to be careful because it > has to be kept sync with the code. I tried to edit the svg with > inkscape, and it seems the text is described as vector shapes, > which make the diagram impossible to update. > > Couldn't it be replaced by the output of pahole? Or better, just explain > how to generate it in the documentation? The user can then be sure that +1 for explaining how to generate it in the documentation as pahole output varies for the 128B cache line machine. > the information is up to date, matches its architecture, and can also > check structures other than mbuf. > > Example of pahole output for mbuf: > > struct rte_mbuf { > MARKER cacheline0; /* 0 0 */ > void * buf_addr; /* 0 8 */ > union { > rte_iova_t buf_iova; /* 8 8 */ > rte_iova_t buf_physaddr; /* 8 8 */ > }; /* 8 8 */ > MARKER64 rearm_data; /* 16 0 */ > uint16_t data_off; /* 16 2 */ > union { > rte_atomic16_t refcnt_atomic; /* 18 2 */ > uint16_t refcnt; /* 18 2 */ > }; /* 18 2 */ > uint16_t nb_segs; /* 20 2 */ > uint16_t port; /* 22 2 */ > uint64_t ol_flags; /* 24 8 */ > MARKER rx_descriptor_fields1; /* 32 0 */ > union { > uint32_t packet_type; /* 32 4 */ > struct { > uint32_t l2_type:4; /* 32:28 4 */ > uint32_t l3_type:4; /* 32:24 4 */ > uint32_t l4_type:4; /* 32:20 4 */ > uint32_t tun_type:4; /* 32:16 4 */ > > /* Bitfield combined with next fields */ > > union { > uint8_t inner_esp_next_proto; /* 34 1 */ > struct { > uint8_t inner_l2_type:4; /* 34: 4 1 */ > uint8_t inner_l3_type:4; /* 34: 0 1 */ > }; /* 34 1 */ > }; /* 34 1 */ > > /* Bitfield combined with previous fields */ > > uint32_t inner_l4_type:4; /* 32: 4 4 */ > }; /* 32 4 */ > }; /* 32 4 */ > uint32_t pkt_len; /* 36 4 */ > uint16_t data_len; /* 40 2 */ > uint16_t vlan_tci; /* 42 2 */ > union { > union { > uint32_t rss; /* 44 4 */ > struct { > union { > struct { > uint16_t hash; /* 44 2 */ > uint16_t id; /* 46 2 */ > }; /* 44 4 */ > uint32_t lo; /* 44 4 */ > }; /* 44 4 */ > uint32_t hi; /* 48 4 */ > } fdir; /* 44 8 */ > struct { > uint32_t lo; /* 44 4 */ > uint32_t hi; /* 48 4 */ > } sched; /* 44 8 */ > uint32_t usr; /* 44 4 */ > } hash; /* 44 8 */ > struct { > uint32_t tx_metadata; /* 44 4 */ > uint32_t reserved; /* 48 4 */ > }; /* 44 8 */ > }; /* 44 8 */ > uint16_t vlan_tci_outer; /* 52 2 */ > uint16_t buf_len; /* 54 2 */ > uint64_t timestamp; /* 56 8 */ > /* --- cacheline 1 boundary (64 bytes) --- */ > MARKER cacheline1; /* 64 0 */ > union { > void * userdata; /* 64 8 */ > uint64_t udata64; /* 64 8 */ > }; /* 64 8 */ > struct rte_mempool * pool; /* 72 8 */ > struct rte_mbuf * next; /* 80 8 */ > union { > uint64_t tx_offload; /* 88 8 */ > struct { > uint64_t l2_len:7; /* 88:57 8 */ > uint64_t l3_len:9; /* 88:48 8 */ > uint64_t l4_len:8; /* 88:40 8 */ > uint64_t tso_segsz:16; /* 88:24 8 */ > uint64_t outer_l3_len:9; /* 88:15 8 */ > uint64_t outer_l2_len:7; /* 88: 8 8 */ > }; /* 88 8 */ > }; /* 88 8 */ > uint16_t priv_size; /* 96 2 */ > uint16_t timesync; /* 98 2 */ > uint32_t seqn; /* 100 4 */ > struct rte_mbuf_ext_shared_info * shinfo; /* 104 8 */ > > /* size: 128, cachelines: 2, members: 27 */ > /* padding: 16 */ > }; > > > Olivier ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v3] doc: add graphic showing layout of mbuf struct 2019-10-18 10:56 ` Jerin Jacob @ 2020-05-24 21:24 ` Thomas Monjalon 0 siblings, 0 replies; 4+ messages in thread From: Thomas Monjalon @ 2020-05-24 21:24 UTC (permalink / raw) To: A.McLoughlin, John McNamara, Marko Kovacevic Cc: Olivier Matz, dev, Van Haaren, Harry, Jerin Jacob Any update? 18/10/2019 12:56, Jerin Jacob: > On Thu, Oct 17, 2019 at 9:28 PM Olivier Matz <olivier.matz@6wind.com> wrote: > > > > Hi, > > > > On Tue, Aug 27, 2019 at 10:02:30AM +0100, A.McLoughlin wrote: > > > This patch adds a graphical overview of the rte_mbuf struct, showing where > > > each value is stored within the struct. > > > > > > Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com> > > > --- > > > v1 -> v2: > > > * changed uint16_t refcnt(+atomic) to uint16_t refcnt > > > v2 -> v3: > > > * added layout of extrenally stored struct rte_mbuf sched sched > > > * added struct names for named structs > > > * made variable names bold for differenciation from types > > > * minor styling changes > > > * specified that graphic represents layout on 64B machine > > > --- > > > doc/guides/prog_guide/img/mbuf_graphic.svg | 6962 ++++++++++++++++++++ > > > doc/guides/prog_guide/mbuf_lib.rst | 12 + > > > 2 files changed, 6974 insertions(+) > > > create mode 100644 doc/guides/prog_guide/img/mbuf_graphic.svg > > > > The diagram is nice, however we have to be careful because it > > has to be kept sync with the code. I tried to edit the svg with > > inkscape, and it seems the text is described as vector shapes, > > which make the diagram impossible to update. > > > > Couldn't it be replaced by the output of pahole? Or better, just explain > > how to generate it in the documentation? The user can then be sure that > > +1 for explaining how to generate it in the documentation as pahole > output varies for the 128B cache line machine. > > > > the information is up to date, matches its architecture, and can also > > check structures other than mbuf. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-24 21:24 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20190823131007.9000-1-aideen.mcloughlin@intel.com> 2019-08-24 12:18 ` [dpdk-dev] [PATCH] doc: add graphic showing layout of mbuf struct Jerin Jacob Kollanukkaran [not found] ` <20190827090230.2057-1-aideen.mcloughlin@intel.com> 2019-10-17 15:58 ` [dpdk-dev] [PATCH v3] " Olivier Matz 2019-10-18 10:56 ` Jerin Jacob 2020-05-24 21:24 ` 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).