Re: [PATCH net-next 8/8] net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE
From: Or Gerlitz <hidden>
Date: 2014-10-31 13:52:44
From: Or Gerlitz <hidden>
Date: 2014-10-31 13:52:44
On Fri, Oct 31, 2014 at 2:38 AM, Yann Ylavic [off-list ref] wrote:
Hi, On Thu, Oct 30, 2014 at 5:06 PM, Or Gerlitz [off-list ref] wrote: [...]quoted
+static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, int hwtstamp_rx_filter) +{ + __wsum hw_checksum = 0; + + void *hdr = (u8 *)skb->data + sizeof(struct ethhdr); + + hw_checksum = csum_unfold((__force __sum16)cqe->checksum); + + if (((struct ethhdr *)skb->data)->h_proto == htons(ETH_P_8021Q) && + hwtstamp_rx_filter != HWTSTAMP_FILTER_NONE) { + /* next protocol non IPv4 or IPv6 */ + if (((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto + != htons(ETH_P_IP) ||Shouldn't this be a AND (&&)?
Oh, yes of course, good catch (this protects against the case of QinQ which isn't supported, so somehow passed the testing... Shani, please fix it up. Or.
quoted
+ ((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto + != htons(ETH_P_IPV6)) + return -1;