On Fri, 2015-08-28 at 14:28 -0500, cls...@linux.vnet.ibm.com wrote:
> From: Carol L Soto <cls...@linux.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to