From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F97DA31F3 for ; Fri, 18 Oct 2019 12:56:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 699121D17D; Fri, 18 Oct 2019 12:56:25 +0200 (CEST) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by dpdk.org (Postfix) with ESMTP id 832B01D14B for ; Fri, 18 Oct 2019 12:56:23 +0200 (CEST) Received: by mail-io1-f65.google.com with SMTP id u8so6900804iom.5 for ; Fri, 18 Oct 2019 03:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DDUmkAQK7MgtBYc1c5z3zaEGhOgAXWIc6VKYREiy/Xc=; b=MrMjMRf1+X7ZbWNCLJQjeN4Y11x7YB3VEGoeWAUFdI8ySYZG+zYroT8WMfXpdHAtFB rvoX7xZjtQyRGr2aKzo+3JV3yVdG8OrzXMTH3nR80WeQXWRxanrqi1eDDOMQkBbIVWeE fo3OEaaB+MGx6kA/19dmdxKUx2mKe5Fnus3d4tD5frUTtMRup2NuWCYGDY/RYeCOJvOO EB/ZB3HduyuiOEgNmivPuXnTYeJh84vf0PZCBB39HzSHI6Z/Ici3xKQu7qbKUrnQyn6u cDHEtukdGs3JCjh+AhW8cvk5M5iCbZxyjbpDFNYd2aWERjjoYQAcxGr7dSEBgGBsGykq ED4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DDUmkAQK7MgtBYc1c5z3zaEGhOgAXWIc6VKYREiy/Xc=; b=TmrUovHctF4dcCVf2n6cG6T+xytRlckVKDY6xMGDr3cTM+tayvdwRf2EZfH5G6vWQi lt+nh20DU0/suMb8pl3f/xcDMoevz8B5D0gHynXgbLaYU9RISRUNGjib2DeDfeofYKiD h1P6tPkc1m/SW8bxZ9EuETO9F4W0DhiPXl18lUcuNtNIYEn5Jg9YwhVsWvn6CccmXoyn WrwfquzQqVaJ1woa6BWzNFcggslnwlYQ1ZpXz45+FlSVLNlVg/xJVXW34BUjyXwUAkvI 43HtNhKwKekpYnyfDMg0Atal5d8L3wcfOI3Bz4c5pp3UuQG2qZsUsmY4KLKi/ejYNKE3 ufBA== X-Gm-Message-State: APjAAAWXlqQY+Nat1iwvmvyF6DY+4jLx2yDy1DEzYN0eW59VtWsfYvXQ vYXiHqtWyEdQdiZoiIxaNFIb4lG8g3ioPS0teM8COqUahvY= X-Google-Smtp-Source: APXvYqzX0nMQhy6iVWa6dFsdQLf05RRXCb/z3vx8uBPd5Gh+GHs5ZNTYBsww4mGc5aBcUn3vtreNyOjzowZTVSDNckE= X-Received: by 2002:a6b:740b:: with SMTP id s11mr8267358iog.294.1571396182700; Fri, 18 Oct 2019 03:56:22 -0700 (PDT) MIME-Version: 1.0 References: <20190823131007.9000-1-aideen.mcloughlin@intel.com> <20190827090230.2057-1-aideen.mcloughlin@intel.com> <20191017155848.3kxixqhsv2pd4jvy@platinum> In-Reply-To: <20191017155848.3kxixqhsv2pd4jvy@platinum> From: Jerin Jacob Date: Fri, 18 Oct 2019 16:26:11 +0530 Message-ID: To: Olivier Matz Cc: "A.McLoughlin" , John McNamara , Marko Kovacevic , dpdk-dev , "Van Haaren, Harry" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3] doc: add graphic showing layout of mbuf struct X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 17, 2019 at 9:28 PM Olivier Matz 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 > > --- > > 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