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 A6A9EA04FD; Thu, 10 Nov 2022 11:08:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 628EE40150; Thu, 10 Nov 2022 11:08:12 +0100 (CET) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mails.dpdk.org (Postfix) with ESMTP id C9418400EF for ; Thu, 10 Nov 2022 11:08:10 +0100 (CET) Received: by mail-lf1-f49.google.com with SMTP id r12so2278846lfp.1 for ; Thu, 10 Nov 2022 02:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oypl/NghGS+pD1pLMa9A30ZBIIU2lMvi1iravrWwrHQ=; b=cbfylcX60nWN8x/+j0vVaPqtSCYFZn9CqMQK44JRfYTYZ366dLY0B7033HUwLCdIQU VIMc8+VDFibQ0wia5yWuFsg356kRJLqt18VNKdYRVKf7JlCv+SU2Eb8QXI4cNpeD3PS5 p8dn8I4lZGLokohRQMJsvLH3RSICIwxnYmeEhs4gkUPmgSYVXN6iddaiVWnizrmHeRRV DQ+nb5fqslbOi2Vc1VhksabPdqbsMIU250TdhQ8W0aket9X8xNFa6kGk7Xsze930f50F Xl/TcWl4keHC45pO6+kzlKXhe7yTToV4uo8g/iiQ9LvEk5eXs4wo26sHospssBh+7pBz HDrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oypl/NghGS+pD1pLMa9A30ZBIIU2lMvi1iravrWwrHQ=; b=qfEN4gpqe8u2kOR24wDUlkWoHX/pZOimGhY+QE9UgxwwAdlXpDDfelZpjxIPTVBl8V lw5lgznK+AmjCOmXIlxoKroTNHtCMz2mVmIBGhltXYrH745knODXqD3oxZTkj54HrQyN eUTqbZxRfJ4r7lrDYW8acx9tZTQbP9XDzwb7Lhvt0S6xIWnFB3msXn6+iKzFVDU54sBy xYfDrK8Y7qhXKtEUkqJMc6+4Q/yyhpMyPUqsRFUDWvLAB2aRKkMz94W3M43PPq7zkxbO 0CG+BrKia3NYS2wBe2h35FscRNiQV65bcTsOp9ncq6GcfKEn6UBGTNv2MZaEUcCV2zDu 5e/w== X-Gm-Message-State: ACrzQf1mmKTVvOZLmDkyUWQ3UFzaZqRw1p4YYwU6tFRCSkwO1UnT/c2N eKTnjCkAdk+YofYjsU/7wKBmudyPLOXjkj49q9OvSA== X-Google-Smtp-Source: AMsMyM43eNBPpYQJZ+uDfyi5TQuTRYp0LVRpX6dmpkw6gDCevem7w/McGEbY3TALsDcQd12gLZQpuMI5IZYlZ4dCHxg= X-Received: by 2002:a05:6512:1592:b0:4a2:b56c:388e with SMTP id bp18-20020a056512159200b004a2b56c388emr1283608lfb.145.1668074890267; Thu, 10 Nov 2022 02:08:10 -0800 (PST) MIME-Version: 1.0 References: <20220818123014.2515261-1-huzaifa.rahman@emumba.com> <0430b449-d730-a13e-edb9-bb20fd7ef925@cesnet.cz> In-Reply-To: From: Huzaifa Rahman Date: Thu, 10 Nov 2022 15:07:59 +0500 Message-ID: Subject: Re: [PATCH] mlx5: initially reading xstats does not cause seg fault To: Kamil Vojanec Cc: matan@nvidia.com, dev@dpdk.org, viacheslavo@nvidia.com, viktorin@cesnet.cz Content-Type: multipart/alternative; boundary="0000000000004b232e05ed1af3a8" 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 --0000000000004b232e05ed1af3a8 Content-Type: text/plain; charset="UTF-8" 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 >> >> --0000000000004b232e05ed1af3a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Is there any other work/changes req= uired for this patch to be submitted?
Thanks

On Th= u, Sep 22, 2022 at 3:39 PM Huzaifa Rahman <huzaifa.rahman@emumba.com> wrote:
The bugzilla ID o= f this bug is 701:=C2=A0 =C2=A0 https://bugs.dpdk.org/show_bug.cgi?id=3D701<= /a>

On Tue, Aug 23, 2022 at 12:33 PM Kamil Vojanec <vojanec@cesnet.cz> wrote:
=20 =20 =20

    
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>
Tested-by: Kamil Vojanec <vojanec@cesnet.cz>
--0000000000004b232e05ed1af3a8--