From patchwork Thu Apr 8 11:13:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Y.b. Lu" X-Patchwork-Id: 418714 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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 3564BC433ED for ; Thu, 8 Apr 2021 11:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC89761106 for ; Thu, 8 Apr 2021 11:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbhDHLHd (ORCPT ); Thu, 8 Apr 2021 07:07:33 -0400 Received: from inva020.nxp.com ([92.121.34.13]:50262 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbhDHLH2 (ORCPT ); Thu, 8 Apr 2021 07:07:28 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 343321A44FE; Thu, 8 Apr 2021 13:07:16 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D63691A44F5; Thu, 8 Apr 2021 13:07:12 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A975D402BB; Thu, 8 Apr 2021 13:07:08 +0200 (CEST) From: Yangbo Lu To: netdev@vger.kernel.org Cc: Yangbo Lu , "David S . Miller" , Richard Cochran , Claudiu Manoil , Jakub Kicinski , Vladimir Oltean , Russell King Subject: [net-next, v2, 0/2] enetc: support PTP Sync packet one-step timestamping Date: Thu, 8 Apr 2021 19:13:48 +0800 Message-Id: <20210408111350.3817-1-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch-set is to add one-step timestamping support for PTP Sync packet. Since ENETC single-step register has to be configured dynamically per packet for correctionField offeset and UDP checksum update, current one-step timestamping packet has to be sent only when the last one completes transmitting on hardware. So, on the TX the patch implements below process: - For one-step timestamping packet, queue to skb queue. - Start a work to transmit skbs in queue. - For other skbs, transmit immediately. - mutex lock used to ensure the last one-step timestamping packet has already been transmitted on hardware before transmitting current one. Changes for v2: - Rebased. - Fixed issues from patchwork checks. - netif_tx_lock for one-step timestamping packet sending. Yangbo Lu (2): enetc: mark TX timestamp type per skb enetc: support PTP Sync packet one-step timestamping drivers/net/ethernet/freescale/enetc/enetc.c | 212 ++++++++++++++++-- drivers/net/ethernet/freescale/enetc/enetc.h | 24 +- .../ethernet/freescale/enetc/enetc_ethtool.c | 3 +- .../net/ethernet/freescale/enetc/enetc_hw.h | 7 + 4 files changed, 220 insertions(+), 26 deletions(-) base-commit: 3cd52c1e32fe7dfee09815ced702db9ee9f84ec9