From patchwork Wed Mar 27 13:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Polchlopek X-Patchwork-Id: 13606687 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 EB00712BEBE for ; Wed, 27 Mar 2024 13:34:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711546463; cv=none; b=B6oxcqODsTQgUKzCihBHmPqLmZ6CipYSZ1LISWvpSYlwRLXqvEhRCISlKjO6a+4Poz06PcA6GbVjRfibjeas7OWTc70IBeLXThFx/xNwuB1pCBrqqZM0VzJysrmBnW3sNwojmG0h4u3Fy7jZy/kIwivVMEf/nuQv4HKvlin5kR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711546463; c=relaxed/simple; bh=mGEPzcoeSqrvljN7xJlNXNxcQ7wTSdTwmHc4ZMK7vCI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=h0j7NVwM+mnmseKzrYq8yFzi6IHbztP8GESJYKv72AMRXtj1ZjAOEDgeVMScv3YLVuIdl63jPS99+1bqNKQoWMbaTolykayBJzyhqc0b10dtubT3CrzjH4eKyX/DqFwCcJ8EL6Rm7awm6xrz9GulqeXCwdHpAYe24vXuswHB/SY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AoRH7Von; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AoRH7Von" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711546462; x=1743082462; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=mGEPzcoeSqrvljN7xJlNXNxcQ7wTSdTwmHc4ZMK7vCI=; b=AoRH7VonjUoxQYQmu5JxxyFlYkJWZs+IMPGO/Qo9WAyYk9dOlF5k2kL+ yVbifemSf/3f5Pek4qBlN9OKebqyDctIx37sF27uadrxIB6qpNMEceUUC vyBl5rBKNy+8I0QdATw+bLsF+Xu8YRBlqPE8B0CTE4flXnjaBzsZ9Tqiq ct6fgWY+3XU1ESLxhCp5ctiMj2omJvn5MoY/y4lLsdKCfBqhpBzY+Bel1 ockGxqWyXL/QuHYa8TyVWU/ytsJGNwQa02ZEaDJqBZ6XlB8XSs9UcgQ8x SU2gSMUWQQ7+u+av/Ds/hXMKt2WAtHpNBnG1n/8xE68u5HT7vkWRfhQUX g==; X-CSE-ConnectionGUID: /2sTUpTBSIm6x0NJWLMnFw== X-CSE-MsgGUID: tilNxpaDSieZ4T+m8Ga9/w== X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="9608482" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="9608482" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 06:34:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,158,1708416000"; d="scan'208";a="16355707" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa009.fm.intel.com with ESMTP; 27 Mar 2024 06:34:19 -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 1FDA22819D; Wed, 27 Mar 2024 13:34:17 +0000 (GMT) From: Mateusz Polchlopek To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Mateusz Polchlopek Subject: [Intel-wired-lan] [PATCH iwl-next v2 00/12] Add support for Rx timestamping for both ice and iavf drivers. Date: Wed, 27 Mar 2024 09:25:31 -0400 Message-Id: <20240327132543.15923-1-mateusz.polchlopek@intel.com> X-Mailer: git-send-email 2.38.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. --- v2: - fixed warning related to wrong specifier to dev_err_once in commit 7 - fixed warnings related to unused variables in commit 9 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 | 422 +++++++++++--- 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 | 237 ++++++++ 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, 1760 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