Reviewed-by: Chengwen Feng <[email protected]>

On 8/22/2026 3:24 AM, Stephen Hemminger wrote:
> The management of flows is better done using memcpy() or
> structure assignment where compiler can do more bounds checks.
> 
> Signed-off-by: Stephen Hemminger <[email protected]>
> ---
>  lib/ethdev/rte_ethdev.c |   3 +-
>  lib/ethdev/rte_flow.c   | 104 ++++++++++++++++++----------------------
>  2 files changed, 47 insertions(+), 60 deletions(-)
> 

...

>       if (src->pattern_ro) {
> @@ -1138,9 +1128,7 @@ rte_flow_conv(enum rte_flow_conv_op op,
>               break;
>       case RTE_FLOW_CONV_OP_ATTR:
>               attr = src;
> -             if (size > sizeof(*attr))
> -                     size = sizeof(*attr);
> -             rte_memcpy(dst, attr, size);
> +             memcpy(dst, attr, RTE_MIN(size, sizeof(*attr)));

The size will be used later: rte_flow_trace_conv(op, dst, size, src, ret);
In the new impl, the size was not updated, I think it should use the original
size other than modified in the trace.

>               ret = sizeof(*attr);
>               break;
>       case RTE_FLOW_CONV_OP_ITEM:

...

>  

Reply via email to