On Mon, 30 Jan 2023 05:59:33 +0200
Rongwei Liu <rongw...@nvidia.com> wrote:

> +static size_t
> +rte_flow_item_ipv6_routing_ext_conv(void *buf, const void *data)

> +{
> +     struct rte_flow_item_ipv6_routing_ext *dst = buf;
> +     const struct rte_flow_item_ipv6_routing_ext *src = data;
> +     size_t len;
> +
> +     if (src->hdr.hdr_len)
> +             len = src->hdr.hdr_len << 3;
> +     else
> +             len = src->hdr.segments_left << 4;
> +     if (dst == NULL)
> +             return 0;
> +     rte_memcpy((void *)((uintptr_t)(dst->hdr.segments)), src->hdr.segments, 
> len);
> +     return len;

Why use rte_memcpy for such a small size? Please just use normal memcpy which
will cause more compiler and static scan checking.

That cast is unnecessary in C because "segments" is an array and any valid
pointer type can be passed as void *.

Reply via email to