Netdev List
 help / color / mirror / Atom feed
From: Fugang Duan <b38611@freescale.com>
To: <m.grzeschik@pengutronix.de>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <kernel@pengutronix.de>,
	<b38611@freescale.com>
Subject: [PATCH] net: fec: fix receive VLAN CTAG HW acceleration issue
Date: Tue, 10 Mar 2015 18:30:42 +0800	[thread overview]
Message-ID: <1425983442-21302-1-git-send-email-b38611@freescale.com> (raw)

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.

Reported-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 9bb6220..c9b1dbb 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1475,12 +1475,14 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
 			/* Push and remove the vlan tag */
 			struct vlan_hdr *vlan_header =
 					(struct vlan_hdr *) (data + ETH_HLEN);
+			unsigned char eth_hdr[12];
 			vlan_tag = ntohs(vlan_header->h_vlan_TCI);
 
 			vlan_packet_rcvd = true;
 
+			memcpy(eth_hdr, data, 2 * ETH_ALEN);
 			skb_copy_to_linear_data_offset(skb, VLAN_HLEN,
-						       data, (2 * ETH_ALEN));
+						       eth_hdr, (2 * ETH_ALEN));
 			skb_pull(skb, VLAN_HLEN);
 		}
 
-- 
1.7.8

             reply	other threads:[~2015-03-10 10:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 10:30 Fugang Duan [this message]
2015-03-10 11:04 ` [PATCH] net: fec: fix receive VLAN CTAG HW acceleration issue Michael Grzeschik
2015-03-10 11:13   ` fugang.duan
2015-03-10 16:40 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425983442-21302-1-git-send-email-b38611@freescale.com \
    --to=b38611@freescale.com \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=m.grzeschik@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox