[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200531211924.GA8465@amd>
Date: Sun, 31 May 2020 23:19:25 +0200
From: Pavel Machek <pavel@....cz>
To: Sasha Levin <sashal@...nel.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Roman Mashak <mrv@...atatu.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH AUTOSEL 5.4 07/26] net sched: fix reporting the
first-time use timestamp
Hi!
> From: Roman Mashak <mrv@...atatu.com>
>
> [ Upstream commit b15e62631c5f19fea9895f7632dae9c1b27fe0cd ]
>
> When a new action is installed, firstuse field of 'tcf_t' is explicitly set
> to 0. Value of zero means "new action, not yet used"; as a packet hits the
> action, 'firstuse' is stamped with the current jiffies value.
>
> tcf_tm_dump() should return 0 for firstuse if action has not yet been hit.
> @@ -69,7 +69,8 @@ static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
> {
> dtm->install = jiffies_to_clock_t(jiffies - stm->install);
> dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse);
> - dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse);
> + dtm->firstuse = stm->firstuse ?
> + jiffies_to_clock_t(jiffies - stm->firstuse) : 0;
> dtm->expires = jiffies_to_clock_t(stm->expires);
> }
Jiffies start at small negative value (and are expected to overflow
periodically). This code will not work correctly in that case.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists