diff options
author | shemminger@osdl.org <shemminger@osdl.org> | 2006-08-28 10:00:50 -0700 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-08-29 17:18:30 -0400 |
commit | 1d179332f8918a5f4e031dc068a469283b01c4c1 (patch) | |
tree | 004d7ec6faab91cc32609dbd2d2a9de33ec39be6 /drivers/net/sky2.c | |
parent | e07560cd4f762935968a1120168eb7d22260d85f (diff) | |
download | kernel_samsung_smdk4412-1d179332f8918a5f4e031dc068a469283b01c4c1.zip kernel_samsung_smdk4412-1d179332f8918a5f4e031dc068a469283b01c4c1.tar.gz kernel_samsung_smdk4412-1d179332f8918a5f4e031dc068a469283b01c4c1.tar.bz2 |
[PATCH] sky2: optimize checksum offload information
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>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index fe60f04..eafb632 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -1280,12 +1280,17 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) 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); |