public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: shemminger@osdl.org
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 6/9] sky2: optimize checksum offload information
Date: Mon, 28 Aug 2006 10:00:50 -0700	[thread overview]
Message-ID: <20060828170218.769180424@localhost.localdomain> (raw)
In-Reply-To: 20060828170044.136391412@localhost.localdomain

[-- Attachment #1: sky2-csum-off-cache.patch --]
[-- Type: text/plain, Size: 1510 bytes --]

Since many packets have the same checksum starting offset and insertion
location; the driver can save the last information and only tell hardware
when it changes.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- sky2.orig/drivers/net/sky2.c	2006-08-28 10:00:08.000000000 -0700
+++ sky2/drivers/net/sky2.c	2006-08-28 10:00:13.000000000 -0700
@@ -1280,12 +1280,17 @@
 		if (skb->nh.iph->protocol == IPPROTO_UDP)
 			ctrl |= UDPTCP;
 
-		le = get_tx_le(sky2);
-		le->tx.csum.start = cpu_to_le16(hdr);
-		le->tx.csum.offset = cpu_to_le16(offset);
-		le->length = 0;	/* initial checksum value */
-		le->ctrl = 1;	/* one packet */
-		le->opcode = OP_TCPLISW | HW_OWNER;
+		if (hdr != sky2->tx_csum_start || offset != sky2->tx_csum_offset) {
+			sky2->tx_csum_start = hdr;
+			sky2->tx_csum_offset = offset;
+
+			le = get_tx_le(sky2);
+			le->tx.csum.start = cpu_to_le16(hdr);
+			le->tx.csum.offset = cpu_to_le16(offset);
+			le->length = 0;	/* initial checksum value */
+			le->ctrl = 1;	/* one packet */
+			le->opcode = OP_TCPLISW | HW_OWNER;
+		}
 	}
 
 	le = get_tx_le(sky2);
--- sky2.orig/drivers/net/sky2.h	2006-08-28 09:59:36.000000000 -0700
+++ sky2/drivers/net/sky2.h	2006-08-28 10:00:13.000000000 -0700
@@ -1843,6 +1843,8 @@
 	u32		     tx_addr64;
 	u16		     tx_pending;
 	u16		     tx_last_mss;
+	u16		     tx_csum_start;
+	u16		     tx_csum_offset;
 
 	struct ring_info     *rx_ring ____cacheline_aligned_in_smp;
 	struct sky2_rx_le    *rx_le;

--
Stephen Hemminger <shemminger@osdl.org>


  parent reply	other threads:[~2006-08-28 18:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-28 17:00 [PATCH 0/9] sky2 1.7 non-critical bug fixes shemminger
2006-08-28 17:00 ` [PATCH 1/9] sky2: remove cloned/pskb_expand_head check shemminger
2006-08-29 21:18   ` Jeff Garzik
2006-08-28 17:00 ` [PATCH 2/9] sky2: use netdev_alloc_skb shemminger
2006-08-28 17:00 ` [PATCH 3/9] sky2: dont use force status bit shemminger
2006-08-28 17:00 ` [PATCH 4/9] sky2: MSI test timing shemminger
2006-08-28 17:00 ` [PATCH 5/9] sky2: TSO mss optimization shemminger
2006-08-28 17:00 ` shemminger [this message]
2006-08-28 17:00 ` [PATCH 7/9] sky2: power down PHY when not up shemminger
2006-08-29 21:04   ` Jeff Garzik
2006-08-29 21:11     ` Stephen Hemminger
2006-08-28 17:00 ` [PATCH 8/9] sky2: pci post bug shemminger
2006-08-28 17:00 ` [PATCH 9/9] sky2: version 1.7 shemminger

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=20060828170218.769180424@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --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