netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jacob Keller <jacob.e.keller@intel.com>,
	Vadim Fedorenko <vadfed@meta.com>,
	Jakub Kicinski <kuba@kernel.org>,
	David Ahern <dsahern@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Alexander Duyck <alexanderduyck@fb.com>
Cc: netdev@vger.kernel.org, Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH net-next v3 1/5] eth: fbnic: add software TX timestamping support
Date: Mon, 7 Oct 2024 10:56:43 +0100	[thread overview]
Message-ID: <ac195016-a05a-4757-9876-94d076937af7@linux.dev> (raw)
In-Reply-To: <57d913bb-a320-4885-9477-a2e287f3f027@intel.com>

On 04/10/2024 23:55, Jacob Keller wrote:
> 
> 
> On 10/3/2024 5:39 AM, Vadim Fedorenko wrote:
>> Add software TX timestamping support. RX software timestamping is
>> implemented in the core and there is no need to provide special flag
>> in the driver anymore.
>>
>> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
>> ---
>>   drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c | 11 +++++++++++
>>   drivers/net/ethernet/meta/fbnic/fbnic_txrx.c    |  3 +++
>>   2 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
>> index 5d980e178941..ffc773014e0f 100644
>> --- a/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
>> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
>> @@ -6,6 +6,16 @@
>>   #include "fbnic_netdev.h"
>>   #include "fbnic_tlv.h"
>>   
>> +static int
>> +fbnic_get_ts_info(struct net_device *netdev,
>> +		  struct kernel_ethtool_ts_info *tsinfo)
>> +{
>> +	tsinfo->so_timestamping =
>> +		SOF_TIMESTAMPING_TX_SOFTWARE;
>> +
>> +	return 0;
>> +}
>> +
> 
> You could use ethtool_op_get_ts_info(), but I imagine future patches
> will update this for hardware timestamping, so I don't think thats a big
> deal.
> 
> I think you *do* still want to report SOF_TIMESTAMPING_RX_SOFTWARE and
> SOF_TIMESTAMPING_SOFTWARE to get the API correct... Perhaps that could
> be improved in the core stack though.... Or did that already get changed
> recently?

Yeah, as you found in the next mail, software RX timestamping was moved
to the core recently.

> You should also set phc_index to -1 until you have a PTP clock device.

That's definitely missing, thanks! I'll add it to the next version.

> 
>>   static void
>>   fbnic_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
>>   {
>> @@ -66,6 +76,7 @@ fbnic_get_eth_mac_stats(struct net_device *netdev,
>>   
>>   static const struct ethtool_ops fbnic_ethtool_ops = {
>>   	.get_drvinfo		= fbnic_get_drvinfo,
>> +	.get_ts_info		= fbnic_get_ts_info,
>>   	.get_eth_mac_stats	= fbnic_get_eth_mac_stats,
>>   };
>>   
>> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
>> index 6a6d7e22f1a7..8337d49bad0b 100644
>> --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
>> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
>> @@ -205,6 +205,9 @@ fbnic_tx_map(struct fbnic_ring *ring, struct sk_buff *skb, __le64 *meta)
>>   
>>   	ring->tail = tail;
>>   
>> +	/* Record SW timestamp */
>> +	skb_tx_timestamp(skb);
>> +
>>   	/* Verify there is room for another packet */
>>   	fbnic_maybe_stop_tx(skb->dev, ring, FBNIC_MAX_SKB_DESC);
>>   
> 


  parent reply	other threads:[~2024-10-07  9:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 12:39 [PATCH net-next v3 0/5] eth: fbnic: add timestamping support Vadim Fedorenko
2024-10-03 12:39 ` [PATCH net-next v3 1/5] eth: fbnic: add software TX " Vadim Fedorenko
2024-10-04 22:55   ` Jacob Keller
2024-10-04 23:18     ` Jacob Keller
2024-10-07  9:56     ` Vadim Fedorenko [this message]
2024-10-07 23:52       ` Jacob Keller
2024-10-03 12:39 ` [PATCH net-next v3 2/5] eth: fbnic: add initial PHC support Vadim Fedorenko
2024-10-04 23:05   ` Jacob Keller
2024-10-07 13:07     ` Vadim Fedorenko
2024-10-07 23:09       ` Jakub Kicinski
2024-10-07 23:49         ` Jacob Keller
2024-10-08  1:16           ` Jakub Kicinski
2024-10-07 23:57         ` Jacob Keller
2024-10-03 12:39 ` [PATCH net-next v3 3/5] eth: fbnic: add RX packets timestamping support Vadim Fedorenko
2024-10-04 23:14   ` Jacob Keller
2024-10-08 16:47     ` Vadim Fedorenko
2024-10-08 17:01       ` Jacob Keller
2024-10-08 17:13         ` Vadim Fedorenko
2024-10-04 23:18   ` Jacob Keller
2024-10-07 10:26     ` Vadim Fedorenko
2024-10-07 23:51       ` Jacob Keller
2024-10-08  9:58         ` Vadim Fedorenko
2024-10-03 12:39 ` [PATCH net-next v3 4/5] eth: fbnic: add TX " Vadim Fedorenko
2024-10-03 12:39 ` [PATCH net-next v3 5/5] eth: fbnic: add ethtool timestamping statistics Vadim Fedorenko

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=ac195016-a05a-4757-9876-94d076937af7@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=alexanderduyck@fb.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vadfed@meta.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).