Automatic merge of /spare/repo/netdev-2.6 branch r8169-fix

authored by and committed by Jeff Garzik 910313aa b9a6eaff

+25 -6
+25 -6
drivers/net/r8169.c
··· 1585 1585 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); 1586 1586 RTL_W8(EarlyTxThres, EarlyTxThld); 1587 1587 1588 - /* For gigabit rtl8169, MTU + header + CRC + VLAN */ 1589 - RTL_W16(RxMaxSize, tp->rx_buf_sz); 1588 + /* Low hurts. Let's disable the filtering. */ 1589 + RTL_W16(RxMaxSize, 16383); 1590 1590 1591 1591 /* Set Rx Config register */ 1592 1592 i = rtl8169_rx_config | ··· 2127 2127 } 2128 2128 } 2129 2129 2130 + static inline int rtl8169_fragmented_frame(u32 status) 2131 + { 2132 + return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag); 2133 + } 2134 + 2130 2135 static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) 2131 2136 { 2132 2137 u32 opts1 = le32_to_cpu(desc->opts1); ··· 2182 2177 2183 2178 while (rx_left > 0) { 2184 2179 unsigned int entry = cur_rx % NUM_RX_DESC; 2180 + struct RxDesc *desc = tp->RxDescArray + entry; 2185 2181 u32 status; 2186 2182 2187 2183 rmb(); 2188 - status = le32_to_cpu(tp->RxDescArray[entry].opts1); 2184 + status = le32_to_cpu(desc->opts1); 2189 2185 2190 2186 if (status & DescOwn) 2191 2187 break; 2192 2188 if (status & RxRES) { 2193 - printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); 2189 + printk(KERN_INFO "%s: Rx ERROR. status = %08x\n", 2190 + dev->name, status); 2194 2191 tp->stats.rx_errors++; 2195 2192 if (status & (RxRWT | RxRUNT)) 2196 2193 tp->stats.rx_length_errors++; 2197 2194 if (status & RxCRC) 2198 2195 tp->stats.rx_crc_errors++; 2196 + rtl8169_mark_to_asic(desc, tp->rx_buf_sz); 2199 2197 } else { 2200 - struct RxDesc *desc = tp->RxDescArray + entry; 2201 2198 struct sk_buff *skb = tp->Rx_skbuff[entry]; 2202 2199 int pkt_size = (status & 0x00001FFF) - 4; 2203 2200 void (*pci_action)(struct pci_dev *, dma_addr_t, 2204 2201 size_t, int) = pci_dma_sync_single_for_device; 2202 + 2203 + /* 2204 + * The driver does not support incoming fragmented 2205 + * frames. They are seen as a symptom of over-mtu 2206 + * sized frames. 2207 + */ 2208 + if (unlikely(rtl8169_fragmented_frame(status))) { 2209 + tp->stats.rx_dropped++; 2210 + tp->stats.rx_length_errors++; 2211 + rtl8169_mark_to_asic(desc, tp->rx_buf_sz); 2212 + goto move_on; 2213 + } 2205 2214 2206 2215 rtl8169_rx_csum(skb, desc); 2207 2216 ··· 2243 2224 tp->stats.rx_bytes += pkt_size; 2244 2225 tp->stats.rx_packets++; 2245 2226 } 2246 - 2227 + move_on: 2247 2228 cur_rx++; 2248 2229 rx_left--; 2249 2230 }