[PATCH] mlx5: initially reading xstats does not cause seg fault
Kamil Vojanec
vojanec at cesnet.cz
Thu Nov 10 11:53:01 CET 2022
Hello,
On 11/10/22 11:07, Huzaifa Rahman wrote:
> Hi,
>
> Is there any other work/changes required for this patch to be submitted?
>
> Thanks
>
>
> On Thu, Sep 22, 2022 at 3:39 PM Huzaifa Rahman<huzaifa.rahman at emumba.com>
> wrote:
>
>> The bugzilla ID of this bug is 701:
>> https://bugs.dpdk.org/show_bug.cgi?id=701
>>
>> On Tue, Aug 23, 2022 at 12:33 PM Kamil Vojanec<vojanec at cesnet.cz> wrote:
>>
>>> On 8/18/22 14:30, huzaifa.rahman wrote:
>>>
>>> Bugzilla ID: 296
>>>
>>> the size of counters array in mlx5_xstats_get() was smaller
>>> than the memory we are setting for this array in
>>> mlx5_os_read_dev_counters(). due to which the extra memory is
>>> corrupted and thus corrupting the seemingly unrelated variables.
>>> this happens at the first run only because the n function arg
>>> of mlx5_xstats_get() which is used to init counters array is
>>> initialized by adding the preceding statistics which in our case
>>> (i.e first run) is zero. after the initialization in
>>> mlx5_os_stats_init() the mlx5_stats_n is populated and thus from
>>> then onward the counters array size is correct
>>>
>>> my changes will only affect the flow of the first run when we
>>> need to initialize stats in mlx5_os_stats_init(). the size of the
>>> counters array is set according the mlx5_stats_n variable. by doing
>>> this we will avoid the memset corrupting other variables` memory
>>>
>>> Signed-off-by: huzaifa.rahman<huzaifa.rahman at emumba.com> <huzaifa.rahman at emumba.com>
>>>
>>> Tested-by: Kamil Vojanec<vojanec at cesnet.cz> <vojanec at cesnet.cz>
>>>
>>>
Looks good to me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20221110/4e3a5a41/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4310 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mails.dpdk.org/archives/dev/attachments/20221110/4e3a5a41/attachment.bin>
More information about the dev
mailing list