From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 73D7A6CD2 for ; Wed, 5 Oct 2016 08:45:29 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 04 Oct 2016 23:45:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,447,1473145200"; d="scan'208";a="1066314151" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga002.fm.intel.com with ESMTP; 04 Oct 2016 23:45:28 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.164]) by irsmsx105.ger.corp.intel.com ([169.254.7.196]) with mapi id 14.03.0248.002; Wed, 5 Oct 2016 07:45:26 +0100 From: "De Lara Guarch, Pablo" To: Olivier Matz , "dev@dpdk.org" Thread-Topic: [PATCH v2 1/8] mbuf: add function to dump ol flag list Thread-Index: AQHSCm+cDYGtA0vP3U6Yt4BSTeAMoKCZjiWg Date: Wed, 5 Oct 2016 06:45:26 +0000 Message-ID: References: <1473407734-11253-1-git-send-email-olivier.matz@6wind.com> <1473407734-11253-2-git-send-email-olivier.matz@6wind.com> In-Reply-To: <1473407734-11253-2-git-send-email-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWQ2NDQzMTUtNjdiNS00NjkxLWJhNWYtZTA1MGM5NWM5MmE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IndsOFp0ZExrbVIyS2JySnNiMTNXRnV6clpmZGMrZnM3V1J0QkhKQ245bjA9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/8] mbuf: add function to dump ol flag list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 06:45:29 -0000 Hi Olivier, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Friday, September 09, 2016 12:55 AM > To: dev@dpdk.org; De Lara Guarch, Pablo > Subject: [PATCH v2 1/8] mbuf: add function to dump ol flag list >=20 > The functions rte_get_rx_ol_flag_name() and rte_get_tx_ol_flag_name() > can dump one flag, or set of flag that are part of the same mask (ex: > PKT_TX_UDP_CKSUM, part of PKT_TX_L4_MASK). But they are not designed > to > dump the list of flags contained in mbuf->ol_flags. >=20 > This commit introduce new functions to do that. Similarly to the packet > type dump functions, the goal is to factorize the code that could be > used in several applications and reduce the risk of desynchronization > between the flags and the dump functions. >=20 > Signed-off-by: Olivier Matz > --- > doc/guides/rel_notes/release_16_11.rst | 5 ++ > lib/librte_mbuf/rte_mbuf.c | 91 > ++++++++++++++++++++++++++++++++++ > lib/librte_mbuf/rte_mbuf.h | 28 +++++++++++ > lib/librte_mbuf/rte_mbuf_version.map | 2 + > 4 files changed, 126 insertions(+) >=20 > diff --git a/doc/guides/rel_notes/release_16_11.rst > b/doc/guides/rel_notes/release_16_11.rst > index 36111f3..a877e58 100644 > --- a/doc/guides/rel_notes/release_16_11.rst > +++ b/doc/guides/rel_notes/release_16_11.rst > @@ -50,6 +50,11 @@ New Features >=20 > Added new functions ``rte_get_ptype_*()`` to dump a packet type as a > string. >=20 > +* **Added functions to dump the offload flags as a string.** > + > + Added two new functions ``rte_get_rx_ol_flag_list()`` and > + ``rte_get_tx_ol_flag_list()`` to dump offload flags as a string. > + > Resolved Issues > --------------- >=20 > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c > index fb2b962..56f37e6 100644 > --- a/lib/librte_mbuf/rte_mbuf.c > +++ b/lib/librte_mbuf/rte_mbuf.c > @@ -319,6 +319,53 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask) > } > } >=20 > +struct flag_mask { > + uint64_t flag; > + uint64_t mask; > + const char *default_name; > +}; > + > +/* write the list of rx ol flags in buffer buf */ > +int rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen) Return type should go in a separate line (same case in the other function). Thanks, Pablo