From 4dbe3951c0eaa0204512d1c735abf3e3582ccb6f Mon Sep 17 00:00:00 2001 From: kyle Date: Fri, 26 Nov 2010 11:40:07 -0500 Subject: [PATCH] r8169 fixes from sgruszka@redhat.com --- kernel.spec | 15 +++++ ...01-incorrect-identifier-for-a-8168dp.patch | 38 +++++++++++ r8169-02-fix-rx-checksum-offload.patch | 63 +++++++++++++++++++ r8169-03-_re_init-phy-on-resume.patch | 35 +++++++++++ ...ecksum-for-invalid-sctp_igmp-packets.patch | 34 ++++++++++ 5 files changed, 185 insertions(+) create mode 100644 r8169-01-incorrect-identifier-for-a-8168dp.patch create mode 100644 r8169-02-fix-rx-checksum-offload.patch create mode 100644 r8169-03-_re_init-phy-on-resume.patch create mode 100644 r8169-04-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch diff --git a/kernel.spec b/kernel.spec index c0794ad7e..aaeb6107b 100644 --- a/kernel.spec +++ b/kernel.spec @@ -856,6 +856,12 @@ Patch13704: via-ioctl-prevent-reading-uninit-memory.patch Patch13710: rtl8180-improve-signal-reporting-for-rtl8185-hardware.patch Patch13711: rtl8180-improve-signal-reporting-for-actual-rtl8180-hardware.patch +# rhbz#502974 +Patch13720: r8169-01-incorrect-identifier-for-a-8168dp.patch +Patch13721: r8169-02-fix-rx-checksum-offload.patch +Patch13722: r8169-03-_re_init-phy-on-resume.patch +Patch13723: r8169-04-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1630,6 +1636,12 @@ ApplyPatch via-ioctl-prevent-reading-uninit-memory.patch ApplyPatch rtl8180-improve-signal-reporting-for-rtl8185-hardware.patch ApplyPatch rtl8180-improve-signal-reporting-for-actual-rtl8180-hardware.patch +# rhbz#502974 +ApplyPatch r8169-01-incorrect-identifier-for-a-8168dp.patch +ApplyPatch r8169-02-fix-rx-checksum-offload.patch +ApplyPatch r8169-03-_re_init-phy-on-resume.patch +ApplyPatch r8169-04-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch + # END OF PATCH APPLICATIONS %endif @@ -2251,6 +2263,9 @@ fi %changelog +* Fri Nov 26 2010 Kyle McMartin +- r8169 fixes from sgruszka@redhat.com (#502974) + * Wed Nov 24 2010 John W. Linville - rtl8180: improve signal reporting for rtl8185 hardware - rtl8180: improve signal reporting for actual rtl8180 hardware diff --git a/r8169-01-incorrect-identifier-for-a-8168dp.patch b/r8169-01-incorrect-identifier-for-a-8168dp.patch new file mode 100644 index 000000000..0a9cf2ded --- /dev/null +++ b/r8169-01-incorrect-identifier-for-a-8168dp.patch @@ -0,0 +1,38 @@ +From sgruszka@redhat.com Fri Nov 26 08:03:41 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.34 1/4] r8169: incorrect identifier for a 8168dp +Date: Fri, 26 Nov 2010 14:03:33 +0100 + +From: Francois Romieu + +Merge error. + +commit 17c99297212a2d1b1779a08caf4b0d83a85545df upstream. + +See CFG_METHOD_8 (0x3c800000 + 0x00300000) since version 8.002.00 +of Realtek's driver. + +Signed-off-by: Francois Romieu +Cc: Hayes +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index 17382c3..289165e 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -1300,7 +1300,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp, + { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 }, + + /* 8168C family. */ +- { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 }, ++ { 0x7cf00000, 0x3cb00000, RTL_GIGA_MAC_VER_24 }, + { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 }, + { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 }, + { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 }, +-- +1.7.3.2 + diff --git a/r8169-02-fix-rx-checksum-offload.patch b/r8169-02-fix-rx-checksum-offload.patch new file mode 100644 index 000000000..345668e07 --- /dev/null +++ b/r8169-02-fix-rx-checksum-offload.patch @@ -0,0 +1,63 @@ +From sgruszka@redhat.com Fri Nov 26 08:03:42 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.34 2/4] r8169: fix rx checksum offload +Date: Fri, 26 Nov 2010 14:03:34 +0100 + +From: Eric Dumazet + +Commit adea1ac7effbddbe60a9de6d63462bfe79289e59 upstream. + +All skbs given to network stack had their ip_summed set to +CHECKSUM_NONE, while hardware said they had correct TCP/UDP checksums. +The reason is driver sets skb->ip_summed on the original skb before the +copy eventually done by copybreak. The fresh skb gets the ip_summed = +CHECKSUM_NONE value, forcing network stack to recompute checksum, and +preventing my GRO patch to work. + +Fix is to make the ip_summed setting after skb copy. + +Note : rx_copybreak current value is 16383, so all frames are copied... + +Signed-off-by: Eric Dumazet +Acked-by: Francois Romieu +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index 289165e..2f60e2d 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -4420,9 +4420,8 @@ static inline int rtl8169_fragmented_frame(u32 status) + return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag); + } + +-static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) ++static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1) + { +- u32 opts1 = le32_to_cpu(desc->opts1); + u32 status = opts1 & RxProtoMask; + + if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || +@@ -4516,8 +4515,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev, + continue; + } + +- rtl8169_rx_csum(skb, desc); +- + if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { + pci_dma_sync_single_for_device(pdev, addr, + pkt_size, PCI_DMA_FROMDEVICE); +@@ -4528,6 +4525,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, + tp->Rx_skbuff[entry] = NULL; + } + ++ rtl8169_rx_csum(skb, status); + skb_put(skb, pkt_size); + skb->protocol = eth_type_trans(skb, dev); + +-- +1.7.3.2 + diff --git a/r8169-03-_re_init-phy-on-resume.patch b/r8169-03-_re_init-phy-on-resume.patch new file mode 100644 index 000000000..05bf398ea --- /dev/null +++ b/r8169-03-_re_init-phy-on-resume.patch @@ -0,0 +1,35 @@ +From sgruszka@redhat.com Fri Nov 26 08:03:44 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.34 3/4] r8169: (re)init phy on resume +Date: Fri, 26 Nov 2010 14:03:35 +0100 + +Fix switching device to low-speed mode after resume reported in: +https://bugzilla.redhat.com/show_bug.cgi?id=502974 + +Commit fccec10b33503a2b1197c8e7a3abd30443bedb08 upstream. + +Reported-and-tested-by: Laurentiu Badea +Signed-off-by: Stanislaw Gruszka +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index 2f60e2d..7ca9d39 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -4845,6 +4845,9 @@ static int rtl8169_resume(struct device *device) + { + struct pci_dev *pdev = to_pci_dev(device); + struct net_device *dev = pci_get_drvdata(pdev); ++ struct rtl8169_private *tp = netdev_priv(dev); ++ ++ rtl8169_init_phy(dev, tp); + + if (!netif_running(dev)) + goto out; +-- +1.7.3.2 + diff --git a/r8169-04-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch b/r8169-04-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch new file mode 100644 index 000000000..dc25e56cb --- /dev/null +++ b/r8169-04-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch @@ -0,0 +1,34 @@ +From sgruszka@redhat.com Fri Nov 26 08:03:46 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.34 4/4] r8169: fix broken checksum for invalid sctp/igmp packets +Date: Fri, 26 Nov 2010 14:03:36 +0100 + +From: Shan Wei + +Commit d5d3ebe3be5c5123f2d444e186717f45284151e2 upstream. + +Signed-off-by: Shan Wei +Acked-by: Francois Romieu +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index 7ca9d39..3ec0d63 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -4425,8 +4425,7 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1) + u32 status = opts1 & RxProtoMask; + + if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || +- ((status == RxProtoUDP) && !(opts1 & UDPFail)) || +- ((status == RxProtoIP) && !(opts1 & IPFail))) ++ ((status == RxProtoUDP) && !(opts1 & UDPFail))) + skb->ip_summed = CHECKSUM_UNNECESSARY; + else + skb->ip_summed = CHECKSUM_NONE; +-- +1.7.3.2 +