[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1440791217.11525.141.camel@perches.com>
Date: Fri, 28 Aug 2015 12:46:57 -0700
From: Joe Perches <joe@...ches.com>
To: clsoto@...ux.vnet.ibm.com
Cc: davem@...emloft.net, netdev@...r.kernel.org, ogerlitz@...lanox.com,
brking@...ux.vnet.ibm.com, amirv@...lanox.com,
Muhammad Mahajna <muhammadm@...lanox.com>
Subject: Re: [PATCH net-next] net/mlx4_en: Fix IPv6 csum calculation
On Fri, 2015-08-28 at 14:28 -0500, clsoto@...ux.vnet.ibm.com wrote:
> From: Carol L Soto <clsoto@...ux.vnet.ibm.com>
>
> Seeing this message with mlx4_eni with IPv6: hw csum failure
>
> Changing IPv6 csum calculation to be based on OFED 2.4 code.
> When calculate IPv6 csum based also on source and destination
> addresses.
[]
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
[]
> +static __wsum csum_ipv6_magic_nofold(const struct in6_addr *saddr,
> + const struct in6_addr *daddr,
> + __u32 len, unsigned short proto)
> +{
> + __wsum res = 0;
> +
> + res = csum_add(res, saddr->in6_u.u6_addr32[0]);
> + res = csum_add(res, saddr->in6_u.u6_addr32[1]);
> + res = csum_add(res, saddr->in6_u.u6_addr32[2]);
> + res = csum_add(res, saddr->in6_u.u6_addr32[3]);
> + res = csum_add(res, daddr->in6_u.u6_addr32[0]);
> + res = csum_add(res, daddr->in6_u.u6_addr32[1]);
> + res = csum_add(res, daddr->in6_u.u6_addr32[2]);
> + res = csum_add(res, daddr->in6_u.u6_addr32[3]);
> + res = csum_add(res, len);
> + res = csum_add(res, htonl(proto));
You should try running sparse on this code.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists