Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2861678lqt; Tue, 23 Apr 2024 04:07:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHWnMHKmqHSaU2O6/j0ESXsPOJG6u6MvUqDhXnUF9ShPskYSySbQ5Ynlk91WY8K7yrvzsWBLMtka70yCXWJrAE3/EXIfFPf1FWj2S0ow== X-Google-Smtp-Source: AGHT+IFGNZCMiUB36nNmLDVrb5ufnPxisnRHTS9WYS4wFNBhyPArvmhdwpYzkF+tkCd7sg5j7IeH X-Received: by 2002:a50:d5d2:0:b0:56e:2a38:1fb3 with SMTP id g18-20020a50d5d2000000b0056e2a381fb3mr10975306edj.4.1713870420998; Tue, 23 Apr 2024 04:07:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713870420; cv=pass; d=google.com; s=arc-20160816; b=ITBhRoriq04xXUCfM6CdSRbTRAa0CbkVCocWdEQb9wsegMj0qDAPskxPSK0SfdnxOF jF3TQ4+tP1GziQc6K9Ssg1Q+lTQrQOjZWE9xuOe3wZ6o79rZNOgMC2fMHTpAGUqQ0QZd kdB1VdRrFmllUaA9wDyB5hD0A4Ks5yblI0iyVrnC/ovB2RHqBsZCMXy3uNrE1Y4Qjzmg dQ+KWeE0/SFQU03bBrkIjXzZa21mOna5I/2RMXjd67xtOwXKRlz9a6Zo5SZkPp9AcTBT Gj+CVhIWTDb3YCvDfnwoOmhPl+D38sHuhk3/Ui3aujEVfCbPBorvaJ1J/mR81aAOHfka kqYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=XSNBGgTi8rj9WzeNTLXIKZPG5fboAicbyYRXMZYYjpw=; fh=abVWKxRDe6uPU5XfL9iojVnD+eirCOvR8ddGkqquxBE=; b=Mv5d0htjcRqRK00JSS+OQhIq9eN1+hwcTS2x3WYUyvZ/tw8v9SZnwem4T2qi27e4T7 WQJbamSRhCwwONNG9NejMsEjs1rjzJEQgIIKAt1wCD3NlcVbwvluu6l+ANSMARBMioWQ w2dL+f5Cesv8LZYSYm46ssYaXm81wB7rZVVAOoXXXxRsT2dwYEXyolRYJE+1Jf+yjzOZ yukQG3hGYwhr3tX/czbmXi9DjdEG4HQ4wCLHDuXA2CM+zluID4vwxWHLtwBayXJ4EwUE CJnZZ1Woc+yUtFFAsC+1QMteVlT942MEDbceh5I3VQoWxH/jOqrDg570P7KR6FiFScqf jg5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qDRsJJb0; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-154946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h2-20020a056402280200b00572032a81fesi3054426ede.92.2024.04.23.04.07.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 04:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qDRsJJb0; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-154946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B64AC1F22237 for ; Tue, 23 Apr 2024 11:07:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D41067BB06; Tue, 23 Apr 2024 11:06:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="qDRsJJb0" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 424ED757EE; Tue, 23 Apr 2024 11:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713870408; cv=none; b=ZWTfVGW17S+zQtzcwCHZOpBmhL8PR2Ap0F4DOA7mZJKWFpo3dEaXcR0mWNcqnZ4KqUYec9esuCjR1XCylH0ln/G8bIUMI8ecurXjzIb/CxOZGWX59h1zAVtBbUwK/xKjF6FSkKkbZ+FkiPmKNcYJk6IF9B3797GfZYS1S8ntirY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713870408; c=relaxed/simple; bh=xi+p9Aq+rLkwX64YbZih1zn1N7OINid8fRd3s6RwH6E=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=dCpeliCI7riIWRHhVBbLvOnaa7T760NhV8gGnEWpD8szVZBUP62pD7XwSc/lvpfFkYhQw0bSzgGdDbNLyRytsGT0G5XR8A8R8ceMimZGdPu2+cF40/B5vz61wb0We1l0AjnWFyYAZhyGcM2wTLtzitF3Gx0JdRbDm1jROKCIRzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=qDRsJJb0; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 43NB6UnV073180; Tue, 23 Apr 2024 06:06:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1713870390; bh=XSNBGgTi8rj9WzeNTLXIKZPG5fboAicbyYRXMZYYjpw=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=qDRsJJb0E789F2YGFYK3VCtIe3E3IbWm/Lxji3FQ7DI0FUAK+YDgRFSuYgdO3Dw0J FNR/j+0uNUlZjjGMor/DeJxPJ+m3u7QadWfHUKQ7jWX4PKvepENSv2RzI6uuQ1Rbgm GvU0dZCA69+WZVokTG8Nnhvv+/oXp5RPYWz7LteQ= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 43NB6UJa025529 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Apr 2024 06:06:30 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 23 Apr 2024 06:06:29 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 23 Apr 2024 06:06:29 -0500 Received: from [172.24.227.88] (uda0500640.dhcp.ti.com [172.24.227.88]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 43NB6PEK039021; Tue, 23 Apr 2024 06:06:25 -0500 Message-ID: <52c7352f-a91b-3604-5ae0-88d7bb814e51@ti.com> Date: Tue, 23 Apr 2024 16:36:24 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH net] net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets Content-Language: en-US To: Paolo Abeni , , CC: , , , , , , , , Ravi Gunasekaran References: <20240419080547.10682-1-r-gunasekaran@ti.com> <4a92f794480b12c21eaeeeb66521dbe978f08414.camel@redhat.com> From: Ravi Gunasekaran In-Reply-To: <4a92f794480b12c21eaeeeb66521dbe978f08414.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Paolo, On 4/23/24 3:31 PM, Paolo Abeni wrote: > On Fri, 2024-04-19 at 13:35 +0530, Ravi Gunasekaran wrote: >> From: Jason Reeder >> >> The CPTS, by design, captures the messageType (Sync, Delay_Req, etc.) >> field from the second nibble of the PTP header which is defined in the >> PTPv2 (1588-2008) specification. In the PTPv1 (1588-2002) specification >> the first two bytes of the PTP header are defined as the versionType >> which is always 0x0001. This means that any PTPv1 packets that are >> tagged for TX timestamping by the CPTS will have their messageType set >> to 0x0 which corresponds to a Sync message type. This causes issues >> when a PTPv1 stack is expecting a Delay_Req (messageType: 0x1) >> timestamp that never appears. >> >> Fix this by checking if the ptp_class of the timestamped TX packet is >> PTP_CLASS_V1 and then matching the PTP sequence ID to the stored >> sequence ID in the skb->cb data structure. If the sequence IDs match >> and the packet is of type PTPv1 then there is a chance that the >> messageType has been incorrectly stored by the CPTS so overwrite the >> messageType stored by the CPTS with the messageType from the skb->cb >> data structure. This allows the PTPv1 stack to receive TX timestamps >> for Delay_Req packets which are necessary to lock onto a PTP Leader. >> >> Signed-off-by: Jason Reeder >> Signed-off-by: Ravi Gunasekaran > > Please provide a suitable fixes tag, thanks! am65_cpts_match_tx_ts() was added in the very first commit of the file. Would that be a suitable fixes tag? I understand that the purpose of the fixes tag is to know to which all previous kernels, the fix needs to be applied. Please let me know, if it is ok to provide first commit as fixes tag, so that I can send a v2. > > Paolo > -- Regards, Ravi