From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Claudiu Beznea" <claudiu.beznea.uj@bp.renesas.com>,
"Paul Barker" <paul.barker.ct@bp.renesas.com>,
"Biju Das" <biju.das.jz@bp.renesas.com>,
"Lad Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
netdev@vger.kernel.org
Cc: <linux-renesas-soc@vger.kernel.org>
Subject: Re: [net-next] net: ravb: Only advertise Rx/Tx timestamps if hardware supports it
Date: Tue, 8 Oct 2024 20:26:21 +0300 [thread overview]
Message-ID: <6737d975-cf87-452b-92b2-abc7141a98cd@omp.ru> (raw)
In-Reply-To: <a733e3df-1fc3-41a1-9025-0eb02c5ffd0a@omp.ru>
On 10/7/24 10:05 PM, Sergey Shtylyov wrote:
[...]
>> Recent work moving the reporting of Rx software timestamps to the core
>> [1] highlighted an issue where hardware time stamping where advertised
>> for the platforms where it is not supported.
>>
>> Fix this by covering advertising support for hardware timestamps only if
>> the hardware supports it. Due to the Tx implementation in RAVB software
>> Tx timestamping is also only considered if the hardware supports
>> hardware timestamps. This should be addressed in future, but this fix
>> only reflects what the driver currently implements.
>>
>> 1. Commit 277901ee3a26 ("ravb: Remove setting of RX software timestamp")
>>
>> Fixes: 7e09a052dc4e ("ravb: Exclude gPTP feature support for RZ/G2L")
>> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> [...]
>
> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>> index d2a6518532f3..907af4651c55 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -1750,20 +1750,19 @@ static int ravb_get_ts_info(struct net_device *ndev,
>> struct ravb_private *priv = netdev_priv(ndev);
>> const struct ravb_hw_info *hw_info = priv->info;
>>
>> - info->so_timestamping =
>> - SOF_TIMESTAMPING_TX_SOFTWARE |
>> - SOF_TIMESTAMPING_TX_HARDWARE |
>> - SOF_TIMESTAMPING_RX_HARDWARE |
>> - SOF_TIMESTAMPING_RAW_HARDWARE;
>> - info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
>> - info->rx_filters =
>> - (1 << HWTSTAMP_FILTER_NONE) |
>> - (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
>> - (1 << HWTSTAMP_FILTER_ALL);
>> - if (hw_info->gptp || hw_info->ccc_gac)
>> + if (hw_info->gptp || hw_info->ccc_gac) {
>> + info->so_timestamping =
>> + SOF_TIMESTAMPING_TX_SOFTWARE |
>> + SOF_TIMESTAMPING_TX_HARDWARE |
>> + SOF_TIMESTAMPING_RX_HARDWARE |
>> + SOF_TIMESTAMPING_RAW_HARDWARE;
>> + info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
>> + info->rx_filters =
>> + (1 << HWTSTAMP_FILTER_NONE) |
>> + (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
>> + (1 << HWTSTAMP_FILTER_ALL);
>> info->phc_index = ptp_clock_index(priv->ptp.clock);
>> - else
>> - info->phc_index = 0;
>
> Is it OK to remove this line?
Also, how about inverting the *if* condition above (and doing an early
*return*) and avoiding reindenting the code below it?
[...]
MBR, Sergey
next prev parent reply other threads:[~2024-10-08 17:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-05 12:14 [net-next] net: ravb: Only advertise Rx/Tx timestamps if hardware supports it Niklas Söderlund
2024-10-07 9:23 ` Paul Barker
2024-10-07 19:05 ` Sergey Shtylyov
2024-10-08 17:26 ` Sergey Shtylyov [this message]
2024-10-08 17:45 ` Niklas Söderlund
2024-10-08 20:35 ` Sergey Shtylyov
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=6737d975-cf87-452b-92b2-abc7141a98cd@omp.ru \
--to=s.shtylyov@omp.ru \
--cc=biju.das.jz@bp.renesas.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=pabeni@redhat.com \
--cc=paul.barker.ct@bp.renesas.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.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).