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.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 260E9C433E0 for ; Wed, 5 Aug 2020 19:11:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04F812084D for ; Wed, 5 Aug 2020 19:11:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="T8SR2HMt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728445AbgHETLu (ORCPT ); Wed, 5 Aug 2020 15:11:50 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:53462 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726831AbgHETKb (ORCPT ); Wed, 5 Aug 2020 15:10:31 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 075IqwJU062765; Wed, 5 Aug 2020 13:52:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1596653578; bh=mPHLH8mNp+iVjY7OLSuSpUU1EWSn3dk/JVXrDKmY+iQ=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=T8SR2HMtv4vZ6Fm3f/vLEvP1V+y7gdmF+WzH7R8+EaoxzNIQ+4KC0waCeSiReLYWN Ht1Mn4onAfj1+E4Dwg3C6Ioq2LDm2+/U12Irvejcns3IMnDhRrkx0eNquoJ5zPRuCy yMcg5VVQnR7Tq5VZD758TpIftVZGXudYxV9oTJy0= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 075Iqwkm111913 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Aug 2020 13:52:58 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 5 Aug 2020 13:52:58 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 5 Aug 2020 13:52:58 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 075Iqpm1001834; Wed, 5 Aug 2020 13:52:53 -0500 Subject: Re: [PATCH v3 6/9] ethernet: ti: cpts: Use generic helper function To: Florian Fainelli , Kurt Kanzenbach , Richard Cochran CC: Andrew Lunn , Vivien Didelot , "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Heiner Kallweit , Russell King , Ivan Khoronzhuk , Samuel Zou , , Petr Machata References: <20200730080048.32553-1-kurt@linutronix.de> <20200730080048.32553-7-kurt@linutronix.de> <81037828-42e0-e584-30dd-23052fa82ee9@gmail.com> From: Grygorii Strashko Message-ID: <96c57989-49bc-a0e7-2dae-e19e23be64b7@ti.com> Date: Wed, 5 Aug 2020 21:52:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <81037828-42e0-e584-30dd-23052fa82ee9@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 02/08/2020 23:22, Florian Fainelli wrote: > > > On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: >> In order to reduce code duplication between ptp drivers, generic helper >> functions were introduced. Use them. >> >> Signed-off-by: Kurt Kanzenbach >> --- > [snip] >> - if (unlikely(ptp_class & PTP_CLASS_V1)) >> - msgtype = data + offset + OFF_PTP_CONTROL; >> - else >> - msgtype = data + offset; >> + msgtype = ptp_get_msgtype(hdr, ptp_class); >> + seqid = be16_to_cpu(hdr->sequence_id); > > Same comment as patch 5 would probably apply here as well, with using > ntohs(): > > Reviewed-by: Florian Fainelli As reported in [1] this patch as is broke cpts and below diff on top restore it [1] https://lore.kernel.org/netdev/20200805152503.GB9122@hoboy/T/#mcf2bd0322805e6706ee9fe4f10805e657fd0103e -- Best regards, grygorii --------------- --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -509,6 +509,11 @@ void cpts_rx_timestamp(struct cpts *cpts, struct sk_buff *skb) int ret; u64 ns; + /* cpts_rx_timestamp() is called before eth_type_trans(), so + * skb MAC Hdr properties are not configured yet. Hence need to + * rest skb MAC header here + */ + skb_reset_mac_header(skb); ret = cpts_skb_get_mtype_seqid(skb, &skb_cb->skb_mtype_seqid); if (!ret) return;