[dpdk-stable] patch 'net/hinic/base: avoid system time jump' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Aug 6 11:53:55 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/08/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From cb5b7fbeeac69d0feb2381db02d7bb1f09972e6b Mon Sep 17 00:00:00 2001
From: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
Date: Sat, 25 Jul 2020 16:15:36 +0800
Subject: [PATCH] net/hinic/base: avoid system time jump

[ upstream commit efeed0894e9c1aaa6f804a6d130677379ca99378 ]

Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC_RAW, &now),
the reason is same with
commit d08d304508a8 ("eal/linux: make alarm not affected by system time
jump")

Fixes: 81d53291a466 ("net/hinic/base: add various headers")

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
---
 drivers/net/hinic/base/hinic_compat.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
index 7bec03b9c..341aa056b 100644
--- a/drivers/net/hinic/base/hinic_compat.h
+++ b/drivers/net/hinic/base/hinic_compat.h
@@ -198,16 +198,17 @@ static inline u32 readl(const volatile void *addr)
 #define spin_lock(spinlock_prt)		rte_spinlock_lock(spinlock_prt)
 #define spin_unlock(spinlock_prt)	rte_spinlock_unlock(spinlock_prt)
 
-static inline unsigned long get_timeofday_ms(void)
+static inline unsigned long clock_gettime_ms(void)
 {
-	struct timeval tv;
+	struct timespec tv;
 
-	(void)gettimeofday(&tv, NULL);
+	(void)clock_gettime(CLOCK_MONOTONIC, &tv);
 
-	return (unsigned long)tv.tv_sec * 1000 + tv.tv_usec / 1000;
+	return (unsigned long)tv.tv_sec * 1000 +
+	       (unsigned long)tv.tv_nsec / 1000000;
 }
 
-#define jiffies	get_timeofday_ms()
+#define jiffies	clock_gettime_ms()
 #define msecs_to_jiffies(ms)	(ms)
 #define time_before(now, end)	((now) < (end))
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-06 10:53:16.860003229 +0100
+++ 0027-net-hinic-base-avoid-system-time-jump.patch	2020-08-06 10:53:15.812597639 +0100
@@ -1,15 +1,16 @@
-From efeed0894e9c1aaa6f804a6d130677379ca99378 Mon Sep 17 00:00:00 2001
+From cb5b7fbeeac69d0feb2381db02d7bb1f09972e6b Mon Sep 17 00:00:00 2001
 From: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
 Date: Sat, 25 Jul 2020 16:15:36 +0800
 Subject: [PATCH] net/hinic/base: avoid system time jump
 
+[ upstream commit efeed0894e9c1aaa6f804a6d130677379ca99378 ]
+
 Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC_RAW, &now),
 the reason is same with
 commit d08d304508a8 ("eal/linux: make alarm not affected by system time
 jump")
 
 Fixes: 81d53291a466 ("net/hinic/base: add various headers")
-Cc: stable at dpdk.org
 
 Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
 ---
@@ -17,10 +18,10 @@
  1 file changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
-index 2d21b7b67..7036b031c 100644
+index 7bec03b9c..341aa056b 100644
 --- a/drivers/net/hinic/base/hinic_compat.h
 +++ b/drivers/net/hinic/base/hinic_compat.h
-@@ -166,16 +166,17 @@ static inline u32 readl(const volatile void *addr)
+@@ -198,16 +198,17 @@ static inline u32 readl(const volatile void *addr)
  #define spin_lock(spinlock_prt)		rte_spinlock_lock(spinlock_prt)
  #define spin_unlock(spinlock_prt)	rte_spinlock_unlock(spinlock_prt)
  


More information about the stable mailing list