From patchwork Tue Jan 22 08:30:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 214467 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 110CE2C007C for ; Tue, 22 Jan 2013 19:30:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753864Ab3AVIab (ORCPT ); Tue, 22 Jan 2013 03:30:31 -0500 Received: from mail-ee0-f54.google.com ([74.125.83.54]:38272 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753288Ab3AVIaa (ORCPT ); Tue, 22 Jan 2013 03:30:30 -0500 Received: by mail-ee0-f54.google.com with SMTP id c41so3371105eek.13 for ; Tue, 22 Jan 2013 00:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=OIs7zPGscERpIe/vrr1MkzlS1DTIqF4dEu5OlEoHg80=; b=mtfUs49beysGtWGCIF30qIsV9noJUZ14GS34GwE722zjMeKlqCTDMnpGK+A7HrX/IB inYiBqzSiSvZg0ajtKsHXeEMLUxK2hCzXeZW4V3vZHcZZfCnfnJfBn8jFs+qSKwIzD6V ivXsillbY631Zd23jKvT8g+/7UonMMbN2lpkO64VC3izv4TyvVqyxqsv5p6t/OeBowgi Zj5CFe+6SLa12PJ5l9qGUOYSp+BQ11OI8u+2byOGXQD8SN2A2ptIKGD0APgDhFDdg5kA 4HkBy0mlTlGFwVNR1PhLdqXq6eQITrPGO+I+Nl2ERerSn+iW6cutlVQ7DohXwS9bcc2+ cg8w== X-Received: by 10.14.184.134 with SMTP id s6mr69788165eem.43.1358843429294; Tue, 22 Jan 2013 00:30:29 -0800 (PST) Received: from vostro.util.wtbts.net ([83.145.235.199]) by mx.google.com with ESMTPS id f6sm26030107eeo.7.2013.01.22.00.30.27 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jan 2013 00:30:28 -0800 (PST) From: =?UTF-8?q?Timo=20Ter=C3=A4s?= To: Francois Romieu , netdev@vger.kernel.org Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= Subject: [PATCH net] r8169: remove the obsolete and incorrect AMD workaround Date: Tue, 22 Jan 2013 10:30:35 +0200 Message-Id: <1358843435-24719-1-git-send-email-timo.teras@iki.fi> X-Mailer: git-send-email 1.8.1 In-Reply-To: <20130121234205.GA12449@electric-eye.fr.zoreil.com> References: <20130121234205.GA12449@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This was introduced in commit 6dccd16 "r8169: merge with version 6.001.00 of Realtek's r8169 driver". I did not find the version 6.001.00 online, but in 6.002.00 or any later r8169 from Realtek this hunk is no longer present. Also commit 05af214 "r8169: fix Ethernet Hangup for RTL8110SC rev d" claims to have fixed this issue otherwise. The magic compare mask of 0xfffe000 is dubious as it masks parts of the Reserved part, and parts of the VLAN tag. But this does not make much sense as the VLAN tag parts are perfectly valid there. In matter of fact this seems to be triggered with any VLAN tagged packet as RxVlanTag bit is matched. I would suspect 0xfffe0000 was intended to test reserved part only. Finally, this hunk is evil as it can cause more packets to be handled than what was NAPI quota causing net/core/dev.c: net_rx_action(): WARN_ON_ONCE(work > weight) to trigger, and mess up the NAPI state causing device to hang. As result, any system using VLANs and having high receive traffic (so that NAPI poll budget limits rtl_rx) would result in device hang. Signed-off-by: Timo Teräs Acked-by: Francois Romieu --- I decided to suggest just removal without the suggested WARN_ON_ONCE. This is because the test is incorrect as explained above, and not present anywhere else either. Oh yeah, and I'm feeling brave today ;) If acceptable, this should go to -stable too. The hunk was introduced in v2.6.23-rc1 and the alternate fix went in to v2.6.32-rc6. drivers/net/ethernet/realtek/r8169.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index ed96f30..c28bc31 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -6111,13 +6111,6 @@ process_pkt: tp->rx_stats.bytes += pkt_size; u64_stats_update_end(&tp->rx_stats.syncp); } - - /* Work around for AMD plateform. */ - if ((desc->opts2 & cpu_to_le32(0xfffe000)) && - (tp->mac_version == RTL_GIGA_MAC_VER_05)) { - desc->opts2 = 0; - cur_rx++; - } } count = cur_rx - tp->cur_rx;