[PATCH v9 12/28] net/rnp: add support link update operations

11 caowenbo at mucse.com
Wed Feb 12 04:21:49 CET 2025


Hi Stephen,
For memcpy what ever base code or other code all used memcpy not rte_memcpy
?
Even the memory is malloc from rte_malloc/zmalloc ?

Regards Wenbo.

> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: 2025年2月11日 23:35
> To: Wenbo Cao <caowenbo at mucse.com>
> Cc: thomas at monjalon.net; dev at dpdk.org; ferruh.yigit at amd.com;
> andrew.rybchenko at oktetlabs.ru; yaojun at mucse.com
> Subject: Re: [PATCH v9 12/28] net/rnp: add support link update operations
> 
> 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