netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] pch_gbe: vlan skb len fix
@ 2012-07-26 16:01 Andy Cress
  2012-07-26 21:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Cress @ 2012-07-26 16:01 UTC (permalink / raw)
  To: netdev


pch_gbe_xmit_frame skb->len verification was incorrect in vlan case 
causing bogus transfer length errors.  One correction could be:
    offset = skb->protocol == htons(ETH_P_8021Q) ? 0 : 4;
    if (unlikely(skb->len > (adapter->hw.mac.max_frame_size - offset))) 
However, this verification is not necessary, so remove it.

Signed-off-by: Andy Cress <andy.cress@us.kontron.com>

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 000ef68..817614c 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2157,13 +2157,6 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
 	unsigned long flags;
 
-	if (unlikely(skb->len > (adapter->hw.mac.max_frame_size - 4))) {
-		pr_err("Transfer length Error: skb len: %d > max: %d\n",
-		       skb->len, adapter->hw.mac.max_frame_size);
-		dev_kfree_skb_any(skb);
-		adapter->stats.tx_length_errors++;
-		return NETDEV_TX_OK;
-	}
 	if (!spin_trylock_irqsave(&tx_ring->tx_lock, flags)) {
 		/* Collision - tell upper layer to requeue */
 		return NETDEV_TX_LOCKED;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] pch_gbe: vlan skb len fix
  2012-07-26 16:01 [PATCH 3/3] pch_gbe: vlan skb len fix Andy Cress
@ 2012-07-26 21:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-07-26 21:31 UTC (permalink / raw)
  To: andycress; +Cc: netdev

From: Andy Cress <andycress@gmail.com>
Date: Thu, 26 Jul 2012 12:01:17 -0400

> 
> pch_gbe_xmit_frame skb->len verification was incorrect in vlan case 
> causing bogus transfer length errors.  One correction could be:
>     offset = skb->protocol == htons(ETH_P_8021Q) ? 0 : 4;
>     if (unlikely(skb->len > (adapter->hw.mac.max_frame_size - offset))) 
> However, this verification is not necessary, so remove it.
> 
> Signed-off-by: Andy Cress <andy.cress@us.kontron.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-26 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-26 16:01 [PATCH 3/3] pch_gbe: vlan skb len fix Andy Cress
2012-07-26 21:31 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).