Commit 372b616b authored by Russell King's avatar Russell King

Back out smc91x late collision "performance" hack.

Apparantly, the reason for this change is that it gives "much less
NFS stalls with a SMC91C96 on a 10/100MB switch."

Alan Cox's comments on this is:
"spec says 16 collision retries max _ever_.  I bet his 'broken
switch' is a case of half v full duplex" and a recommendation to
remove it.

Also, since the change does not limit the number of times we may
retry to send the packet, I think this code opens a potential DoS
attack against network which has a machine connected running this
code.
parent 9fd1d0c7
......@@ -693,18 +693,20 @@ static void smc_tx(struct net_device *dev)
if (tx_status & TS_LOSTCAR)
lp->stats.tx_carrier_errors++;
SMC_WAIT_MMU_BUSY();
if (tx_status & TS_LATCOL) {
PRINTK("%s: late collision occurred on last xmit\n", dev->name);
lp->stats.tx_window_errors++;
/* It's really cheap to requeue the pkt here */
SMC_SET_MMU_CMD( MC_ENQUEUE );
} else {
/* kill the packet */
SMC_SET_MMU_CMD(MC_FREEPKT);
if (!(lp->stats.tx_window_errors & 63) && net_ratelimit()) {
printk(KERN_INFO "%s: unexpectedly large numbers of "
"late collisions. Please check duplex "
"setting.\n", dev->name);
}
}
/* kill the packet */
SMC_WAIT_MMU_BUSY();
SMC_SET_MMU_CMD(MC_FREEPKT);
/* Don't restore Packet Number Reg until busy bit is cleared */
SMC_WAIT_MMU_BUSY();
SMC_SET_PN(saved_packet);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment