mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jay Cliburn <jacliburn@bellsouth.net>
To: jeff@garzik.org
Cc: csnook@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jay Cliburn <jacliburn@bellsouth.net>
Subject: [PATCH 06/10] atl1: use csum_start
Date: Sat,  2 Feb 2008 19:50:08 -0600	[thread overview]
Message-ID: <1202003412-4028-6-git-send-email-jacliburn@bellsouth.net> (raw)
In-Reply-To: <1202003412-4028-1-git-send-email-jacliburn@bellsouth.net>

Use skb->csum_start for tx checksum offload preparation. Also swap
the variables css and cso so they hold the intended values of csum
start and offset, respectively.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Acked-by: Chris Snook <csnook@redhat.com>
---
 drivers/net/atlx/atl1.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index f4add3c..9929822 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1347,16 +1347,17 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
 	u8 css, cso;
 
 	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
-		cso = skb_transport_offset(skb);
-		css = cso + skb->csum_offset;
-		if (unlikely(cso & 0x1)) {
+		css = (u8) (skb->csum_start - skb_headroom(skb));
+		cso = css + (u8) skb->csum_offset;
+		if (unlikely(css & 0x1)) {
+			/* L1 hardware requires an even number here */
 			dev_printk(KERN_DEBUG, &adapter->pdev->dev,
 				"payload offset not an even number\n");
 			return -1;
 		}
-		ptpd->word3 |= (cso & TPD_PLOADOFFSET_MASK) <<
+		ptpd->word3 |= (css & TPD_PLOADOFFSET_MASK) <<
 			TPD_PLOADOFFSET_SHIFT;
-		ptpd->word3 |= (css & TPD_CCSUMOFFSET_MASK) <<
+		ptpd->word3 |= (cso & TPD_CCSUMOFFSET_MASK) <<
 			TPD_CCSUMOFFSET_SHIFT;
 		ptpd->word3 |= 1 << TPD_CUST_CSUM_EN_SHIFT;
 		return true;
-- 
1.5.3.8


  parent reply	other threads:[~2008-02-03  1:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03  1:50 [PATCH 01/10] atl1: relocate atl1 driver to /drivers/net/atlx Jay Cliburn
2008-02-03  1:50 ` [PATCH 02/10] atl1: move common functions to atlx files Jay Cliburn
2008-02-03  1:50 ` [PATCH 03/10] atl1: fix broken TSO Jay Cliburn
2008-02-03  1:50 ` [PATCH 04/10] atl1: add ethtool register dump Jay Cliburn
2008-02-03  1:50 ` [PATCH 05/10] atl1: simplify tx packet descriptor Jay Cliburn
2008-02-03  1:50 ` Jay Cliburn [this message]
2008-02-03  1:50 ` [PATCH 07/10] atl1: use netif_msg Jay Cliburn
2008-02-03  1:50 ` [PATCH 08/10] atl1: print debug info if rrd error Jay Cliburn
2008-02-03  1:50 ` [PATCH 09/10] atl1: make functions static Jay Cliburn
2008-02-03  1:50 ` [PATCH 10/10] atl1: reduce forward declarations Jay Cliburn
2008-02-11 15:57   ` Jeff Garzik

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=1202003412-4028-6-git-send-email-jacliburn@bellsouth.net \
    --to=jacliburn@bellsouth.net \
    --cc=csnook@redhat.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®