[RFC 17/18] net/hinic3: add FDIR flow control module
Stephen Hemminger
stephen at networkplumber.org
Fri Apr 18 20:30:36 CEST 2025
On Fri, 18 Apr 2025 17:06:03 +0800
Feifei Wang <wff_light at vip.163.com> wrote:
> + /* Alloc TCAM filter memory. */
> + tcam_filter = rte_zmalloc("hinic3_fdir_filter",
> + sizeof(struct hinic3_tcam_filter), 0);
> + if (tcam_filter == NULL)
> + return -ENOMEM;
> + (void)rte_memcpy(&tcam_filter->tcam_key, tcam_key,
> + sizeof(struct hinic3_tcam_key));
This line has three issues.
1. Don't use (void) cast, that is old BSD lint style.
2. Don't use rte_memcpy() for simple fixed size things, use memcpy instead.
3. Don't use memcpy when structure assignment would work.
More information about the dev
mailing list