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 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65665E64AB7 for ; Tue, 3 Dec 2024 14:56:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0B2F684438; Tue, 3 Dec 2024 14:56:20 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 86rF_RBLViKk; Tue, 3 Dec 2024 14:56:18 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D33C684437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1733237778; bh=eq8DWWZ55QG5F86mG4rQ1ZRcAQVL7lh9nYk30wftW7w=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=A6x/YNldcr0SaoSZcIRhie/FXsqAaC11loU2y4tXPycRm3UHe7A4Pup7mlpd8zsLK dF3o6P640EkC/z+7LAKegNV5bxlWXLxkfvCykp+eq9l+el0x6Q7uqzjDmAGsk1d5Ug XqiUuVs4JL0TwyB3nIIvU+jcsI+6RvRJcsVmTLJyf4gH7cOh52lQ9srR7LYL0XNuwp feQ3nL4NbfQp0iyVWn0CiX2EWVYbJ0q4LV0JS1gM7YclymyglUYcIWQV0N+e3J6UqC hCBLsf46uUBFm1IIynOginC2o41nfz7OAnVwevOOx4YOga51jqCbFEar9sgcImhbpg NyEGdmpdKO/7Q== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id D33C684437; Tue, 3 Dec 2024 14:56:18 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 3E82C60 for ; Tue, 3 Dec 2024 14:56:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 2C9C2605C6 for ; Tue, 3 Dec 2024 14:56:17 +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 5bDcTxm0tKqH for ; Tue, 3 Dec 2024 14:56:16 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=147.75.193.91; helo=nyc.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 318C2605AF DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 318C2605AF Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by smtp3.osuosl.org (Postfix) with ESMTPS id 318C2605AF for ; Tue, 3 Dec 2024 14:56:16 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 5B328A416B8; Tue, 3 Dec 2024 14:54:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF395C4CED6; Tue, 3 Dec 2024 14:56:12 +0000 (UTC) Date: Tue, 3 Dec 2024 14:56:10 +0000 From: Simon Horman To: Milena Olech Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, Alexander Lobakin , Emil Tantilov , Pavan Kumar Linga Message-ID: <20241203145610.GE9361@kernel.org> References: <20241126035849.6441-1-milena.olech@intel.com> <20241126035849.6441-8-milena.olech@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241126035849.6441-8-milena.olech@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733237774; bh=vzQli8dvz+E9BCqg5gOlBZoTLEI1uKbE/xAKVWFJlfc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j10rnBshmdtDmXMQ56P2qlcaD0O8YWM0HiX/kgycpwW6nY8FlwmULY3P92/gd3GAE PPkH2pDmoQQ50Uuf/5Eve8ghI8iV++W0trybzDAOF35p/M/BsO5v2SSwTHl9zkgnPd hrRw+aWFk1WBbB2MHRlWl0qKJk8J2SoncqgdRTD/60iCuNTrfuwRM1tq6GckNWmqrK UtwKc4cwR9YqO61UPaoDq+D6q4Sjitx1crWlpUlQL1dUl3ui/hQyJ32ZqmDL2gHkT0 nsKZFNlPo4RstZTCj84dCvw/E5I8wM+e/2RubSxHG7lgAf0W9xkHyskFuGNNsYaiRM pNIzsM8NlNjAA== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=j10rnBsh Subject: Re: [Intel-wired-lan] [PATCH v2 iwl-next 07/10] idpf: add Tx timestamp capabilities negotiation X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Nov 26, 2024 at 04:58:53AM +0100, Milena Olech wrote: > Tx timestamp capabilities are negotiated for the uplink Vport. > Driver receives information about the number of available Tx timestamp > latches, the size of Tx timestamp value and the set of indexes used > for Tx timestamping. > > Add function to get the Tx timestamp capabilities and parse the uplink > vport flag. > > Reviewed-by: Alexander Lobakin > Co-developed-by: Emil Tantilov > Signed-off-by: Emil Tantilov > Co-developed-by: Pavan Kumar Linga > Signed-off-by: Pavan Kumar Linga > Signed-off-by: Milena Olech > --- > v1 -> v2: change the idpf_for_each_vport macro Hi Milena, Some minor nits from my side. > diff --git a/drivers/net/ethernet/intel/idpf/idpf_ptp.h b/drivers/net/ethernet/intel/idpf/idpf_ptp.h > index e7ccdcbdbd47..057d1c546417 100644 > --- a/drivers/net/ethernet/intel/idpf/idpf_ptp.h > +++ b/drivers/net/ethernet/intel/idpf/idpf_ptp.h > @@ -83,6 +83,70 @@ struct idpf_ptp_secondary_mbx { > bool valid:1; > }; > > +/** > + * enum idpf_ptp_tx_tstamp_state - Tx timestamp states > + * @IDPF_PTP_FREE: Tx timestamp index free to use > + * @IDPF_PTP_REQUEST: Tx timestamp index set to the Tx descriptor > + * @IDPF_PTP_READ_VALUE: Tx timestamp value ready to be read > + */ > +enum idpf_ptp_tx_tstamp_state { > + IDPF_PTP_FREE, > + IDPF_PTP_REQUEST, > + IDPF_PTP_READ_VALUE, > +}; > + > +/** > + * struct idpf_ptp_tx_tstamp_status - Parameters to track Tx timestamp > + * @skb: the pointer to the SKB that received the completion tag > + * @state: the state of the Tx timestamp > + */ > +struct idpf_ptp_tx_tstamp_status { > + struct sk_buff *skb; > + enum idpf_ptp_tx_tstamp_state state; > +}; > + > +/** > + * struct idpf_ptp_tx_tstamp - Parameters for Tx timestamping > + * @list_member: the list member strutcure nit: structure Flagged by checkpatch.pl --codespell > + * @tx_latch_reg_offset_l: Tx tstamp latch low register offset > + * @tx_latch_reg_offset_h: Tx tstamp latch high register offset > + * @skb: the pointer to the SKB for this timestamp request > + * @tstamp: the Tx tstamp value > + * @idx: the index of the Tx tstamp > + */ > +struct idpf_ptp_tx_tstamp { > + struct list_head list_member; > + u32 tx_latch_reg_offset_l; > + u32 tx_latch_reg_offset_h; > + struct sk_buff *skb; > + u64 tstamp; > + u32 idx; > +}; ... > diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c ... > @@ -3154,6 +3157,14 @@ void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q) > idpf_vport_alloc_vec_indexes(vport); > > vport->crc_enable = adapter->crc_enable; > + > + if (!(vport_msg->vport_flags & > + le16_to_cpu(VIRTCHNL2_VPORT_UPLINK_PORT))) I think this should be cpu_to_le16. Flagged by Sparse. > + return; > + > + err = idpf_ptp_get_vport_tstamps_caps(vport); > + if (err) > + pci_dbg(vport->adapter->pdev, "Tx timestamping not supported\n"); > } > > /** ... > diff --git a/drivers/net/ethernet/intel/idpf/virtchnl2.h b/drivers/net/ethernet/intel/idpf/virtchnl2.h > index 44a5ee84ed60..fdeebc621bdb 100644 > --- a/drivers/net/ethernet/intel/idpf/virtchnl2.h > +++ b/drivers/net/ethernet/intel/idpf/virtchnl2.h > @@ -569,6 +569,14 @@ struct virtchnl2_queue_reg_chunks { > }; > VIRTCHNL2_CHECK_STRUCT_LEN(8, virtchnl2_queue_reg_chunks); > > +/** > + * enum virtchnl2_vport_flags - Vport flags that indicate vport capabilities. > + * @VIRTCHNL2_VPORT_UPLINK_PORT: Representatives of underlying physical ports > + */ > +enum virtchnl2_vport_flags { > + VIRTCHNL2_VPORT_UPLINK_PORT = BIT(0), > +}; > + > /** > * struct virtchnl2_create_vport - Create vport config info. > * @vport_type: See enum virtchnl2_vport_type. > @@ -620,7 +628,7 @@ struct virtchnl2_create_vport { > __le16 max_mtu; > __le32 vport_id; > u8 default_mac_addr[ETH_ALEN]; > - __le16 pad; > + __le16 vport_flags; The kernel doc for this structure, which is immediately above the structure, should also be updated. Flagged by ./scripts/kernel-doc -none > __le64 rx_desc_ids; > __le64 tx_desc_ids; > u8 pad1[72]; > -- > 2.31.1 > >