From: Stephen Hemminger <stephen@networkplumber.org>
To: liwencheng <liwencheng@phytium.com.cn>
Cc: dev@dpdk.org
Subject: Re: [PATCH v1 1/2] net/macb: add new driver
Date: Fri, 1 Nov 2024 09:13:08 -0700 [thread overview]
Message-ID: <20241101091308.28bb4518@hermes.local> (raw)
In-Reply-To: <1730455640-1084345-1-git-send-email-liwencheng@phytium.com.cn>
On Fri, 1 Nov 2024 10:07:19 +0000
liwencheng <liwencheng@phytium.com.cn> wrote:
> add Phytium NIC MACB ethdev PMD driver.
>
> Signed-off-by: liwencheng <liwencheng@phytium.com.cn>
Much better.
When submitting a new version of already submitted patch.
DPDK policy is to use version 2 (v2) and use in-reply-to
so that threads in mail client and patchwork archive stay
organized.
New drivers should be submitted in smaller chunks so that
comments are more organized.
https://doc.dpdk.org/guides/contributing/new_driver.html
A saw a few things.
1. Don't put developer only printf's in under MACB_DEBUG.
If you have to leave debugging around use the existing
log macros with DEBUG as the level.
This applies to all #ifdef's.
Please don't use them because it leads to dead untested code.
2. Looks like driver is keeping per queue stats, but they are not filled
in the get_stats code.
3. Unnecessary casts of void * pointer.
4. The code in interrupt handler is more complex than necessary.
This does the same thing:
static void macb_interrupt_handler(void *param)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
struct macb_priv *priv = dev->data->dev_private;
struct rte_eth_link link;
char status[128];
if (priv->stopped)
return;
if (eth_macb_link_update(dev, 0) < 0)
return;
rte_eth_linkstatus_get(dev, &link);
rte_eth_link_to_str(status, sizeof(status), &link);
MACB_INFO("Port %u: %s", dev->data->port_id, status);
macb_link_change(priv->bp);
rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
}
5. For files, the convention is to use PATH_MAX (you use MAX_FILE_LEN)
6. Use on stack variables where possible (avoids potential memory leaks).
Example of where allocation can be avoided is in macb_get_dev_pclk.
7. lots of extra includes.
For example, why does macb_rxtx_vec_neon need arp, ioctl, socket and stat?
8. Don't use __builtin_ctz, instead use rte_ctz32()
9. Use __rte_cache_aligned not __rte_aligned(RTE_CACHE_LINE_SIZE)
10. Do not disable warnings it hides bugs
11. Take out this line, it bothers checkpatch
meson.build:
#allow_experimental_apis = true
next prev parent reply other threads:[~2024-11-01 16:13 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 10:07 [PATCH v1 1/2] net/macb: add new driver liwencheng
2024-11-01 10:07 ` [PATCH v1 2/2] /usertools/dpdk-devbind:add the binding and unbinding of platform device liwencheng
2024-11-05 8:43 ` [PATCH v2 3/3] usertools/dpdk-devbind: add platform device bind/unbind liwencheng
2024-11-06 3:34 ` [PATCH v2 3/3] usertools/dpdk-devbind: add bind/unbind for platform device liwencheng
2024-11-11 7:43 ` liwencheng
2024-12-03 8:15 ` [PATCH][v2, " Wencheng Li
2024-11-06 3:55 ` [PATCH v1 2/2] /usertools/dpdk-devbind:add the binding and unbinding of " Stephen Hemminger
2024-11-12 1:08 ` liwencheng
2024-11-01 16:13 ` Stephen Hemminger [this message]
2024-11-01 17:42 ` [PATCH v1 1/2] net/macb: add new driver Stephen Hemminger
2024-11-02 5:43 ` Stephen Hemminger
2024-11-05 8:41 ` [PATCH v2 1/3] " liwencheng
2024-11-05 8:41 ` [PATCH v2 2/3] net/macb: add NEON vectorized Rx/Tx liwencheng
2024-11-06 3:33 ` liwencheng
2024-11-11 7:42 ` liwencheng
2024-12-06 8:08 ` [PATCH v3 " Wencheng Li
2024-12-10 7:05 ` [PATCH v3 2/6] " Wencheng Li
2025-04-02 7:10 ` [PATCH v4 3/4] " liwencheng
2024-12-10 7:07 ` [PATCH v3 3/6] net/macb: fix logic error in macb_rxq_rearm function Wencheng Li
2024-11-06 3:32 ` [PATCH v2 1/3] net/macb: add new driver liwencheng
2024-11-11 7:42 ` liwencheng
2024-12-06 8:06 ` [PATCH v3 " Wencheng Li
2025-03-20 18:52 ` Stephen Hemminger
2024-12-10 7:04 ` [PATCH v3 1/6] " Wencheng Li
2025-04-02 7:09 ` [PATCH v4 2/4] net/macb: add new poll mode driver liwencheng
2024-12-10 7:07 ` [PATCH v3 4/6] net/macb: zero ol_flags in each recv function Wencheng Li
2025-03-20 18:53 ` Stephen Hemminger
2024-12-10 7:08 ` [PATCH v3 5/6] net/macb: fix tab errors in meson.build file Wencheng Li
2024-12-10 19:46 ` Stephen Hemminger
2025-03-20 18:53 ` Stephen Hemminger
2024-12-02 20:31 ` [PATCH v2 1/3] net/macb: add new driver Stephen Hemminger
2024-11-22 17:55 ` Stephen Hemminger
2024-11-22 20:38 ` Stephen Hemminger
2024-11-22 20:44 ` 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=20241101091308.28bb4518@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=liwencheng@phytium.com.cn \
/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.