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 6587B4338E for ; Tue, 21 Nov 2023 13:10:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21E0542EA0; Tue, 21 Nov 2023 13:10:55 +0100 (CET) Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) by mails.dpdk.org (Postfix) with ESMTP id 9258A42E9D for ; Tue, 21 Nov 2023 13:10:53 +0100 (CET) Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-5842c251d7cso3095023eaf.1 for ; Tue, 21 Nov 2023 04:10:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700568652; x=1701173452; darn=dpdk.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=MNhjQLSsHYmd3Tmr4iC36bVYTo6djj2KxiSg4i7apN0=; b=dir8rBR1kS3VigRUoRUYRW6kP2AFSn8X5KmCI1Pp/prbE0VXISk/HlE4YJ13FpW+hl 6a676aSs35goE2Eakg3nZqOX1dr4B8eD7Y5swpXIEySEnQQ1SyarvvwJyYwbG1WaTB8A jc0lEo4v3xxHaDsSjuhZAp3wayye4TdFtom4Ie14lDK3WffeF3jaa7qhbZbzSIRrkbr1 ikGjqUQDfXjzNxI+m5QO7st4kfOZaHOr1qnmfnXcAxVPR1nfH10wkF2qLnNDum0jLm9t UPZwLy9mh07zrEMBj2y8AFxhuE6YphB7GqSUQuvGBkFbmpJk7Du70IDv27CnnFHHkEpX ZvhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700568652; x=1701173452; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MNhjQLSsHYmd3Tmr4iC36bVYTo6djj2KxiSg4i7apN0=; b=lGNtnccZznwiE/LXtidjtQ4EUcxbpWgRx1M6UHSkj1YULnoLeTMdDbLLGjeWEBgrAC X6Ay1gZnKvvfMqDQ3EyREe3f85wsXyRVS4LleC8BNT9H+9k/grSfEp7ewAEeW2s7vQzZ BNsyzhJiFCMAnRn57Phq4VPvR+S5uiFEJpxAtlai6u4/ZzuQW+Ge1793jC4uYutq4SAJ rpdQeDSHeKsRBIKnBTItnW4zE+SkRgwohoI8XKB0+pIwywWetqzX7zw+rurMK7aHuq8h OlAcwowTmjjI23gMB3L4MbztJ3RTLwO3a5j33YtXz2PDSN3XZpHuRDpOTWvlAJTk9mur WOEw== X-Gm-Message-State: AOJu0Yx+xEfqfS+43H1JiUdwA/M462gyWaJbgUlsTXyFFW/maK/mjr2R vvyOCM/9GsbK0eBEDhno0zYCQvX31OEbc2/1m1do5vvoD3s= X-Google-Smtp-Source: AGHT+IHW6zi3+USvNzP3q7RMdTTkO/0/+0no/rWIdcPY8PRrTCSvWO+K2xJ6vKeq+9BeMK7zfKihXNcBISeWkLdsgJo= X-Received: by 2002:a05:6820:161e:b0:571:aceb:26c8 with SMTP id bb30-20020a056820161e00b00571aceb26c8mr10974863oob.3.1700568652548; Tue, 21 Nov 2023 04:10:52 -0800 (PST) MIME-Version: 1.0 From: Pavel Vazharov Date: Tue, 21 Nov 2023 14:10:41 +0200 Message-ID: Subject: Reading stats from XDP based device with number of queues > 16 To: users Content-Type: multipart/alternative; boundary="00000000000073901f060aa87eae" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --00000000000073901f060aa87eae Content-Type: text/plain; charset="UTF-8" Hi there, Currently the `eth_stats_get` function in the drivers/net/af_xdp/rte_eth_af_xdp.c loops to `dev->data->nb_rx_queues`. This can cause silent stack/heap overflow if the `RTE_ETHDEV_QUEUE_STAT_CNTRS` is smaller than `dev->data->nb_rx_queues`. The `eth_kni_stats_get` from drivers/net/kni/rte_eth_kni.c deals with this case looping to RTE_MIN(dev->data->nb_rx_queues, RTE_ETHDEV_QUEUE_STAT_CNTRS). So, I was wondering if the same should be done in drivers/net/af_xdp/rte_eth_af_xdp.c? Disclaimer, I just spent some time debugging stack overflow due to such a call for an XDP based device with 48 queues but RTE_ETHDEV_QUEUE_STAT_CNTRS is 16 (seems by default). rte_eth_stats stats; rte_eth_stats_get(port_id, &stats); I'm also unable to find a meson option for controlling the RTE_ETHDEV_QUEUE_STAT_CNTRS define. I suppose, if one needs a bigger number it should modify it directly in config/rte_config.h before building? Thanks, Pavel. --00000000000073901f060aa87eae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi there,

= Currently the `eth_stats_get` function in the drivers/net/af_xdp/rte_eth_af= _xdp.c loops to `dev->data->nb_rx_queues`. This can cause silent stac= k/heap overflow if the `RTE_ETHDEV_QUEUE_STAT_CNTRS` is smaller than `dev-&= gt;data->nb_rx_queues`.
The `eth_kni_stats_get` from drivers/ne= t/kni/rte_eth_kni.c deals with this case looping to RTE_MIN(dev->data-&g= t;nb_rx_queues, RTE_ETHDEV_QUEUE_STAT_CNTRS).

So, I was wonder= ing if the same should be done in drivers/net/af_xdp/rte_eth_af_xdp.c?
<= br>
Disclaimer, I just spent some time debugging stack overflow due to= such a call for an XDP based device with 48 queues but RTE_ETHDEV_QUEUE_ST= AT_CNTRS is 16 (seems by default).
=C2=A0 =C2=A0 rte_eth_stats stats; = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 =C2=A0 rte_eth_stats_get(port= _id, &stats);

I'm also unable to find a meson option f= or controlling the RTE_ETHDEV_QUEUE_STAT_CNTRS define. I suppose, if one ne= eds a bigger number it should modify it directly in config/rte_config.h bef= ore building?

Thanks,
Pavel.
--00000000000073901f060aa87eae--