From: Simon Horman <horms@kernel.org>
To: Milena Olech <milena.olech@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Emil Tantilov <emil.s.tantilov@intel.com>,
Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Subject: Re: [PATCH v2 iwl-next 07/10] idpf: add Tx timestamp capabilities negotiation
Date: Tue, 3 Dec 2024 14:56:10 +0000 [thread overview]
Message-ID: <20241203145610.GE9361@kernel.org> (raw)
In-Reply-To: <20241126035849.6441-8-milena.olech@intel.com>
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 <aleksander.lobakin@intel.com>
> Co-developed-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Co-developed-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
> Signed-off-by: Milena Olech <milena.olech@intel.com>
> ---
> 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
>
>
next prev parent reply other threads:[~2024-12-03 14:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 3:58 [PATCH v2 iwl-next 00/10] add initial PTP support Milena Olech
2024-11-26 3:58 ` [PATCH v2 iwl-next 01/10] idpf: " Milena Olech
2024-11-26 3:58 ` [PATCH v2 iwl-next 02/10] virtchnl: add PTP virtchnl definitions Milena Olech
2024-11-26 3:58 ` [PATCH v2 iwl-next 03/10] idpf: move virtchnl structures to the header file Milena Olech
2024-11-26 3:58 ` [PATCH v2 iwl-next 04/10] idpf: negotiate PTP capabilities and get PTP clock Milena Olech
2024-11-27 15:34 ` Willem de Bruijn
2024-11-26 3:58 ` [PATCH v2 iwl-next 05/10] idpf: add mailbox access to read PTP clock time Milena Olech
2024-11-26 3:58 ` [PATCH v2 iwl-next 06/10] idpf: add PTP clock configuration Milena Olech
2024-11-26 3:58 ` [PATCH v2 iwl-next 07/10] idpf: add Tx timestamp capabilities negotiation Milena Olech
2024-11-29 15:37 ` Willem de Bruijn
2024-12-18 15:02 ` Olech, Milena
2024-12-03 14:56 ` Simon Horman [this message]
2024-12-18 15:08 ` Olech, Milena
2024-11-26 3:58 ` [PATCH v2 iwl-next 08/10] idpf: add Tx timestamp flows Milena Olech
2024-11-26 12:36 ` Vadim Fedorenko
2024-11-29 15:46 ` Willem de Bruijn
2024-12-18 15:33 ` Olech, Milena
2024-11-26 3:58 ` [PATCH v2 iwl-next 09/10] idpf: add support for Rx timestamping Milena Olech
2024-11-29 15:48 ` Willem de Bruijn
2024-12-18 15:39 ` Olech, Milena
2024-11-26 3:58 ` [PATCH v2 iwl-next 10/10] idpf: change the method for mailbox workqueue allocation Milena Olech
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241203145610.GE9361@kernel.org \
--to=horms@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=emil.s.tantilov@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pavan.kumar.linga@intel.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).