lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230802124335.b52l4bv4qemrer63@skbuf>
Date: Wed, 2 Aug 2023 15:43:35 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: Kurt Kanzenbach <kurt@...utronix.de>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Jamal Hadi Salim <jhs@...atatu.com>,
	Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>,
	Vinicius Costa Gomes <vinicius.gomes@...el.com>,
	linux-kernel@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
	Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>,
	Peilin Ye <yepeilin.cs@...il.com>,
	Pedro Tammela <pctammela@...atatu.com>,
	Richard Cochran <richardcochran@...il.com>,
	Zhengchao Shao <shaozhengchao@...wei.com>,
	Maxim Georgiev <glipus@...il.com>
Subject: Re: [PATCH v3 net-next 06/10] net: ptp: create a mock-up PTP
 Hardware Clock driver

Hi Kurt,

On Wed, Aug 02, 2023 at 02:18:10PM +0200, Kurt Kanzenbach wrote:
> > +static u64 mock_phc_cc_read(const struct cyclecounter *cc)
> > +{
> > +	return ktime_to_ns(ktime_get_raw());
> 
> Maybe return ktime_get_raw_ns()?

Maybe.. Didn't notice that there's a helper which does exactly this.

> > +}
> > +
> > +static int mock_phc_adjfine(struct ptp_clock_info *info, long scaled_ppm)
> > +{
> > +	struct mock_phc *phc = info_to_phc(info);
> > +	s64 adj;
> > +
> > +	adj = (s64)scaled_ppm << MOCK_PHC_FADJ_SHIFT;
> > +	adj = div_s64(adj, MOCK_PHC_FADJ_DENOMINATOR);
> > +
> > +	spin_lock_bh(&mock_phc_lock);
> 
> Why spin_lock_bh()? What's executed in bh context here? The PTP aux
> worker runs in thread context.

Correct, thanks for spotting. This is a left-over from some other
(unsubmitted) functionality I was working on. In the submitted variant,
nothing runs in softirq context, and thus, bottom halves don't need to
be disabled.

If there's nothing functionally broken, I think I'd prefer to address
both comments with follow-up patches rather than respinning this 10-patch
series. The build testing for this series still has not finished yet,
since yesterday.

Thanks for reviewing.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ