From patchwork Wed Apr 10 12:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Polchlopek X-Patchwork-Id: 1921951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=LNWJDL5l; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VF2BJ2MJwz1yYM for ; Wed, 10 Apr 2024 22:26:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A4F1860832; Wed, 10 Apr 2024 12:26:30 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id DqiBDHVtQnEn; Wed, 10 Apr 2024 12:26:29 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BD9356088B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1712751989; bh=/XaW2oJq0ZXJWIhDupRxuMtn4y40rNJyJLRcGG/ILV4=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=LNWJDL5liNoPGoKkixJM7TdIwuBA7Q6N0FeS8MwnBP5Bg2MRChTqXVsPbQzodGe6a n/u1QfMeCT5Xjm0gXBYVYt/DEgesXKp4bF6CLwpOQ/r8OIrWrUkkux8pM9ZSqhmrON BMsU4h6r77/UXAI6wmgYbMqw87h9HFMazji5d8EH535R/NokjCM1WWr8a9XTtYqafQ iv1xbD5bbThFjS5IlqiHjjd11N9cSKkUXoXrB0PPSrvQC/TGJVhH+unAoX5m99qkgR Z5d1zHoRElvPX5ldZnaG5uk926ZKPcTT2t5R3agova9fJ+INryXAL9XjjY4S89+nv/ az3xrdbVolWvg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id BD9356088B; Wed, 10 Apr 2024 12:26:29 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id ACE621BF980 for ; Wed, 10 Apr 2024 12:26:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A5EC540635 for ; Wed, 10 Apr 2024 12:26:27 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id apAio-RSfhNy for ; Wed, 10 Apr 2024 12:26:26 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.19; helo=mgamail.intel.com; envelope-from=mateusz.polchlopek@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org A528140180 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A528140180 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by smtp2.osuosl.org (Postfix) with ESMTPS id A528140180 for ; Wed, 10 Apr 2024 12:26:26 +0000 (UTC) X-CSE-ConnectionGUID: MrRxib+yRKKXCZspJEPoHw== X-CSE-MsgGUID: kkixQCnsRGqhEUZOGxqptw== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="7982167" X-IronPort-AV: E=Sophos;i="6.07,190,1708416000"; d="scan'208";a="7982167" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 05:26:25 -0700 X-CSE-ConnectionGUID: oAZ0Rw0wTweE8C/NApTgiA== X-CSE-MsgGUID: D2lsq+FRQ6iA5ikevjMIcw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,190,1708416000"; d="scan'208";a="51760024" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa001.fm.intel.com with ESMTP; 10 Apr 2024 05:26:23 -0700 Received: from fedora.igk.intel.com (Metan_eth.igk.intel.com [10.123.220.124]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 405DD28798; Wed, 10 Apr 2024 13:26:22 +0100 (IST) From: Mateusz Polchlopek To: intel-wired-lan@lists.osuosl.org Date: Wed, 10 Apr 2024 08:16:54 -0400 Message-Id: <20240410121706.6223-1-mateusz.polchlopek@intel.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712751986; x=1744287986; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Hp1CjwTDJtidXzEYtDBFVsJk68cIcszM+43YBzlpMYs=; b=VFKUCNYUJvsm2rKoADha5NdYNf2o6IXzSjmhfYOaTi8plyrAyxzJaApw lf3pYB18gx9c5EKSzgisvLi07VWHVyBFHNqvR4o3C15Pi8+RksNWG5PIA sZKWrr5Kaifwcsxd1oWzQ2gY9uR4M3a31Rfd0oYIxBtjmYHInJPhsfONd 3Ftxyr/fiMZw3UAN2PZoFUCk1Kxwz8279qkMMzasBg1YgSdp6I6lQGdZP dNrd+kOkAApa++s3iZVurK0GSQeGs3jTX5vCm4sH58H5Se0hT4iPCVML8 QI/TZNN8iEc5ZF3cEXR7wf5SJVtkNBSYLTrehIbzZQqWGevUbiUIzVANm A==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=VFKUCNYU Subject: [Intel-wired-lan] [PATCH iwl-next v4 00/12] Add support for Rx timestamping for both ice and iavf drivers. X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, horms@kernel.org, Mateusz Polchlopek Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Initially, during VF creation it registers the PTP clock in the system and negotiates with PF it's capabilities. In the meantime the PF enables the Flexible Descriptor for VF. Only this type of descriptor allows to receive Rx timestamps. Enabling virtual clock would be possible, though it would probably perform poorly due to the lack of direct time access. Enable timestamping should be done using SIOCSHWTSTAMP ioctl, e.g. hwstamp_ctl -i $VF -r 14 In order to report the timestamps to userspace, the VF extends timestamp to 40b. To support this feature the flexible descriptors and PTP part in iavf driver have been introduced. --- v4: - fixed duplicated argument in iavf_virtchnl.c reported by coccicheck v3: - added RB in commit 6 - removed inline keyword in commit 9 - fixed sparse issues in commit 9 and commit 10 - used GENMASK_ULL when possible in commit 9 https://lore.kernel.org/netdev/20240403131927.87021-1-mateusz.polchlopek@intel.com/ v2: - fixed warning related to wrong specifier to dev_err_once in commit 7 - fixed warnings related to unused variables in commit 9 https://lore.kernel.org/netdev/20240327132543.15923-1-mateusz.polchlopek@intel.com/ v1: - initial series https://lore.kernel.org/netdev/20240326115116.10040-1-mateusz.polchlopek@intel.com/ --- Jacob Keller (10): virtchnl: add support for enabling PTP on iAVF virtchnl: add enumeration for the rxdid format iavf: add support for negotiating flexible RXDID format iavf: negotiate PTP capabilities iavf: add initial framework for registering PTP clock iavf: add support for indirect access to PHC time iavf: periodically cache PHC time iavf: refactor iavf_clean_rx_irq to support legacy and flex descriptors iavf: handle SIOCSHWTSTAMP and SIOCGHWTSTAMP iavf: add support for Rx timestamps to hotpath Mateusz Polchlopek (1): iavf: Implement checking DD desc field Simei Su (1): ice: support Rx timestamp on flex descriptor drivers/net/ethernet/intel/iavf/Makefile | 3 +- drivers/net/ethernet/intel/iavf/iavf.h | 33 +- drivers/net/ethernet/intel/iavf/iavf_main.c | 242 +++++++- drivers/net/ethernet/intel/iavf/iavf_ptp.c | 530 ++++++++++++++++++ drivers/net/ethernet/intel/iavf/iavf_ptp.h | 46 ++ drivers/net/ethernet/intel/iavf/iavf_txrx.c | 424 +++++++++++--- drivers/net/ethernet/intel/iavf/iavf_txrx.h | 26 +- drivers/net/ethernet/intel/iavf/iavf_type.h | 150 +++-- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 236 ++++++++ drivers/net/ethernet/intel/ice/ice_base.c | 3 - drivers/net/ethernet/intel/ice/ice_ptp.c | 4 +- drivers/net/ethernet/intel/ice/ice_ptp.h | 2 + drivers/net/ethernet/intel/ice/ice_vf_lib.h | 2 + drivers/net/ethernet/intel/ice/ice_virtchnl.c | 86 ++- drivers/net/ethernet/intel/ice/ice_virtchnl.h | 2 + .../intel/ice/ice_virtchnl_allowlist.c | 6 + include/linux/avf/virtchnl.h | 127 ++++- 17 files changed, 1761 insertions(+), 161 deletions(-) create mode 100644 drivers/net/ethernet/intel/iavf/iavf_ptp.c create mode 100644 drivers/net/ethernet/intel/iavf/iavf_ptp.h