From: Eric Dumazet
Date: Tue, 30 Oct 2018 00:57:25 -0700
> As shown by Dmitris, we need to use csum_block_add() instead of csum_add()
> when adding the FCS contribution to skb csum.
>
> Before 4.18 (more exactly commit 88078d98d1bb "net: pskb_trim_rcsum()
> and CHECKSUM_COMPLETE are friends"), t
On 10/30/2018 9:57 AM, Eric Dumazet wrote:
> As shown by Dmitris, we need to use csum_block_add() instead of csum_add()
> when adding the FCS contribution to skb csum.
>
> Before 4.18 (more exactly commit 88078d98d1bb "net: pskb_trim_rcsum()
> and CHECKSUM_COMPLETE are friends"), the whole skb c
On Tue, Oct 30, 2018 at 11:59 AM Cong Wang wrote:
> I wonder how compiler recognizes it as "never fail" when marked with
> __must_check.
__must_check means that you can not ignore the return value of a function.
Here we do use the return value.
Also prior code was not checking skb->length so r
On Tue, Oct 30, 2018 at 11:42 AM Eric Dumazet wrote:
>
> On Tue, Oct 30, 2018 at 11:09 AM Cong Wang wrote:
>
> > At least skb_header_pointer() is marked as __must_check, I don't see
> > you check its return value here.
>
> This can not fail here.
>
> skb->length must be above 14+4 at this point.
From: Cong Wang
Date: Tue, 30 Oct 2018 11:09:21 -0700
> On Tue, Oct 30, 2018 at 12:57 AM Eric Dumazet wrote:
>> -static __be32 mlx5e_get_fcs(struct sk_buff *skb)
>> +static u32 mlx5e_get_fcs(const struct sk_buff *skb)
>> {
>> - int last_frag_sz, bytes_in_prev, nr_frags;
>> - u8 *fcs
On Tue, Oct 30, 2018 at 11:09 AM Cong Wang wrote:
> At least skb_header_pointer() is marked as __must_check, I don't see
> you check its return value here.
This can not fail here.
skb->length must be above 14+4 at this point.
My compiler seems to be okay with that.
On Tue, Oct 30, 2018 at 12:57 AM Eric Dumazet wrote:
> -static __be32 mlx5e_get_fcs(struct sk_buff *skb)
> +static u32 mlx5e_get_fcs(const struct sk_buff *skb)
> {
> - int last_frag_sz, bytes_in_prev, nr_frags;
> - u8 *fcs_p1, *fcs_p2;
> - skb_frag_t *last_frag;
> - __be32
As shown by Dmitris, we need to use csum_block_add() instead of csum_add()
when adding the FCS contribution to skb csum.
Before 4.18 (more exactly commit 88078d98d1bb "net: pskb_trim_rcsum()
and CHECKSUM_COMPLETE are friends"), the whole skb csum was thrown away,
so RXFCS changes were ignored.
Th