Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
net: fec: fix receive VLAN CTAG HW acceleration issue
Browse files Browse the repository at this point in the history
[ Upstream commit af5cbc9 ]

The current driver support receive VLAN CTAG HW acceleration feature
(NETIF_F_HW_VLAN_CTAG_RX) through software simulation. There calls the
api .skb_copy_to_linear_data_offset() to skip the VLAN tag, but there
have overlap between the two memory data point range. The patch just fix
the issue.

V2:
Michael Grzeschik suggest to use memmove() instead of skb_copy_to_linear_data_offset().

Reported-by: Michael Grzeschik <[email protected]>
Fixes: 1b7bde6 ("net: fec: implement rx_copybreak to improve rx performance")
Signed-off-by: Fugang Duan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Nimrod Andy authored and sashalevin committed Mar 24, 2015
1 parent 06e0dd7 commit 563d919
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,7 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)

vlan_packet_rcvd = true;

skb_copy_to_linear_data_offset(skb, VLAN_HLEN,
data, (2 * ETH_ALEN));
memmove(skb->data + VLAN_HLEN, data, ETH_ALEN * 2);
skb_pull(skb, VLAN_HLEN);
}

Expand Down

0 comments on commit 563d919

Please sign in to comment.