From: Jakub Kicinski <kuba@kernel.org>
To: Fan Gong <gongfan1@huawei.com>
Cc: Zhu Yikai <zhuyikai1@h-partners.com>, <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Markus Elfring <Markus.Elfring@web.de>,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
ALOK TIWARI <alok.a.tiwari@oracle.com>,
<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>,
luosifu <luosifu@huawei.com>, Xin Guo <guoxin09@huawei.com>,
Shen Chenyang <shenchenyang1@hisilicon.com>,
Zhou Shuai <zhoushuai28@huawei.com>, Wu Like <wulike1@huawei.com>,
Shi Jing <shijing34@huawei.com>,
Luo Yang <luoyang82@h-partners.com>,
Meny Yossefi <meny.yossefi@huawei.com>,
Gur Stavi <gur.stavi@huawei.com>
Subject: Re: [PATCH net-next v06 3/5] hinic3: Add NIC configuration ops
Date: Mon, 10 Nov 2025 18:56:15 -0800 [thread overview]
Message-ID: <20251110185615.631a6462@kernel.org> (raw)
In-Reply-To: <2b5253f63c4f6ba5b7deccf4aa2b15dc32da6589.1762581665.git.zhuyikai1@h-partners.com>
On Sat, 8 Nov 2025 14:41:38 +0800 Fan Gong wrote:
> Add ops to configure NIC feature(lro, vlan, csum...).
This patch really does too many things at once, please split it.
You are allowed to have up to 15 patches in a series, having a list
of things in a commit message is a strong indication that the patch
is doing too many things at once.
> +static void hinic3_auto_moderation_work(struct work_struct *work)
> +{
> + u64 rx_packets, rx_bytes, rx_pkt_diff, rx_rate, avg_pkt_size;
> + u64 tx_packets, tx_bytes, tx_pkt_diff, tx_rate;
> + struct hinic3_nic_dev *nic_dev;
> + struct delayed_work *delay;
> + struct net_device *netdev;
> + unsigned long period;
> + u16 qid;
Please use the DIM infrastructure kernel already has.
If it's not good enough - improve it.
> +static void hinic3_tx_timeout(struct net_device *netdev, unsigned int txqueue)
> +{
> + struct hinic3_nic_dev *nic_dev = netdev_priv(netdev);
> + struct hinic3_io_queue *sq;
> + bool hw_err = false;
> + u16 sw_pi, hw_ci;
> + u8 q_id;
> +
> + HINIC3_NIC_STATS_INC(nic_dev, netdev_tx_timeout);
kernel already has a counter for this
> + netdev_err(netdev, "Tx timeout\n");
and prints an error
Please don't duplicate.
> + for (q_id = 0; q_id < nic_dev->q_params.num_qps; q_id++) {
> + if (!netif_xmit_stopped(netdev_get_tx_queue(netdev, q_id)))
> + continue;
Why are you scanning the queues? kernel passes @txqueue to tell you
which queue has stalled.
> + sq = nic_dev->txqs[q_id].sq;
> + sw_pi = hinic3_get_sq_local_pi(sq);
> + hw_ci = hinic3_get_sq_hw_ci(sq);
> + netdev_dbg(netdev,
> + "txq%u: sw_pi: %u, hw_ci: %u, sw_ci: %u, napi->state: 0x%lx.\n",
> + q_id, sw_pi, hw_ci, hinic3_get_sq_local_ci(sq),
> + nic_dev->q_params.irq_cfg[q_id].napi.state);
> +
> + if (sw_pi != hw_ci)
> + hw_err = true;
> + }
> +
> + if (hw_err)
> + set_bit(HINIC3_EVENT_WORK_TX_TIMEOUT, &nic_dev->event_flag);
> +}
> +struct hinic3_nic_stats {
> + u64 netdev_tx_timeout;
> +
> + /* Subdivision statistics show in private tool */
> + u64 tx_carrier_off_drop;
> + u64 tx_invalid_qid;
I don't see these being used in the series.
> + struct u64_stats_sync syncp;
> +};
--
pw-bot: cr
next prev parent reply other threads:[~2025-11-11 2:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 6:41 [PATCH net-next v06 0/5] net: hinic3: PF initialization Fan Gong
2025-11-08 6:41 ` [PATCH net-next v06 1/5] hinic3: Add PF framework Fan Gong
2025-11-08 6:41 ` [PATCH net-next v06 2/5] hinic3: Add PF management interfaces Fan Gong
2025-11-11 2:47 ` Jakub Kicinski
2025-11-08 6:41 ` [PATCH net-next v06 3/5] hinic3: Add NIC configuration ops Fan Gong
2025-11-11 2:56 ` Jakub Kicinski [this message]
2025-11-08 6:41 ` [PATCH net-next v06 4/5] hinic3: Add mac filter ops Fan Gong
2025-11-08 6:41 ` [PATCH net-next v06 5/5] hinic3: Add netdev register interfaces Fan Gong
2025-11-11 3:04 ` Jakub Kicinski
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=20251110185615.631a6462@kernel.org \
--to=kuba@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=alok.a.tiwari@oracle.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gongfan1@huawei.com \
--cc=guoxin09@huawei.com \
--cc=gur.stavi@huawei.com \
--cc=horms@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luosifu@huawei.com \
--cc=luoyang82@h-partners.com \
--cc=meny.yossefi@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=shenchenyang1@hisilicon.com \
--cc=shijing34@huawei.com \
--cc=wulike1@huawei.com \
--cc=zhoushuai28@huawei.com \
--cc=zhuyikai1@h-partners.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).