From patchwork Wed Jun 15 09:55:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Cochran X-Patchwork-Id: 100503 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 680DDB6FA4 for ; Wed, 15 Jun 2011 19:55:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729Ab1FOJzW (ORCPT ); Wed, 15 Jun 2011 05:55:22 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:47658 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754348Ab1FOJzT (ORCPT ); Wed, 15 Jun 2011 05:55:19 -0400 Received: by mail-bw0-f46.google.com with SMTP id 15so311956bwz.19 for ; Wed, 15 Jun 2011 02:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=ro/2rJe6CovUZGev1MZdJOHagF9re+0nJwXTXMitBOQ=; b=cvLfs6SUVYK9nsxxnzh/Zizs6F8MBa8Ax7dGUUUjypKGZY3e5rBcyJMoqCOePHhLNu i2Y5/7kyj/qVpvUr5dmb9k27tVKchjvT0vZ2FeauI1KzERZEzy4rwqeQX8yOnH///0z5 v5F21ptpC7NkEa+Q1cFFH0FgVYsoFXpNFBE1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=UzvguiJOvUZ7FhrrVwAN9RJ4cYiqExpDN7oYhwvraLFh8M0kA/jv6Er7GiWeR5erM5 TGgGbAAJ2t7qXRc9Fiiz9l7mGvJEdoef03hk2Os50Y766bKJaxa2z8sxv32rYoDC9Fh+ KVla9u7Ir/+sfNOuwJhfus5LGeOB8CaEonInA= Received: by 10.204.151.205 with SMTP id d13mr317269bkw.117.1308131718471; Wed, 15 Jun 2011 02:55:18 -0700 (PDT) Received: from localhost.localdomain (vs162244.vserver.de [62.75.162.244]) by mx.google.com with ESMTPS id x6sm279461bkv.12.2011.06.15.02.55.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2011 02:55:16 -0700 (PDT) From: Richard Cochran To: linux-kernel@vger.kernel.org Cc: , David Miller , John Stultz , Thomas Gleixner Subject: [PATCH for 3.0-rc4 2/2] dp83640: drop PHY status frames in the driver. Date: Wed, 15 Jun 2011 11:55:20 +0200 Message-Id: X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The dp83640 PHY provides time stamp and other information via special PHY status frames. Previously, the driver decoded the frames and then let the network stack drop them. This works fine when the PTP messages come over UDP. However, when receiving PTP messages via L2 packets, this creates a problem. The status frames use the official PTP destination MAC address, and so they are delivered to user space along with the "real" frames, causing confusion for applications. This commit fixes the issue by simply dropping the PHY status frames in the driver. Signed-off-by: Richard Cochran --- drivers/net/phy/dp83640.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index ead323e..2cd8dc5 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -1044,8 +1044,8 @@ static bool dp83640_rxtstamp(struct phy_device *phydev, if (is_status_frame(skb, type)) { decode_status_frame(dp83640, skb); - /* Let the stack drop this frame. */ - return false; + kfree_skb(skb); + return true; } SKB_PTP_TYPE(skb) = type;