summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshemminger@osdl.org <shemminger@osdl.org>2006-08-28 10:00:49 -0700
committerJeff Garzik <jeff@garzik.org>2006-08-29 17:18:30 -0400
commite07560cd4f762935968a1120168eb7d22260d85f (patch)
treefb1b41403609c550e0dffb1d6365ff8883d8e9cb
parentbb507fe11ffda19eee158ce0be42d222135b7aca (diff)
downloadop-kernel-dev-e07560cd4f762935968a1120168eb7d22260d85f.zip
op-kernel-dev-e07560cd4f762935968a1120168eb7d22260d85f.tar.gz
[PATCH] sky2: TSO mss optimization
The MSS in the transmit engine only has to change if TSO mtu changes. This means less commands to the chip when mixing TSO and regular data. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/sky2.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 2a2adc2..fe60f04 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1244,15 +1244,15 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
mss += ((skb->h.th->doff - 5) * 4); /* TCP options */
mss += (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);
mss += ETH_HLEN;
- }
- if (mss != sky2->tx_last_mss) {
- le = get_tx_le(sky2);
- le->tx.tso.size = cpu_to_le16(mss);
- le->tx.tso.rsvd = 0;
- le->opcode = OP_LRGLEN | HW_OWNER;
- le->ctrl = 0;
- sky2->tx_last_mss = mss;
+ if (mss != sky2->tx_last_mss) {
+ le = get_tx_le(sky2);
+ le->tx.tso.size = cpu_to_le16(mss);
+ le->tx.tso.rsvd = 0;
+ le->opcode = OP_LRGLEN | HW_OWNER;
+ le->ctrl = 0;
+ sky2->tx_last_mss = mss;
+ }
}
ctrl = 0;
@@ -1320,7 +1320,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
le->opcode = OP_BUFFER | HW_OWNER;
fre = sky2->tx_ring
- + RING_NEXT((re - sky2->tx_ring) + i, TX_RING_SIZE);
+ + RING_NEXT((re - sky2->tx_ring) + i, TX_RING_SIZE);
pci_unmap_addr_set(fre, mapaddr, mapping);
}
OpenPOWER on IntegriCloud