Skip to content

Commit

Permalink
[PATCH] sky2: TSO mss optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
shemminger@osdl.org authored and Jeff Garzik committed Aug 29, 2006
1 parent bb507fe commit e07560c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit e07560c

Please sign in to comment.