From: Stephen Hemminger <stephen@networkplumber.org>
To: Feifei Wang <wff_light@vip.163.com>
Cc: dev@dpdk.org, Xin Wang <wangxin679@h-partners.com>,
Yi Chen <chenyi221@huawei.com>,
Feifei Wang <wangfeifei40@huawei.com>
Subject: Re: [V5 02/18] net/hinic3: add basic header files
Date: Sun, 3 Aug 2025 10:19:09 -0700 [thread overview]
Message-ID: <20250803101909.07db35ae@hermes.local> (raw)
In-Reply-To: <20250702020953.599-3-wff_light@vip.163.com>
On Wed, 2 Jul 2025 10:09:25 +0800
Feifei Wang <wff_light@vip.163.com> wrote:
> +static inline unsigned long
> +clock_gettime_ms(void)
> +{
> + struct timespec tv;
> +
> + clock_gettime(CLOCK_TYPE, &tv);
> +
> + return (unsigned long)tv.tv_sec * HINIC3_S_TO_MS_UNIT +
> + (unsigned long)tv.tv_nsec / HINIC3_S_TO_NS_UNIT;
> +}
> +
> +#define jiffies clock_gettime_ms()
> +#define msecs_to_jiffies(ms) (ms)
> +#define time_before(now, end) ((now) < (end))
> +
Use of clock_gettime() is discouraged. Instead, drivers should use
TSC directly like the rest of the DPDK.
Also, that version of time_before() macro is incorrect for the case of jiffie
wraparound. Better off to use uint64_t.
> +
> +static inline u16
> +ilog2(u32 n)
> +{
> + u16 res = 0;
> +
> + while (n > 1) {
> + n >>= 1;
> + res++;
> + }
> +
> + return res;
> +}
> +
If it matters, there are faster ways to do this function.
> +static inline int
> +hinic3_mutex_lock(pthread_mutex_t *pthreadmutex)
> +{
> + int err;
> +
> + err = pthread_mutex_lock(pthreadmutex);
> + if (err)
> + PMD_DRV_LOG(ERR, "Mutex lock failed, err: %d", err);
> +
> + return err;
> +}
> +
> +static inline void
> +hinic3_mutex_unlock(pthread_mutex_t *pthreadmutex)
> +{
> + pthread_mutex_unlock(pthreadmutex);
> +}
Why are you using pthread_mutex? DPDK drivers in general do not
do locking in the control path, it is assumed the application is
coded correctly to only do control operations from single context.
The driver needs to be more like other drivers.
"Snowflake" drivers mean applications have to deal with different
semantics for each device.
next prev parent reply other threads:[~2025-08-03 17:19 UTC|newest]
Thread overview: 150+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 9:05 [RFC 00/18] add hinic3 PMD driver Feifei Wang
2025-04-18 9:05 ` [RFC 01/18] net/hinic3: add intro doc for hinic3 Feifei Wang
2025-04-18 9:05 ` [RFC 02/18] net/hinic3: add basic header files Feifei Wang
2025-04-18 9:05 ` [RFC 03/18] net/hinic3: add hardware interfaces of BAR operation Feifei Wang
2025-04-18 9:05 ` [RFC 04/18] net/hinic3: add support for cmdq mechanism Feifei Wang
2025-04-18 9:05 ` [RFC 05/18] net/hinic3: add NIC event module Feifei Wang
2025-04-18 9:05 ` [RFC 06/18] net/hinic3: add eq mechanism function code Feifei Wang
2025-04-18 9:05 ` [RFC 07/18] net/hinic3: add mgmt module " Feifei Wang
2025-04-18 9:05 ` [RFC 08/18] net/hinic3: add module about hardware operation Feifei Wang
2025-04-18 9:05 ` [RFC 09/18] net/hinic3: add a NIC business configuration module Feifei Wang
2025-04-18 9:05 ` [RFC 10/18] net/hinic3: add context and work queue support Feifei Wang
2025-04-18 9:05 ` [RFC 11/18] net/hinic3: add a mailbox communication module Feifei Wang
2025-04-18 9:05 ` [RFC 12/18] net/hinic3: add device initailization Feifei Wang
2025-04-18 9:05 ` [RFC 13/18] net/hinic3: add dev ops Feifei Wang
2025-06-26 21:29 ` Stephen Hemminger
2025-06-26 21:30 ` Stephen Hemminger
2025-06-26 21:32 ` Stephen Hemminger
2025-04-18 9:06 ` [RFC 14/18] net/hinic3: add Rx/Tx functions Feifei Wang
2025-06-26 21:40 ` Stephen Hemminger
2025-06-26 21:41 ` Stephen Hemminger
2025-04-18 9:06 ` [RFC 15/18] net/hinic3: add MML and EEPROM access feature Feifei Wang
2025-04-18 9:06 ` [RFC 16/18] net/hinic3: add RSS promiscuous ops Feifei Wang
2025-04-18 9:06 ` [RFC 17/18] net/hinic3: add FDIR flow control module Feifei Wang
2025-04-18 18:25 ` Stephen Hemminger
2025-04-18 18:27 ` Stephen Hemminger
2025-04-18 18:28 ` Stephen Hemminger
2025-04-18 18:30 ` Stephen Hemminger
2025-04-18 9:06 ` [RFC 18/18] drivers/net: add hinic3 PMD build and doc files Feifei Wang
2025-04-18 17:22 ` Stephen Hemminger
2025-04-19 2:52 ` 回复: " wangfeifei (J)
2025-05-29 8:14 ` [PATCH v1 00/18] add hinic3 pmd driver Feifei
2025-05-29 8:15 ` [PATCH v1 01/18] This patch adds some basic files to describe the hinic3 driver Feifei
2025-05-29 8:15 ` [PATCH v1 02/18] net/hinic3: add basic header files Feifei
2025-05-29 8:15 ` [PATCH v1 03/18] net/hinic3: add hardware interfaces of BAR operation Feifei
2025-05-29 8:15 ` [PATCH v1 04/18] net/hinic3: add support for cmdq mechanism Feifei
2025-05-29 8:15 ` [PATCH v1 05/18] net/hinic3: add NIC event module Feifei
2025-05-29 8:15 ` [PATCH v1 06/18] net/hinic3: add eq mechanism function code Feifei
2025-05-29 8:15 ` [PATCH v1 07/18] net/hinic3: add mgmt module " Feifei
2025-05-29 8:15 ` [PATCH v1 08/18] net/hinic3: add module about hardware operation Feifei
2025-05-29 8:15 ` [PATCH v1 09/18] net/hinic3: add a NIC business configuration module Feifei
2025-05-29 8:15 ` [PATCH v1 10/18] net/hinic3: add context and work queue support Feifei
2025-05-29 8:15 ` [PATCH v1 11/18] net/hinic3: add a mailbox communication module Feifei
2025-05-29 8:15 ` [PATCH v1 12/18] net/hinic3: add device initialization Feifei
2025-05-29 8:15 ` [PATCH v1 13/18] net/hinic3: add dev ops Feifei
2025-05-29 8:15 ` [PATCH v1 14/18] net/hinic3: add Rx/Tx functions Feifei
2025-05-29 8:15 ` [PATCH v1 15/18] net/hinic3: add MML and EEPROM access feature Feifei
2025-05-29 8:15 ` [PATCH v1 16/18] net/hinic3: add RSS promiscuous ops Feifei
2025-05-29 8:15 ` [PATCH v1 17/18] net/hinic3: add FDIR flow control module Feifei
2025-05-29 8:15 ` [PATCH v1 18/18] drivers/net: add hinic3 PMD build and doc files Feifei
2025-04-18 18:18 ` [RFC 00/18] add hinic3 PMD driver Stephen Hemminger
2025-04-19 2:44 ` 回复: " wangfeifei (J)
2025-04-18 18:20 ` Stephen Hemminger
2025-04-18 18:32 ` Stephen Hemminger
2025-04-19 3:30 ` 回复: " wangfeifei (J)
2025-06-04 2:52 ` Stephen Hemminger
2025-06-09 16:40 ` Stephen Hemminger
2025-06-25 2:27 ` [V2 00/18] add hinic3 pmd driver Feifei Wang
2025-06-25 2:27 ` [V2 01/18] add some basic files about hinic3 driver Feifei Wang
2025-06-26 15:46 ` Stephen Hemminger
2025-06-26 15:58 ` Stephen Hemminger
2025-06-25 2:27 ` [V2 02/18] net/hinic3: add basic header files Feifei Wang
2025-06-25 2:27 ` [V2 03/18] net/hinic3: add hardware interfaces of BAR operation Feifei Wang
2025-06-25 2:28 ` [V2 04/18] net/hinic3: add support for cmdq mechanism Feifei Wang
2025-06-25 2:28 ` [V2 05/18] net/hinic3: add NIC event module Feifei Wang
2025-06-25 2:28 ` [V2 06/18] net/hinic3: add eq mechanism function code Feifei Wang
2025-06-25 2:28 ` [V2 07/18] net/hinic3: add mgmt module " Feifei Wang
2025-06-25 2:28 ` [V2 08/18] net/hinic3: add module about hardware operation Feifei Wang
2025-06-25 2:28 ` [V2 09/18] net/hinic3: add a NIC business configuration module Feifei Wang
2025-06-25 2:28 ` [V2 10/18] net/hinic3: add context and work queue support Feifei Wang
2025-06-25 2:28 ` [V2 11/18] net/hinic3: add a mailbox communication module Feifei Wang
2025-06-25 2:28 ` [V2 12/18] net/hinic3: add device initialization Feifei Wang
2025-06-25 2:28 ` [V2 13/18] net/hinic3: add dev ops Feifei Wang
2025-06-25 2:28 ` [V2 14/18] net/hinic3: add Rx/Tx functions Feifei Wang
2025-06-26 20:04 ` Stephen Hemminger
2025-06-25 2:28 ` [V2 15/18] net/hinic3: add MML and EEPROM access feature Feifei Wang
2025-06-25 2:28 ` [V2 16/18] net/hinic3: add RSS promiscuous ops Feifei Wang
2025-06-25 2:28 ` [V2 17/18] net/hinic3: add FDIR flow control module Feifei Wang
2025-06-26 15:59 ` Stephen Hemminger
2025-06-26 19:58 ` Stephen Hemminger
2025-06-25 2:28 ` [V2 18/18] drivers/net: add hinic3 PMD build and doc files Feifei Wang
2025-06-26 15:47 ` [V2 00/18] add hinic3 pmd driver Stephen Hemminger
2025-06-26 21:41 ` Stephen Hemminger
2025-07-08 15:47 ` Stephen Hemminger
2025-06-28 7:25 ` [V3 " Feifei Wang
2025-06-28 7:25 ` [V3 01/18] add some basic files about hinic3 driver Feifei Wang
2025-06-29 17:57 ` Stephen Hemminger
2025-06-28 7:25 ` [V3 02/18] net/hinic3: add basic header files Feifei Wang
2025-06-28 7:25 ` [V3 03/18] net/hinic3: add hardware interfaces of BAR operation Feifei Wang
2025-06-28 7:25 ` [V3 04/18] net/hinic3: add support for cmdq mechanism Feifei Wang
2025-06-28 7:25 ` [V3 05/18] net/hinic3: add NIC event module Feifei Wang
2025-06-28 7:25 ` [V3 06/18] net/hinic3: add eq mechanism function code Feifei Wang
2025-06-28 7:25 ` [V3 07/18] net/hinic3: add mgmt module " Feifei Wang
2025-06-28 7:25 ` [V3 08/18] net/hinic3: add module about hardware operation Feifei Wang
2025-06-28 7:25 ` [V3 09/18] net/hinic3: add a NIC business configuration module Feifei Wang
2025-06-28 7:25 ` [V3 10/18] net/hinic3: add context and work queue support Feifei Wang
2025-06-28 7:25 ` [V3 11/18] net/hinic3: add a mailbox communication module Feifei Wang
2025-06-28 7:25 ` [V3 12/18] net/hinic3: add device initialization Feifei Wang
2025-06-28 7:25 ` [V3 13/18] net/hinic3: add dev ops Feifei Wang
2025-06-28 7:25 ` [V3 14/18] net/hinic3: add Rx/Tx functions Feifei Wang
2025-06-29 18:00 ` Stephen Hemminger
2025-06-28 7:25 ` [V3 15/18] net/hinic3: add MML and EEPROM access feature Feifei Wang
2025-06-28 7:25 ` [V3 16/18] net/hinic3: add RSS promiscuous ops Feifei Wang
2025-06-28 7:25 ` [V3 17/18] net/hinic3: add FDIR flow control module Feifei Wang
2025-06-28 7:25 ` [V3 18/18] drivers/net: add hinic3 PMD build and doc files Feifei Wang
2025-06-28 15:04 ` Stephen Hemminger
2025-07-01 1:41 ` [V4 00/18] add hinic3 pmd driver Feifei Wang
2025-07-01 1:41 ` [V4 01/18] doc: add some basic files to describe the hinic3 driver Feifei Wang
2025-07-01 1:41 ` [V4 02/18] net/hinic3: add basic header files Feifei Wang
2025-07-01 1:41 ` [V4 03/18] net/hinic3: add hardware interfaces of BAR operation Feifei Wang
2025-07-01 1:41 ` [V4 04/18] net/hinic3: add support for cmdq mechanism Feifei Wang
2025-07-01 1:41 ` [V4 05/18] net/hinic3: add NIC event module Feifei Wang
2025-07-01 1:41 ` [V4 06/18] net/hinic3: add eq mechanism function code Feifei Wang
2025-07-01 1:41 ` [V4 07/18] net/hinic3: add mgmt module " Feifei Wang
2025-07-01 1:41 ` [V4 08/18] net/hinic3: add module about hardware operation Feifei Wang
2025-07-01 1:42 ` [V4 09/18] net/hinic3: add a NIC business configuration module Feifei Wang
2025-07-01 1:42 ` [V4 10/18] net/hinic3: add context and work queue support Feifei Wang
2025-07-01 1:42 ` [V4 11/18] net/hinic3: add a mailbox communication module Feifei Wang
2025-07-01 1:42 ` [V4 12/18] net/hinic3: add device initialization Feifei Wang
2025-07-01 1:42 ` [V4 13/18] net/hinic3: add dev ops Feifei Wang
2025-07-01 1:42 ` [V4 14/18] net/hinic3: add Rx/Tx functions Feifei Wang
2025-07-01 1:42 ` [V4 15/18] net/hinic3: add MML and EEPROM access feature Feifei Wang
2025-07-01 1:42 ` [V4 16/18] net/hinic3: add RSS promiscuous ops Feifei Wang
2025-07-01 1:42 ` [V4 17/18] net/hinic3: add FDIR flow control module Feifei Wang
2025-07-01 1:42 ` [V4 18/18] drivers/net: add hinic3 PMD build and doc files Feifei Wang
2025-07-01 13:53 ` [V4 00/18] add hinic3 pmd driver Stephen Hemminger
2025-07-02 2:09 ` [V5 " Feifei Wang
2025-07-02 2:09 ` [V5 01/18] doc: add some basic files to describe the hinic3 driver Feifei Wang
2025-07-02 2:09 ` [V5 02/18] net/hinic3: add basic header files Feifei Wang
2025-08-03 17:19 ` Stephen Hemminger [this message]
2025-07-02 2:09 ` [V5 03/18] net/hinic3: add hardware interfaces of BAR operation Feifei Wang
2025-07-02 2:09 ` [V5 04/18] net/hinic3: add support for cmdq mechanism Feifei Wang
2025-07-02 2:09 ` [V5 05/18] net/hinic3: add NIC event module Feifei Wang
2025-07-02 2:09 ` [V5 06/18] net/hinic3: add eq mechanism function code Feifei Wang
2025-07-02 2:09 ` [V5 07/18] net/hinic3: add mgmt module " Feifei Wang
2025-07-02 2:09 ` [V5 08/18] net/hinic3: add module about hardware operation Feifei Wang
2025-07-02 2:09 ` [V5 09/18] net/hinic3: add a NIC business configuration module Feifei Wang
2025-07-02 2:09 ` [V5 10/18] net/hinic3: add context and work queue support Feifei Wang
2025-07-02 2:09 ` [V5 11/18] net/hinic3: add a mailbox communication module Feifei Wang
2025-07-02 2:09 ` [V5 12/18] net/hinic3: add device initialization Feifei Wang
2025-07-02 2:09 ` [V5 13/18] net/hinic3: add dev ops Feifei Wang
2025-08-03 17:24 ` Stephen Hemminger
2025-07-02 2:09 ` [V5 14/18] net/hinic3: add Rx/Tx functions Feifei Wang
2025-07-02 2:09 ` [V5 15/18] net/hinic3: add MML and EEPROM access feature Feifei Wang
2025-07-02 2:09 ` [V5 16/18] net/hinic3: add RSS promiscuous ops Feifei Wang
2025-07-02 2:09 ` [V5 17/18] net/hinic3: add FDIR flow control module Feifei Wang
2025-07-02 2:09 ` [V5 18/18] drivers/net: add hinic3 PMD build and doc files Feifei Wang
2025-07-02 14:55 ` [V5 00/18] add hinic3 pmd driver Stephen Hemminger
2025-07-07 3:27 ` 回复: " wangfeifei (J)
2025-07-07 3:32 ` Stephen Hemminger
2025-07-07 7:39 ` 回复: " wangfeifei (J)
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=20250803101909.07db35ae@hermes.local \
--to=stephen@networkplumber.org \
--cc=chenyi221@huawei.com \
--cc=dev@dpdk.org \
--cc=wangfeifei40@huawei.com \
--cc=wangxin679@h-partners.com \
--cc=wff_light@vip.163.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).