On 13 Jul 2026, at 16:20, Fei Wang wrote:

> HI, I commit v3 version.
>
>   Can you share slice time to review again?
>                              Thanks.

Hi Fei,

It's on my review list. At the moment, though, I'm prioritizing a few other 
reviews first.

P.S. You're also very welcome to review other patches on the list while you're 
waiting. The same goes for everyone else:
https://patchwork.ozlabs.org/project/openvswitch/list/

Thanks,

Eelco

> -----邮件原件-----
> 发件人: Eelco Chaudron <[email protected]>
> 发送时间: 2026年7月9日 21:03
> 收件人: Fei Wang <[email protected]>
> 抄送: [email protected]
> 主题: Re: [ovs-dev] [PATCH v2] lib: Avoid signed overflow when handling PMD ID.
>
> External Mail: This email originated from OUTSIDE of the organization!
> Do not click links, open attachments or provide ANY information unless you 
> recognize the sender and know the content is safe.
>
>
> On 9 Jul 2026, at 10:52, Fei Wang via dev wrote:
>
>> Fix a Coverity INTEGER_OVERFLOW warning in dpctl_dump_flows().
>>
>> The PMD ID is stored as a uint32_t, where UINT32_MAX is used as a
>> sentinel value. Avoid assigning it directly to an int, which may
>> trigger an implementation-defined conversion and cause Coverity to
>> report an INTEGER_OVERFLOW warning.
>>
>> Keep the variable type consistent with the original data or perform an
>> explicit validity check before conversion to eliminate the warning
>> while preserving the existing behavior.
>>
>> Signed-off-by: Fei Wang <[email protected]>
>
> Thanks for the patch Fei,
>
> Not a full review, just some things I noticed when scanning through it.
>
> //Eelco
>
>
>> ---
>>  lib/dpctl.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/dpctl.c b/lib/dpctl.c index 752168b5a..81e275062
>> 100644
>> --- a/lib/dpctl.c
>> +++ b/lib/dpctl.c
>> @@ -1044,7 +1044,7 @@ dpctl_dump_flows(int argc, const char *argv[], struct 
>> dpctl_params *dpctl_p)
>>      struct dpif_flow_dump_thread *flow_dump_thread;
>>      struct dpif_flow_dump *flow_dump;
>>      struct dpif_flow f;
>> -    int pmd_id = PMD_ID_NULL;
>> +    unsigned pmd_id = PMD_ID_NULL;
>>      bool pmd_id_filter = false;
>>      int lastargc = 0;
>>      int error;
>> @@ -1063,12 +1063,13 @@ dpctl_dump_flows(int argc, const char *argv[], 
>> struct dpctl_params *dpctl_p)
>>              }
>>              types_list = xstrdup(argv[--argc] + 5);
>>          } else if (!strncmp(argv[argc - 1], "pmd=", 4)) {
>> -            if (!ovs_scan(argv[--argc], "pmd=%d", &pmd_id)) {
>> +            int pmd_id_int;
>
> Add a new line here. Also, maybe pmd_id_arg might be an easier read?
>
>> +            if (!ovs_scan(argv[--argc], "pmd=%d", &pmd_id_int)) {
>>                  error = EINVAL;
>>                  goto out_free;
>>              }
>>
>> -            if (pmd_id == -1) {
>> +            if (pmd_id_int == -1) {
>>                  pmd_id = NON_PMD_CORE_ID;
>>              }
>
> You do not set the new pmd_id for the valid cores. Maybe something like:
>
> +            } else if (pmd_id_int < 0 ) {
> +                error = EINVAL;
> +                goto out_free;
> +            } else {
> +                pmd_id = pmd_id_int;
>              }
>
>>              pmd_id_filter = true;
>> --
>> 2.55.0.windows.2
>>
>> _______________________________________________
>> dev mailing list
>> [email protected]
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to