Re: [PATCH net] net/mlx5e: fix csum adjustments caused by RXFCS
From: Cong Wang <hidden>
Date: 2018-10-31 03:04:03
From: Cong Wang <hidden>
Date: 2018-10-31 03:04:03
On Tue, Oct 30, 2018 at 12:57 AM Eric Dumazet [off-list ref] 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 fcs_bytes;
+ const void *fcs_bytes;
+ u32 _fcs_bytes;
- if (!skb_is_nonlinear(skb))
- return *(__be32 *)(skb->data + skb->len - ETH_FCS_LEN);
+ fcs_bytes = skb_header_pointer(skb, skb->len - ETH_FCS_LEN,
+ ETH_FCS_LEN, &_fcs_bytes);At least skb_header_pointer() is marked as __must_check, I don't see you check its return value here.