[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ3xEMiR1aaVYJQ_Q+ZEyhxbm3vxxu7pE5e13GWfmesDZO0Yxg@mail.gmail.com>
Date: Fri, 31 Oct 2014 15:52:43 +0200
From: Or Gerlitz <gerlitz.or@...il.com>
To: Yann Ylavic <ylavic.dev@...il.com>
Cc: Or Gerlitz <ogerlitz@...lanox.com>,
"David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>,
Matan Barak <matanb@...lanox.com>,
Amir Vadai <amirv@...lanox.com>,
Saeed Mahameed <saeedm@...lanox.com>,
Shani Michaeli <shanim@...lanox.com>,
Jerry Chu <hkchu@...gle.com>
Subject: Re: [PATCH net-next 8/8] net/mlx4_en: Extend checksum offloading by
CHECKSUM COMPLETE
On Fri, Oct 31, 2014 at 2:38 AM, Yann Ylavic <ylavic.dev@...il.com> wrote:
> Hi,
>
> On Thu, Oct 30, 2014 at 5:06 PM, Or Gerlitz <ogerlitz@...lanox.com> wrote:
> [...]
>> +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.
>
>> + ((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto
>> + != htons(ETH_P_IPV6))
>> + return -1;
--
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