Netdev List
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: David Ahern <dsahern@kernel.org>, netdev@vger.kernel.org
Cc: Petr Oros <poros@redhat.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH iproute2-next 2/2] dpll: add fractional-frequency-offset to parent-device
Date: Fri, 15 May 2026 18:57:33 +0200	[thread overview]
Message-ID: <b84f93c8-d97f-4979-b863-f0cca75f4b0d@redhat.com> (raw)
In-Reply-To: <90c9c8cb-f547-4e60-8ce9-5e54fc38cb37@kernel.org>



On 5/15/26 5:58 PM, David Ahern wrote:
> On 5/13/26 8:51 AM, Ivan Vecera wrote:
>> +static void dpll_pr_ffo(struct nlattr **tb, bool top_level)
>> +{
>> +	const char *fmt;
>> +
>> +	if (json || !tb[DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET_PPT]) {
>> +		if (top_level)
>> +			fmt = "  fractional-frequency-offset: %" PRId64 " ppm\n";
>> +		else
>> +			fmt = " fractional-frequency-offset %" PRId64 " ppm";
>> +		DPLL_PR_SINT_FMT(tb, DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET,
>> +				 "fractional-frequency-offset", fmt);
>> +	}
>> +	if (top_level)
>> +		fmt = "  fractional-frequency-offset: %" PRId64 " ppt\n";
>> +	else
>> +		fmt = " fractional-frequency-offset %" PRId64 " ppt";
>> +	DPLL_PR_SINT_FMT(tb, DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET_PPT,
>> +			 "fractional-frequency-offset-ppt", fmt);
> 
> something is not lining up for me: the attribute is
> DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET_PPT here but the fmt statement is
> still fractional-frequency-offset and yet name is
> fractional-frequency-offset-ppt.

Both attributes with and without _PPT suffix is the same, they differ in
unit. Logic is following:

For non-JSON (human readable) output:
If both FFO and FFO_PPT are present then only more precise FFO_PPT is
printed (with suffix 'ppt').
If only FFO is present then it is printed (with suffix 'ppm').

For JSON output:
Both are printed if they are both present... To distinguish between them
in the json output we have to use fractional-frequency-offset and
fractional-frequency-offset-ppt.

> Also why the use of DPLL_PR_SINT_FMT instead of DPLL_PR_SINT which
> avoids the extra fmt argument?

To add correct unit in non-JSON output.

Thanks,
Ivan


  reply	other threads:[~2026-05-15 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 14:51 [PATCH iproute2-next 0/2] dpll: add pin operstate and fractional frequency offset to parent-device Ivan Vecera
2026-05-13 14:51 ` [PATCH iproute2-next 1/2] dpll: add pin operstate attribute support Ivan Vecera
2026-05-13 14:51 ` [PATCH iproute2-next 2/2] dpll: add fractional-frequency-offset to parent-device Ivan Vecera
2026-05-15 15:58   ` David Ahern
2026-05-15 16:57     ` Ivan Vecera [this message]
2026-05-15 19:30 ` [PATCH iproute2-next 0/2] dpll: add pin operstate and fractional frequency offset " patchwork-bot+netdevbpf

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=b84f93c8-d97f-4979-b863-f0cca75f4b0d@redhat.com \
    --to=ivecera@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=poros@redhat.com \
    --cc=stephen@networkplumber.org \
    /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