From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72B8EA04FD; Thu, 10 Nov 2022 11:53:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 141A140150; Thu, 10 Nov 2022 11:53:04 +0100 (CET) Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by mails.dpdk.org (Postfix) with ESMTP id 6BD82400EF for ; Thu, 10 Nov 2022 11:53:02 +0100 (CET) Received: from [IPV6:2001:67c:1220:80e:d7:f286:c295:1238] (unknown [IPv6:2001:67c:1220:80e:d7:f286:c295:1238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 1C45740006C; Thu, 10 Nov 2022 11:53:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1668077582; bh=tp+e6QY8//CMVZgngfT4/NcXirz8kgXrNW+4JNYOWIQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=YcVcn+8bQMN15Gkw/RdFF7cJpaNMmES1LSmmvZ6ayVWD0VFraptRcRcILBhJgRF8a EBJ7D8XoamaTvcZCwzrcTeig0Ht8ioLg79HJuTp99NczbWNMVUc60MIDdIGo43s2Qt eH9O1LQQoG5dqo5xGca8HCcj5TCF7KE18IZda1UK+IVnxbQmLaq+T95FkVBC/Rm4KW PlM5RNhzCB4NRWeiCppKIJbiDSRUmyZASHIDRO0jmStFK2JR1SPN7Foh0fli133ENh JBKLoMKyMrf3XBG9IUzkQ03JGM20Gl5XW43ExzdSpncwFlod9aZy/9NkFnehxgXzYd 9qKMU6ruqsCKQ== Message-ID: Date: Thu, 10 Nov 2022 11:53:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] mlx5: initially reading xstats does not cause seg fault Content-Language: cs, en-US To: Huzaifa Rahman Cc: matan@nvidia.com, dev@dpdk.org, viacheslavo@nvidia.com, viktorin@cesnet.cz References: <20220818123014.2515261-1-huzaifa.rahman@emumba.com> <0430b449-d730-a13e-edb9-bb20fd7ef925@cesnet.cz> From: Kamil Vojanec In-Reply-To: Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms070204010602020705060204" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This is a cryptographically signed message in MIME format. --------------ms070204010602020705060204 Content-Type: multipart/alternative; boundary="------------lwUVA3QU54mBBk2H4CNfajC0" --------------lwUVA3QU54mBBk2H4CNfajC0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > 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 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 >>> >>> Tested-by: Kamil Vojanec >>> >>> Looks good to me --------------lwUVA3QU54mBBk2H4CNfajC0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
--------------lwUVA3QU54mBBk2H4CNfajC0-- --------------ms070204010602020705060204 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEA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