patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <stable@dpdk.org>,
	<luoxingyu@huawei.com>, <yin.yinshi@huawei.com>,
	<luoxianjun@huawei.com>, <zhouguoyang@huawei.com>,
	<david.yangxiaoliang@huawei.com>, <zhaohui8@huawei.com>,
	<guojian365@huawei.com>,
	Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
Subject: [dpdk-stable] [PATCH v1 5/5] net/hinic/base: fix clock definition with glibc version
Date: Mon, 14 Sep 2020 22:31:46 +0800	[thread overview]
Message-ID: <ecf44200206d48d1877687ecec35f07e5d810372.1600093192.git.cloud.wangxiaoyun@huawei.com> (raw)
In-Reply-To: <cover.1600093192.git.cloud.wangxiaoyun@huawei.com>

Sync the repair of patch("fix compile error for old glibc
caused by CLOCK_MONOTONIC_RAW") in the community.

Fixes: efeed0894e9c ("net/hinic/base: avoid system time jump")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/base/hinic_compat.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
index 7036b03..6dd210e 100644
--- a/drivers/net/hinic/base/hinic_compat.h
+++ b/drivers/net/hinic/base/hinic_compat.h
@@ -166,11 +166,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)
 
+#ifdef CLOCK_MONOTONIC_RAW /* Defined in glibc bits/time.h */
+#define CLOCK_TYPE CLOCK_MONOTONIC_RAW
+#else
+#define CLOCK_TYPE CLOCK_MONOTONIC
+#endif
+
 static inline unsigned long clock_gettime_ms(void)
 {
 	struct timespec tv;
 
-	(void)clock_gettime(CLOCK_MONOTONIC, &tv);
+	(void)clock_gettime(CLOCK_TYPE, &tv);
 
 	return (unsigned long)tv.tv_sec * 1000 +
 	       (unsigned long)tv.tv_nsec / 1000000;
-- 
1.8.3.1


  parent reply	other threads:[~2020-09-14 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 14:31 [dpdk-stable] [PATCH v1 0/5] some bugs fix Xiaoyun wang
2020-09-14 14:31 ` [dpdk-stable] [PATCH v1 1/5] net/hinic: fix return value of null not checked Xiaoyun wang
2020-09-14 14:31 ` [dpdk-stable] [PATCH v1 2/5] net/hinic: fix TCAM filter set failed Xiaoyun wang
2020-09-14 14:31 ` [dpdk-stable] [PATCH v1 3/5] net/hinic: fix Rx nombuf stats Xiaoyun wang
2020-09-14 14:31 ` [dpdk-stable] [PATCH v1 4/5] net/hinic/base: get default cos from chip Xiaoyun wang
2020-09-14 14:31 ` Xiaoyun wang [this message]
2020-09-22  9:26 ` [dpdk-stable] [PATCH v1 0/5] some bugs fix Ferruh Yigit

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=ecf44200206d48d1877687ecec35f07e5d810372.1600093192.git.cloud.wangxiaoyun@huawei.com \
    --to=cloud.wangxiaoyun@huawei.com \
    --cc=david.yangxiaoliang@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=guojian365@huawei.com \
    --cc=luoxianjun@huawei.com \
    --cc=luoxingyu@huawei.com \
    --cc=stable@dpdk.org \
    --cc=yin.yinshi@huawei.com \
    --cc=zhaohui8@huawei.com \
    --cc=zhouguoyang@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).