------------------------------------------------------------------
发件人:Stephen Hemminger <stephen@networkplumber.org>
发送时间:2025年9月19日(周五) 00:39
收件人:Dimon<dimon.zhao@nebula-matrix.com>
抄 送:dev<dev@dpdk.org>; Kyo Liu<kyo.liu@nebula-matrix.com>; Leon<leon.yu@nebula-matrix.com>; Sam<sam.chen@nebula-matrix.com>
主 题:Re: [PATCH v9 04/17] net/nbl: add Channel layer definitions and implementation
On Wed, 17 Sep 2025 01:08:30 -0700
Dimon Zhao <dimon.zhao@nebula-matrix.com> wrote:
> + if (wait_head->ack_err >= 0 && (data_len > 3 * sizeof(uint32_t))) {
> + if (data_len - 3 * sizeof(uint32_t) != wait_head->ack_data_len)
> + NBL_LOG(ERR, "payload_len do not match ack_len!,"
> + " srcid:%u, msgtype:%u, msgid:%u, ack_msgid %u,"
> + " data_len:%u, ack_data_len:%u",
> + srcid, ack_msgtype, msgid,
> + ack_msgid, data_len, wait_head->ack_data_len);
The grammar is incorrect, and prefer to avoid splitting error messages
across multiple source lines because that makes it harder to look for the
error in the driver source.
The bigger issue is what does the error mean? Driver bug?
> + copy_len = RTE_MIN((u32)wait_head->ack_data_len,
> + (u32)data_len - 3 * sizeof(uint32_t));
Why the cast to u32 when variables are already uint32_t
> + memcpy(wait_head->ack_data, payload + 3, copy_len);
> + }