DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kamil Vojanec <vojanec@cesnet.cz>
To: Huzaifa Rahman <huzaifa.rahman@emumba.com>
Cc: matan@nvidia.com, dev@dpdk.org, viacheslavo@nvidia.com,
	viktorin@cesnet.cz
Subject: Re: [PATCH] mlx5: initially reading xstats does not cause seg fault
Date: Thu, 10 Nov 2022 11:53:01 +0100	[thread overview]
Message-ID: <e36a69cd-9bfe-9b0c-2664-818ee95ab69f@cesnet.cz> (raw)
In-Reply-To: <CANVhzTgTDo1t=chUtUpMK5OtRqA4nCqrAKNaSBF1GcruJAbO8g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1577 bytes --]

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@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@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@emumba.com>  <huzaifa.rahman@emumba.com>
>>>
>>> Tested-by: Kamil Vojanec<vojanec@cesnet.cz>  <vojanec@cesnet.cz>
>>>
>>>
Looks good to me

[-- Attachment #1.2: Type: text/html, Size: 2664 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4310 bytes --]

  reply	other threads:[~2022-11-10 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 12:30 huzaifa.rahman
2022-08-23  7:33 ` Kamil Vojanec
2022-09-22 10:39   ` Huzaifa Rahman
2022-11-10 10:07     ` Huzaifa Rahman
2022-11-10 10:53       ` Kamil Vojanec [this message]
2023-03-07 16:42 ` Slava Ovsiienko
2023-03-07 16:51 ` Slava Ovsiienko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e36a69cd-9bfe-9b0c-2664-818ee95ab69f@cesnet.cz \
    --to=vojanec@cesnet.cz \
    --cc=dev@dpdk.org \
    --cc=huzaifa.rahman@emumba.com \
    --cc=matan@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    --cc=viktorin@cesnet.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).