RE: [RFC] r8169 : why SG / TX checksum are default disabled
From: hayeswang <hidden>
Date: 2012-07-20 02:11:35
Francois Romieu [mailto:romieu@fr.zoreil.com] [...]
A part of the apparent problem may stem from the fact that Realtek's 8168 driver claims a modified length but it does not really skb_padto... Hayes, would the patch below fix the original problem ?
According to the response from our hw engineer, it still has the problem even though you pad the packet to 60 bytes with zeroes. I would still test this patch to verify it.
quoted hunk ↗ jump to hunk
static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,@@ -5797,7 +5804,8 @@ static netdev_tx_trtl8169_start_xmit(struct sk_buff *skb, opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb)); opts[0] = DescOwn; - rtl8169_tso_csum(tp, skb, opts); + if (!rtl8169_tso_csum(tp, skb, opts)) + goto err_update_stats;
I think you should check the length of opts1 of the descriptor, too. Besides, how about the length of dma_map_xxx? Should it use the original length or the modified length?
quoted hunk ↗ jump to hunk
frags = rtl8169_xmit_frags(tp, skb, opts); if (frags < 0)@@ -5853,6 +5861,7 @@ err_dma_1: rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd); err_dma_0: dev_kfree_skb(skb); +err_update_stats: dev->stats.tx_dropped++; return NETDEV_TX_OK;
Best Regards, Hayes