[PATCH v9 12/28] net/rnp: add support link update operations
Stephen Hemminger
stephen at networkplumber.org
Tue Feb 11 16:35:03 CET 2025
On Tue, 11 Feb 2025 16:50:02 +0800
Wenbo Cao <caowenbo at mucse.com> wrote:
> static int
> +rnp_mbx_fw_reply_handler(struct rnp_eth_adapter *adapter,
> + struct rnp_mbx_fw_cmd_reply *reply)
> +{
> + struct rnp_mbx_req_cookie *cookie;
> +
> + RTE_SET_USED(adapter);
> + /* dbg_here; */
> + cookie = reply->cookie;
> + if (!cookie || cookie->magic != RNP_COOKIE_MAGIC) {
> + RNP_PMD_ERR("[%s] invalid cookie:%p opcode: "
> + "0x%x v0:0x%x",
> + __func__,
> + cookie,
> + reply->opcode,
> + *((int *)reply));
Don't break messages across lines in source. It makes it harder to search.
You don't need __func__, it is already being added by the macro.
> + return -EIO;
> + }
> + if (cookie->priv_len > 0)
> + rte_memcpy(cookie->priv, reply->data, cookie->priv_len);
Use memcpy instead of rte_memcpy in all new code.
> +
> + cookie->done = 1;
> + if (reply->flags & RNP_FLAGS_ERR)
> + cookie->errcode = reply->error_code;
> + else
> + cookie->errcode = 0;
> +
> + return 0;
> +}
More information about the dev
mailing list