[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55FF74168B2A4152AD875C000535466F@realtek.com.tw>
Date: Fri, 19 Apr 2013 15:49:55 +0800
From: hayeswang <hayeswang@...ltek.com>
To: 'Francois Romieu' <romieu@...zoreil.com>
CC: 'Stefan Bader' <stefan.bader@...onical.com>,
<netdev@...r.kernel.org>, 'nic_swsd' <nic_swsd@...ltek.com>
Subject: RE: rtl8168e-vl dropping tftp ack
Francois Romieu [mailto:romieu@...zoreil.com]
> Sent: Friday, April 19, 2013 2:14 PM
> To: Hayeswang
> Cc: 'Stefan Bader'; netdev@...r.kernel.org; nic_swsd
> Subject: Re: rtl8168e-vl dropping tftp ack
[...]
> Tentative rationale: the first missing packet (112 at
> 88.147981) is a 60
> bytes one whose tail does not contain zeroes only. Previous 60 bytes
> packets would exhibit no change of content if they were they
> generously cut or paded with zeroes.
It still has problem no matter the paded value is zeros or not, because the
length of the IP header would be modified by hw when using hw checksum.
[...]
>
> I don't get it: arp aside, the normal trace in the capture
> file exhibits no
> sub-60 bytes packet. Could you reformulate ?
>
In brief, when the packet < 60, that is skb->len < 60, the hw should pad the
packet to 60 bytes automatically. However, in my memory, the rtl8168e-vl
wouldn't do this, and the packet wouldn't be sent. Therefore, the patch would be
similar with the followings.
--- r8169.c.org 2013-04-19 22:35:40.785759473 +0800
+++ r8169.c 2013-04-19 22:38:24.227189535 +0800
@@ -5760,12 +5760,29 @@ static inline void rtl8169_tso_csum(stru
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
const struct iphdr *ip = ip_hdr(skb);
+ if (unlikely(skb->len < ETH_ZLEN &&
+ (tp->mac_version == RTL_GIGA_MAC_VER_34))) {
+ if (skb_padto(skb, ETH_ZLEN))
+ return false;
+ skb_checksum_help(skb);
+ skb_put(skb, ETH_ZLEN - skb->len);
+ return true;
+ }
+
if (ip->protocol == IPPROTO_TCP)
opts[offset] |= info->checksum.tcp;
else if (ip->protocol == IPPROTO_UDP)
opts[offset] |= info->checksum.udp;
else
WARN_ON_ONCE(1);
+ } else {
+ if (unlikely(skb->len < ETH_ZLEN &&
+ (tp->mac_version == RTL_GIGA_MAC_VER_34))) {
+ if (skb_padto(skb, ETH_ZLEN))
+ return false;
+ skb_put(skb, ETH_ZLEN - skb->len);
+ return true;
+ }
}
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists