From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4732C433E1 for ; Tue, 18 Aug 2020 10:38:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CE22204EA for ; Tue, 18 Aug 2020 10:38:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="kUdsrOEV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726759AbgHRKia (ORCPT ); Tue, 18 Aug 2020 06:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbgHRKi3 (ORCPT ); Tue, 18 Aug 2020 06:38:29 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743AEC061389 for ; Tue, 18 Aug 2020 03:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=d3/YpbfHe47Dw7rokLAwJ4efmpKWs0Cup8iHReB40Jk=; b=kUdsrOEVKOrLvQ6LI8AKm3FwV KggAyBSZL6nNJFdz3GxDdYjpA+6HfcUvnPBst58vvKVbTnzEUYl1/ZuYLK146dRrf713ShBiq/X95 FWQVK8Z0BJhWEFsFvMqPMtsUi8gWtUq5auLBN6dfSdZ3B7kCYdzdDOQ7X4JmfX9Mzxa2ATY/1ZG2b jgT/nv8i2FNrQ0OsFy8/RgJTmwo8yvLDNivR/qJz7OvJaCjWzWnryvm4CE9QKri5iAstdWjZ1SuU9 1Jwdgu5W4d7EdIQTQEfVdk8jbWxfD1QTeIB9RlPC0Wc4ZSKawJFNeKdMl6mACBnvp7HtoiDroDN3Z wyxVYPWvA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:54018) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7z0G-0000Ii-8D; Tue, 18 Aug 2020 11:38:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1k7z0A-0001KX-G1; Tue, 18 Aug 2020 11:37:58 +0100 Date: Tue, 18 Aug 2020 11:37:58 +0100 From: Russell King - ARM Linux admin To: Kurt Kanzenbach Cc: Richard Cochran , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Heiner Kallweit , Grygorii Strashko , Samuel Zou , netdev@vger.kernel.org, Petr Machata , Sebastian Andrzej Siewior Subject: Re: [PATCH v4 1/9] ptp: Add generic ptp v2 header parsing function Message-ID: <20200818103758.GZ1551@shell.armlinux.org.uk> References: <20200818103251.20421-1-kurt@linutronix.de> <20200818103251.20421-2-kurt@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200818103251.20421-2-kurt@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Aug 18, 2020 at 12:32:43PM +0200, Kurt Kanzenbach wrote: > Reason: A lot of the ptp drivers - which implement hardware time stamping - need > specific fields such as the sequence id from the ptp v2 header. Currently all > drivers implement that themselves. > > Introduce a generic function to retrieve a pointer to the start of the ptp v2 > header. > > Suggested-by: Russell King > Signed-off-by: Kurt Kanzenbach > Reviewed-by: Richard Cochran > Reviewed-by: Florian Fainelli Just one small nit, see below. Otherwise, Reviewed-by: Russell King > +/** > + * ptp_parse_header - Get pointer to the PTP v2 header > + * @skb: packet buffer > + * @type: type of the packet (see ptp_classify_raw()) > + * > + * This function takes care of the VLAN, UDP, IPv4 and IPv6 headers. The length > + * is checked. > + * > + * Note, internally skb_mac_header() is used. Make sure, that the @skb is > + * initialized accordingly. No need for the "," there - these aren't separate clauses. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!