netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fugang Duan <b38611@freescale.com>
To: <b20596@freescale.com>, <davem@davemloft.net>
Cc: <ezequiel.garcia@free-electrons.com>, <netdev@vger.kernel.org>,
	<shawn.guo@linaro.org>, <bhutchings@solarflare.com>,
	<b38611@freescale.com>, <stephen@networkplumber.org>
Subject: [PATCH v1 2/6] net: fec: Enable IP header hardware checksum
Date: Fri, 30 May 2014 10:05:48 +0800	[thread overview]
Message-ID: <1401415552-2263-3-git-send-email-b38611@freescale.com> (raw)
In-Reply-To: <1401415552-2263-1-git-send-email-b38611@freescale.com>

IP header checksum is calcalated by network layer in default.
To support software TSO, it is better to use HW calculate the
IP header checksum.

FEC hw checksum feature request the checksum field in frame
is zero, otherwise the calculative CRC is not correct.

For segmentated TCP packet, HW calculate the IP header checksum again,
it doesn't bring any impact. For SW TSO, HW calculated checksum bring
better performance.

Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 96c1a07..d7c1998 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -326,6 +326,7 @@ fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
 	if (unlikely(skb_cow_head(skb, 0)))
 		return -1;
 
+	ip_hdr(skb)->check = 0;
 	*(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0;
 
 	return 0;
@@ -407,7 +408,7 @@ static int txq_submit_skb(struct sk_buff *skb, struct net_device *ndev)
 			 * are done by the kernel
 			 */
 			if (skb->ip_summed == CHECKSUM_PARTIAL)
-				ebdp->cbd_esc |= BD_ENET_TX_PINS;
+				ebdp->cbd_esc |= BD_ENET_TX_PINS | BD_ENET_TX_IINS;
 		}
 	}
 
-- 
1.7.8

  parent reply	other threads:[~2014-05-30  3:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-30  2:05 [PATCH v1 0/6] *** net: fec: Enable Software TSO to improve the tx performance *** Fugang Duan
2014-05-30  2:05 ` [PATCH v1 1/6] net: fec: Factorize the .xmit transmit function Fugang Duan
2014-05-30  2:05 ` Fugang Duan [this message]
2014-05-30  2:05 ` [PATCH v1 3/6] net: fec: Factorize feature setting Fugang Duan
2014-05-30  2:05 ` [PATCH v1 4/6] net: fec: Increase buffer descriptor entry number Fugang Duan
2014-05-30  9:10   ` David Laight
2014-05-30  9:42     ` fugang.duan
2014-05-30 13:13       ` Eric Dumazet
2014-05-30 14:01         ` ezequiel.garcia
2014-05-30 14:54           ` Eric Dumazet
2014-05-30 15:08             ` fugang.duan
2014-05-30 15:34               ` David Laight
2014-05-30 15:52                 ` fugang.duan
2014-05-30 15:58                 ` Eric Dumazet
2014-05-30 16:35                   ` ezequiel.garcia
2014-05-30 15:40               ` Eric Dumazet
2014-05-30 15:46                 ` fugang.duan
2014-05-30  2:05 ` [PATCH v1 5/6] net: fec: Add Scatter/gather support Fugang Duan
2014-05-30  4:37   ` Eric Dumazet
2014-05-30  4:48     ` fugang.duan
2014-05-30 14:26   ` Frank.Li
2014-05-30  2:05 ` [PATCH v1 6/6] net: fec: Add software TSO support Fugang Duan
2014-05-30  6:30   ` Eric Dumazet
2014-05-30  7:16     ` fugang.duan
2014-05-30 16:21       ` Eric Dumazet
2014-06-01  0:55         ` fugang.duan
2014-06-01  1:39           ` Eric Dumazet
2014-06-01  2:25             ` fugang.duan

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=1401415552-2263-3-git-send-email-b38611@freescale.com \
    --to=b38611@freescale.com \
    --cc=b20596@freescale.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=netdev@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).