qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v11 2/5] iovec checksum calculation fuction


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v11 2/5] iovec checksum calculation fuction
Date: Mon, 25 Feb 2013 21:37:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

Am 25.02.2013 21:11, schrieb Dmitry Fleytman:
> Signed-off-by: Dmitry Fleytman <address@hidden>
> Signed-off-by: Yan Vugenfirer <address@hidden>
> ---
>  include/net/checksum.h |  8 ++++++++
>  net/checksum.c         | 28 ++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
> 
> diff --git a/include/net/checksum.h b/include/net/checksum.h
> index 3e7b93d..b1cf18a 100644
> --- a/include/net/checksum.h
> +++ b/include/net/checksum.h
> @@ -19,6 +19,7 @@
>  #define QEMU_NET_CHECKSUM_H
>  
>  #include <stdint.h>
> +#include "qemu-common.h"

Eduardo has worked hard to resolve circular qemu-common.h dependencies!
Are you sure you are not reintroducing one here? What do you actually
need out of it? You already have stdint.h for uint32_t, and struct iovec
is used as pointer so you shouldn't need its internals from
qemu-common.h here and can include it from checksum.c instead.

>  
>  uint32_t net_checksum_add_cont(int len, uint8_t *buf, int seq);
>  uint16_t net_checksum_finish(uint32_t sum);
> @@ -38,4 +39,11 @@ net_raw_checksum(uint8_t *data, int length)
>      return net_checksum_finish(net_checksum_add(length, data));
>  }
>  
> +/**
 * net_checksum_add_iov:
 * @iov: ...
 * @iov_cnt: ...
 * @iov_off: ...
 * @size: ...
 *
> + * Checksum calculation for scatter-gather vector
> + */
> +uint32_t net_checksum_add_iov(const struct iovec *iov,
> +                              const unsigned int iov_cnt,
> +                              uint32_t iov_off, uint32_t size);
> +
>  #endif /* QEMU_NET_CHECKSUM_H */
[snip]

The subject is also improvable: "net: ", an appropriate verb and a typo.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]