All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Roman Mashak <mrv@mojatatu.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 07/26] net sched: fix reporting the first-time use timestamp
Date: Thu, 28 May 2020 07:56:35 -0400	[thread overview]
Message-ID: <20200528115654.1406165-7-sashal@kernel.org> (raw)
In-Reply-To: <20200528115654.1406165-1-sashal@kernel.org>

From: Roman Mashak <mrv@mojatatu.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.

Fixes: 48d8ee1694dd ("net sched actions: aggregate dumping of actions timeinfo")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/act_api.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/net/act_api.h b/include/net/act_api.h
index b18c699681ca..59d05feecfb8 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -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);
 }
 
-- 
2.25.1


  parent reply	other threads:[~2020-05-28 12:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 11:56 [PATCH AUTOSEL 5.4 01/26] ARC: Fix ICCM & DCCM runtime size checks Sasha Levin
2020-05-28 11:56 ` Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 02/26] ARC: [plat-eznps]: Restrict to CONFIG_ISA_ARCOMPACT Sasha Levin
2020-05-28 11:56   ` Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 03/26] evm: Fix RCU list related warnings Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 04/26] scsi: pm: Balance pm_only counter of request queue during system resume Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 05/26] i2c: altera: Fix race between xfer_msg and isr thread Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 06/26] io_uring: initialize ctx->sqo_wait earlier Sasha Levin
2020-05-28 11:56 ` Sasha Levin [this message]
2020-05-31 21:19   ` [PATCH AUTOSEL 5.4 07/26] net sched: fix reporting the first-time use timestamp Pavel Machek
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 08/26] x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 09/26] net: bmac: Fix read of MAC address from ROM Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 10/26] r8152: support additional Microsoft Surface Ethernet Adapter variant Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 11/26] drm/edid: Add Oculus Rift S to non-desktop list Sasha Levin
2020-05-28 11:56   ` Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 12/26] s390/mm: fix set_huge_pte_at() for empty ptes Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 13/26] null_blk: return error for invalid zone size Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 14/26] net: mvpp2: fix RX hashing for non-10G ports Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 15/26] net/ethernet/freescale: rework quiesce/activate for ucc_geth Sasha Levin
2020-05-28 11:56   ` Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 16/26] net: ethernet: stmmac: Enable interface clocks on probe for IPQ806x Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 17/26] selftests: mlxsw: qos_mc_aware: Specify arping timeout as an integer Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 18/26] net: sun: fix missing release regions in cas_init_one() Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 19/26] net/mlx5: Add command entry handling completion Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 20/26] net/mlx5e: Fix inner tirs handling Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 21/26] net/mlx5: Fix memory leak in mlx5_events_init Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 22/26] net/mlx5e: Update netdev txq on completions during closure Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 23/26] net/mlx5: Fix error flow in case of function_setup failure Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 24/26] net: ethernet: ti: cpsw: fix ASSERT_RTNL() warning during suspend Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 25/26] net/mlx4_core: fix a memory leak bug Sasha Levin
2020-05-28 11:56 ` [PATCH AUTOSEL 5.4 26/26] net: smsc911x: Fix runtime PM imbalance on error Sasha Levin

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=20200528115654.1406165-7-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.