Hi Olivier, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz at 6wind.com] > Sent: Friday, September 09, 2016 12:55 AM > To: dev at dpdk.org; De Lara Guarch, Pablo > Subject: [PATCH v2 1/8] mbuf: add function to dump ol flag list > > 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. > > 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. > > Signed-off-by: Olivier Matz <olivier.matz at 6wind.com> > --- > 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(+) > > 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 > > Added new functions ``rte_get_ptype_*()`` to dump a packet type as a > string. > > +* **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 > --------------- > > 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) > } > } > > +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