From: Stephen Hemminger <stephen@networkplumber.org>
To: Jie Liu <liujie5@linkdatatechnology.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v9 02/14] net/sxe: add ethdev probe and remove
Date: Wed, 16 Jul 2025 13:35:27 -0700 [thread overview]
Message-ID: <20250716133527.35bf3053@hermes.local> (raw)
In-Reply-To: <20250716082930.83026-2-liujie5@linkdatatechnology.com>
On Wed, 16 Jul 2025 04:29:18 -0400
Jie Liu <liujie5@linkdatatechnology.com> wrote:
> --- /dev/null
> +++ b/drivers/net/sxe/base/sxe_common.c
> @@ -0,0 +1,66 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright (C), 2022, Linkdata Technology Co., Ltd.
> + */
> +
> +#include <pthread.h>
> +#include <sys/time.h>
> +#include <sys/types.h>
> +#include <unistd.h>
> +#include <rte_common.h>
> +#include <rte_cycles.h>
> +#include <time.h>
> +#include "sxe_types.h"
> +#include "sxe_common.h"
> +
> +#define SXE_TRACE_ID_COUNT_MASK 0x00000000000000FFLLU
> +#define SXE_TRACE_ID_TID_MASK 0x0000000000FFFF00LLU
> +#define SXE_TRACE_ID_TIME_MASK 0x00FFFFFFFF000000LLU
> +#define SXE_TRACE_ID_FLAG 0xFF00000000000000LLU
> +
> +#define SXE_TRACE_ID_COUNT_SHIFT 0
> +#define SXE_TRACE_ID_TID_SHIFT 8
> +#define SXE_TRACE_ID_TIME_SHIFT 24
> +
> +#define SXE_SEC_TO_MS(sec) ((sec) * 1000ULL)
> +#define SXE_SEC_TO_NS(sec) ((sec) * 1000000000ULL)
> +
> +#define SXE_USEC_PER_MS 1000000
> +
> +u64 sxe_trace_id;
> +
> +u64 sxe_time_get_real_ms(void)
> +{
> + u64 ms = 0;
> + struct timespec ts;
> + s32 ret = clock_gettime(CLOCK_MONOTONIC, &ts);
> + if (ret < 0)
> + goto l_end;
> +
> + ms = SXE_SEC_TO_MS(ts.tv_sec) + ts.tv_nsec / SXE_USEC_PER_MS;
> +
> +l_end:
> + return ms;
> +}
> +
> +u64 sxe_trace_id_gen(void)
> +{
> + u64 tid = getpid() + (pthread_self() << 20);
> + u64 index = 0;
> + u64 timestamp = sxe_time_get_real_ms();
> +
> + sxe_trace_id = (SXE_TRACE_ID_FLAG)
> + | ((timestamp << SXE_TRACE_ID_TIME_SHIFT) & SXE_TRACE_ID_TIME_MASK)
> + | ((tid << SXE_TRACE_ID_TID_SHIFT) & SXE_TRACE_ID_TID_MASK)
> + | ((index << SXE_TRACE_ID_COUNT_SHIFT) & SXE_TRACE_ID_COUNT_MASK);
> + return sxe_trace_id;
> +}
> +
> +void sxe_trace_id_clean(void)
> +{
> + sxe_trace_id = 0;
> +}
> +
> +u64 sxe_trace_id_get(void)
> +{
> + return sxe_trace_id++;
> +}
Inventing your own tracing mechanism is not a good idea.
In general, we want all DPDK drivers to behave the same and be debuggable in the same way.
There already is rte_trace and rte_log functions, what does all this add?
next prev parent reply other threads:[~2025-07-16 20:35 UTC|newest]
Thread overview: 146+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 2:36 [PATCH 01/13] net/sxe: add base driver directory and doc Jie Liu
2025-04-25 2:36 ` [PATCH 02/13] net/sxe: add ethdev probe and remove Jie Liu
2025-04-26 16:11 ` Stephen Hemminger
2025-04-26 16:11 ` Stephen Hemminger
2025-04-26 16:15 ` Stephen Hemminger
2025-04-26 16:17 ` Stephen Hemminger
2025-04-25 2:36 ` [PATCH 03/13] net/sxe: add tx rx setup and data path Jie Liu
2025-04-26 16:02 ` Stephen Hemminger
2025-04-26 16:20 ` Stephen Hemminger
2025-04-25 2:36 ` [PATCH 04/13] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-04-25 2:36 ` [PATCH 05/13] net/sxe: support vlan filter Jie Liu
2025-04-25 2:36 ` [PATCH 06/13] net/sxe: add mac layer filter function Jie Liu
2025-04-25 2:36 ` [PATCH 07/13] net/sxe: support rss offload Jie Liu
2025-04-25 2:36 ` [PATCH 08/13] net/sxe: add dcb function Jie Liu
2025-04-25 2:36 ` [PATCH 09/13] net/sxe: support ptp Jie Liu
2025-04-25 2:36 ` [PATCH 10/13] net/sxe: add xstats function Jie Liu
2025-04-25 2:36 ` [PATCH 11/13] net/sxe: add custom cmd led ctrl Jie Liu
2025-04-25 2:36 ` [PATCH 12/13] net/sxe: add simd function Jie Liu
2025-04-25 2:36 ` [PATCH 13/13] net/sxe: add virtual function Jie Liu
2025-04-26 15:57 ` [PATCH 01/13] net/sxe: add base driver directory and doc Stephen Hemminger
2025-04-26 15:59 ` Stephen Hemminger
2025-04-26 16:23 ` Stephen Hemminger
2025-04-26 17:07 ` Stephen Hemminger
2025-04-26 17:08 ` Stephen Hemminger
2025-07-04 2:53 ` [PATCH v2 01/14] net/sxe: add base driver directory and doc Adding a minimum maintainable directory structure for the network driver and request maintenance of the sxe driver Jie Liu
2025-07-07 11:58 ` [PATCH v3 01/14] net/sxe: add base driver directory and doc Jie Liu
2025-07-07 11:58 ` [PATCH v3 02/14] net/sxe: add ethdev probe and remove Jie Liu
2025-07-07 14:57 ` Stephen Hemminger
2025-07-07 11:58 ` [PATCH v3 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-07 11:58 ` [PATCH v3 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-07 11:58 ` [PATCH v3 05/14] net/sxe: support vlan filter Jie Liu
2025-07-07 11:58 ` [PATCH v3 06/14] net/sxe: add filter function Jie Liu
2025-07-07 11:58 ` [PATCH v3 07/14] net/sxe: support rss offload Jie Liu
2025-07-07 11:58 ` [PATCH v3 08/14] net/sxe: add dcb function Jie Liu
2025-07-07 11:58 ` [PATCH v3 09/14] net/sxe: support ptp Jie Liu
2025-07-07 11:58 ` [PATCH v3 10/14] net/sxe: add xstats function Jie Liu
2025-07-07 11:58 ` [PATCH v3 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-07 11:58 ` [PATCH v3 12/14] net/sxe: add simd function Jie Liu
2025-07-07 11:58 ` [PATCH v3 13/14] net/sxe: add virtual function Jie Liu
2025-07-07 11:58 ` [PATCH v3 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-07 15:03 ` Stephen Hemminger
2025-07-07 15:56 ` Stephen Hemminger
2025-07-09 8:43 ` [PATCH v4 1/2] net/sxe: add base driver directory and doc Jie Liu
2025-07-09 8:43 ` [PATCH v4 2/2] net/sxe: add ethdev probe and remove Jie Liu
2025-07-09 16:13 ` Stephen Hemminger
2025-07-09 8:43 ` [PATCH v4 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-09 16:07 ` Stephen Hemminger
2025-07-09 8:43 ` [PATCH v4 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-09 16:09 ` Stephen Hemminger
2025-07-12 1:50 ` 刘洁
2025-07-09 16:11 ` Stephen Hemminger
2025-07-09 8:43 ` [PATCH v4 05/14] net/sxe: support vlan filter Jie Liu
2025-07-09 8:43 ` [PATCH v4 06/14] net/sxe: add filter function Jie Liu
2025-07-09 8:43 ` [PATCH v4 07/14] net/sxe: support rss offload Jie Liu
2025-07-09 8:43 ` [PATCH v4 08/14] net/sxe: add dcb function Jie Liu
2025-07-09 8:43 ` [PATCH v4 09/14] net/sxe: support ptp Jie Liu
2025-07-09 8:43 ` [PATCH v4 10/14] net/sxe: add xstats function Jie Liu
2025-07-09 8:43 ` [PATCH v4 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-09 8:43 ` [PATCH v4 12/14] net/sxe: add simd function Jie Liu
2025-07-09 8:43 ` [PATCH v4 13/14] net/sxe: add virtual function Jie Liu
2025-07-09 8:43 ` [PATCH v4 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-09 16:14 ` Stephen Hemminger
2025-07-10 1:20 ` [PATCH v5 01/14] net/sxe: add base driver directory and doc Jie Liu
2025-07-10 1:20 ` [PATCH v5 02/14] net/sxe: add ethdev probe and remove Jie Liu
2025-07-10 1:20 ` [PATCH v5 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-10 1:20 ` [PATCH v5 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-10 1:20 ` [PATCH v5 05/14] net/sxe: support vlan filter Jie Liu
2025-07-10 1:20 ` [PATCH v5 06/14] net/sxe: add filter function Jie Liu
2025-07-10 1:20 ` [PATCH v5 07/14] net/sxe: support rss offload Jie Liu
2025-07-10 1:20 ` [PATCH v5 08/14] net/sxe: add dcb function Jie Liu
2025-07-10 1:20 ` [PATCH v5 09/14] net/sxe: support ptp Jie Liu
2025-07-10 1:20 ` [PATCH v5 10/14] net/sxe: add xstats function Jie Liu
2025-07-10 1:20 ` [PATCH v5 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-10 1:20 ` [PATCH v5 12/14] net/sxe: add simd function Jie Liu
2025-07-10 1:20 ` [PATCH v5 13/14] net/sxe: add virtual function Jie Liu
2025-07-10 1:20 ` [PATCH v5 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-12 6:18 ` [PATCH v6 01/14] net/sxe: add base driver directory and doc Jie Liu
2025-07-12 6:18 ` [PATCH v6 02/14] net/sxe: add ethdev probe and remove Jie Liu
2025-07-12 6:18 ` [PATCH v6 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-12 6:18 ` [PATCH v6 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-12 6:18 ` [PATCH v6 05/14] net/sxe: support vlan filter Jie Liu
2025-07-12 6:18 ` [PATCH v6 06/14] net/sxe: add filter function Jie Liu
2025-07-12 6:18 ` [PATCH v6 07/14] net/sxe: support rss offload Jie Liu
2025-07-12 6:18 ` [PATCH v6 08/14] net/sxe: add dcb function Jie Liu
2025-07-12 6:18 ` [PATCH v6 09/14] net/sxe: support ptp Jie Liu
2025-07-12 6:18 ` [PATCH v6 10/14] net/sxe: add xstats function Jie Liu
2025-07-12 6:18 ` [PATCH v6 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-12 6:18 ` [PATCH v6 12/14] net/sxe: add simd function Jie Liu
2025-07-12 6:18 ` [PATCH v6 13/14] net/sxe: add virtual function Jie Liu
2025-07-12 6:18 ` [PATCH v6 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-14 3:54 ` [PATCH v7 01/14] net/sxe: add base driver directory and doc Jie Liu
2025-07-14 3:54 ` [PATCH v7 02/14] net/sxe: add ethdev probe and remove Jie Liu
2025-07-14 3:54 ` [PATCH v7 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-14 3:54 ` [PATCH v7 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-14 3:54 ` [PATCH v7 05/14] net/sxe: support vlan filter Jie Liu
2025-07-14 3:54 ` [PATCH v7 06/14] net/sxe: add filter function Jie Liu
2025-07-14 3:54 ` [PATCH v7 07/14] net/sxe: support rss offload Jie Liu
2025-07-14 3:54 ` [PATCH v7 08/14] net/sxe: add dcb function Jie Liu
2025-07-14 3:54 ` [PATCH v7 09/14] net/sxe: support ptp Jie Liu
2025-07-14 3:54 ` [PATCH v7 10/14] net/sxe: add xstats function Jie Liu
2025-07-14 3:54 ` [PATCH v7 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-14 3:54 ` [PATCH v7 12/14] net/sxe: add simd function Jie Liu
2025-07-14 3:54 ` [PATCH v7 13/14] net/sxe: add virtual function Jie Liu
2025-07-14 3:54 ` [PATCH v7 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-15 3:41 ` [PATCH v8 01/14] net/sxe: add base driver directory and doc Jie Liu
2025-07-15 3:41 ` [PATCH v8 02/14] net/sxe: add ethdev probe and remove Jie Liu
2025-07-15 3:41 ` [PATCH v8 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-15 3:41 ` [PATCH v8 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-15 3:41 ` [PATCH v8 05/14] net/sxe: support vlan filter Jie Liu
2025-07-15 3:41 ` [PATCH v8 06/14] net/sxe: add filter function Jie Liu
2025-07-15 3:41 ` [PATCH v8 07/14] net/sxe: support rss offload Jie Liu
2025-07-15 3:41 ` [PATCH v8 08/14] net/sxe: add dcb function Jie Liu
2025-07-15 3:41 ` [PATCH v8 09/14] net/sxe: support ptp Jie Liu
2025-07-15 3:41 ` [PATCH v8 10/14] net/sxe: add xstats function Jie Liu
2025-07-15 3:41 ` [PATCH v8 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-15 3:41 ` [PATCH v8 12/14] net/sxe: add simd function Jie Liu
2025-07-15 3:41 ` [PATCH v8 13/14] net/sxe: add virtual function Jie Liu
2025-07-15 3:41 ` [PATCH v8 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-16 8:29 ` [PATCH v9 01/14] net/sxe: add base driver directory and doc Jie Liu
2025-07-16 8:29 ` [PATCH v9 02/14] net/sxe: add ethdev probe and remove Jie Liu
2025-07-16 20:35 ` Stephen Hemminger [this message]
2025-07-16 20:35 ` Stephen Hemminger
2025-07-16 20:36 ` Stephen Hemminger
2025-07-16 20:40 ` Stephen Hemminger
2025-07-16 8:29 ` [PATCH v9 03/14] net/sxe: add tx rx setup and data path Jie Liu
2025-07-16 17:42 ` Stephen Hemminger
2025-07-16 17:49 ` Stephen Hemminger
2025-07-16 17:51 ` Stephen Hemminger
2025-07-16 8:29 ` [PATCH v9 04/14] net/sxe: add link, flow ctrl, mac ops, mtu ops function Jie Liu
2025-07-16 8:29 ` [PATCH v9 05/14] net/sxe: support vlan filter Jie Liu
2025-07-16 8:29 ` [PATCH v9 06/14] net/sxe: add filter function Jie Liu
2025-07-16 8:29 ` [PATCH v9 07/14] net/sxe: support rss offload Jie Liu
2025-07-16 8:29 ` [PATCH v9 08/14] net/sxe: add dcb function Jie Liu
2025-07-16 8:29 ` [PATCH v9 09/14] net/sxe: support ptp Jie Liu
2025-07-16 8:29 ` [PATCH v9 10/14] net/sxe: add xstats function Jie Liu
2025-07-16 8:29 ` [PATCH v9 11/14] net/sxe: add custom cmd led ctrl Jie Liu
2025-07-16 8:29 ` [PATCH v9 12/14] net/sxe: add simd function Jie Liu
2025-07-16 8:29 ` [PATCH v9 13/14] net/sxe: add virtual function Jie Liu
2025-07-16 17:44 ` Stephen Hemminger
2025-07-16 8:29 ` [PATCH v9 14/14] net/sxe: add Solve compilation problems Jie Liu
2025-07-16 20:31 ` Stephen Hemminger
2025-07-16 8:42 ` [PATCH v9 01/14] net/sxe: add base driver directory and doc David Marchand
2025-07-16 17:46 ` Stephen Hemminger
2025-07-16 17:47 ` Stephen Hemminger
2025-07-07 14:58 ` [PATCH v3 " Stephen Hemminger
2025-07-07 15:00 ` Stephen Hemminger
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=20250716133527.35bf3053@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=liujie5@linkdatatechnology.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).