netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Yang <leoli@freescale.com>
To: davem@davemloft.net
Cc: shemminger@vyatta.com, netdev@vger.kernel.org,
	Li Yang <leoli@freescale.com>
Subject: [PATCH] gianfar: only check headroom when FCB is needed
Date: Fri, 27 Mar 2009 16:01:30 +0800	[thread overview]
Message-ID: <1238140890-26058-1-git-send-email-leoli@freescale.com> (raw)
In-Reply-To: <2a27d3730903262126v1a0282a5u6c8ee234dff8708d@mail.gmail.com>

Signed-off-by: Li Yang <leoli@freescale.com>
---
 drivers/net/gianfar.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 14f9b5e..6e28088 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1277,8 +1277,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	base = priv->tx_bd_base;
 
-	/* make space for additional header */
-	if (skb_headroom(skb) < GMAC_FCB_LEN) {
+	/* make space for additional header when fcb is needed */
+	if (((skb->ip_summed == CHECKSUM_PARTIAL) ||
+			(priv->vlgrp && vlan_tx_tag_present(skb))) &&
+			(skb_headroom(skb) < GMAC_FCB_LEN)) {
 		struct sk_buff *skb_new;
 
 		skb_new = skb_realloc_headroom(skb, GMAC_FCB_LEN);
-- 
1.5.4


  parent reply	other threads:[~2009-03-27  8:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26  0:21 gianfar: reallocate skb when headroom is not enough for fcb David Miller
2009-03-26 17:08 ` [PATCH] gianfar: fix headroom expansion code Stephen Hemminger
2009-03-27  4:26   ` Li Yang
2009-03-27  7:39     ` David Miller
2009-03-27  8:06       ` Li Yang
2009-03-27  8:11         ` David Miller
2009-03-27  8:01     ` Li Yang [this message]
2009-03-27 22:54       ` [PATCH] gianfar: only check headroom when FCB is needed David Miller
2009-03-27  7:38   ` [PATCH] gianfar: fix headroom expansion code 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=1238140890-26058-1-git-send-email-leoli@freescale.com \
    --to=leoli@freescale.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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;
as well as URLs for NNTP newsgroup(s).