From patchwork Wed Oct 29 14:48:48 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Ohly X-Patchwork-Id: 8143 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.176.167]) by ozlabs.org (Postfix) with ESMTP id A69EBDDF4F for ; Wed, 12 Nov 2008 01:57:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756122AbYKKO5L (ORCPT ); Tue, 11 Nov 2008 09:57:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756110AbYKKO5K (ORCPT ); Tue, 11 Nov 2008 09:57:10 -0500 Received: from mga03.intel.com ([143.182.124.21]:9620 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756081AbYKKO5H (ORCPT ); Tue, 11 Nov 2008 09:57:07 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 11 Nov 2008 06:57:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.33,584,1220252400"; d="scan'208";a="74251526" Received: from ecld0pohly.ikn.intel.com (HELO [172.28.75.199]) ([172.28.75.199]) by azsmga001.ch.intel.com with ESMTP; 11 Nov 2008 06:57:04 -0800 In-Reply-To: <1226414697.17450.852.camel@ecld0pohly> References: <1226414697.17450.852.camel@ecld0pohly> From: Patrick Ohly Date: Wed, 29 Oct 2008 15:48:48 +0100 Subject: [RFC PATCH 06/13] workaround: detect time stamp when command flags are expected To: netdev@vger.kernel.org Cc: Octavian Purdila , Stephen Hemminger , Ingo Oeser , Andi Kleen , John Ronciak , Eric Dumazet , Oliver Hartkopp X-Mailer: Evolution 2.22.2 Message-Id: <1226415426.31699.5.camel@ecld0pohly> Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This happens when IP_MULTICAST_LOOP is on. Apparently the time stamped packet goes through the loop device's start_hard_xmit?! TODO: find a clean solution. Signed-off-by: Patrick Ohly --- net/core/skbuff.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7d714b8..7d9f1dd 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -2574,6 +2574,13 @@ void skb_hwtstamp_tx(struct sk_buff *orig_skb, struct sk_buff *skb; int err = -ENOMEM; + /* sanity check: extra bits set => might be a real time stamp */ + if (orig_skb->tstamp.tv64 & ~(SKB_TSTAMP_TX_HARDWARE|SKB_TSTAMP_TX_HARDWARE_IN_PROGRESS|SKB_TSTAMP_TX_SOFTWARE)) { + printk(KERN_DEBUG + "skb_hwtstamp_tx: invalid command flags\n"); + return; + } + if (!sk) return;