Hi Konstantin, On 07/21/2016 12:51 PM, Ananyev, Konstantin wrote: > Hi Olivier, > >> >> This function can be used to calculate the checksum of data embedded in >> mbuf, that can be composed of several segments. >> >> This function will be used by the virtio pmd in next commits to calculate >> the checksum in software in case the protocol is not recognized. >> >> 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 | 55 >> ++++++++++++++++++++++++++++++++-- >> lib/librte_mbuf/rte_mbuf.h | 13 ++++++++ >> lib/librte_mbuf/rte_mbuf_version.map | 1 + >> 4 files changed, 72 insertions(+), 2 deletions(-) >> >> diff --git a/doc/guides/rel_notes/release_16_11.rst >> b/doc/guides/rel_notes/release_16_11.rst >> index 6a591e2..da70f3b 100644 >> --- a/doc/guides/rel_notes/release_16_11.rst >> +++ b/doc/guides/rel_notes/release_16_11.rst >> @@ -53,6 +53,11 @@ New Features >> Added two new functions ``rte_get_rx_ol_flag_list()`` and >> ``rte_get_tx_ol_flag_list()`` to dump offload flags as a string. >> >> +* **Added a functions to calculate the checksum of data in a mbuf.** >> + >> + Added a new function ``rte_pktmbuf_cksum()`` to process the checksum >> + of data embedded in an mbuf chain. >> + >> Resolved Issues >> --------------- >> >> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index >> 56f37e6..0304245 100644 >> --- a/lib/librte_mbuf/rte_mbuf.c >> +++ b/lib/librte_mbuf/rte_mbuf.c >> @@ -60,6 +60,7 @@ >> #include <rte_hexdump.h> >> #include <rte_errno.h> >> #include <rte_memcpy.h> >> +#include <rte_ip.h> > > As a nit, do we need to introduce a dependency for librte_mbuf on librte_net? > Might be better to put this functionality into librte_net?
I tried to have this code in librte_net, also when working on the software packet type parser, and it did not really convince me, mainly because librte_net is just header files as of today (it's not a real library). But I can give it a try and post a patch so we can compare, probably not in the coming days, but I keep a note on it. Also, as I answered to Don, it would make less sense to move software packet type parser in librte_net, since it's not a network feature but more a dpdk mbuf feature. But software packet type needs network headers definitions... so the cat is eating its tail ;) Regards, Olivier