[dpdk-dev] [PATCH 04/12] mbuf: add function to calculate a checksum

Ananyev, Konstantin konstantin.ananyev at intel.com
Thu Jul 21 12:51:26 CEST 2016


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?
Konstantin



More information about the dev mailing list