From patchwork Thu Dec 2 21:16:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 1563003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AmnlG8Do; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J4pg23jfqz9s3q for ; Fri, 3 Dec 2021 08:16:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CF7D383FB9; Thu, 2 Dec 2021 21:16:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3k9ANagZXyHe; Thu, 2 Dec 2021 21:16:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2CE3B83FB0; Thu, 2 Dec 2021 21:16:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0EC13C002E; Thu, 2 Dec 2021 21:16:43 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id B23E2C000A for ; Thu, 2 Dec 2021 21:16:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9ED3783FB0 for ; Thu, 2 Dec 2021 21:16:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pNf6h28ywSCe for ; Thu, 2 Dec 2021 21:16:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id E4D6E83FAD for ; Thu, 2 Dec 2021 21:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638479799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bL3HrNj5vG2qRg+YARVsBIvGArMI2uoyYaVn2AzHWtI=; b=AmnlG8DoABevsedvABgMqzvZ/kBhuq7tX16KnHrhYMnS+nM8jP6ljh75SXp2afx9gPNrji JBV4nIEpvxUcyFLqYzp1/y2xJYVyqTBjNaoV1Ow/m9kljm3uMYiJIQTopESDXkG3dxMw6E kV60FiczX2HMLQaxe5eTtO9TrT22RKw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-510-dDST92sLPwmNSXFT6WqD9w-1; Thu, 02 Dec 2021 16:16:36 -0500 X-MC-Unique: dDST92sLPwmNSXFT6WqD9w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58D2E835B47; Thu, 2 Dec 2021 21:16:35 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD2225F4E1; Thu, 2 Dec 2021 21:16:33 +0000 (UTC) From: David Marchand To: dev@openvswitch.org Date: Thu, 2 Dec 2021 22:16:16 +0100 Message-Id: <20211202211616.10726-2-david.marchand@redhat.com> In-Reply-To: <20211202211616.10726-1-david.marchand@redhat.com> References: <20211202211616.10726-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: maxime.coquelin@redhat.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH 2/2] netdev-dpdk: Expose per rxq/txq basic statistics. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When troubleshooting multiqueue setups, having per queue statistics helps checking packets repartition in rx and tx queues. Per queue statistics are exported by most DPDK drivers (with capability RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS). OVS only filters DPDK statistics, there is nothing to request in DPDK API. So the only change is to extend the filter on xstats. Querying statistics with $ ovs-vsctl get interface dpdk0 statistics | sed -e 's#[{}]##g' -e 's#, #\n#g' and comparing gives: @@ -13,7 +13,12 @@ rx_phy_crc_errors=0 rx_phy_in_range_len_errors=0 rx_phy_symbol_errors=0 +rx_q0_bytes=0 rx_q0_errors=0 +rx_q0_packets=0 +rx_q1_bytes=0 rx_q1_errors=0 +rx_q1_packets=0 rx_wqe_errors=0 tx_broadcast_packets=0 tx_bytes=0 @@ -27,3 +32,13 @@ tx_pp_rearm_queue_errors=0 tx_pp_timestamp_future_errors=0 tx_pp_timestamp_past_errors=0 +tx_q0_bytes=0 +tx_q0_packets=0 +tx_q1_bytes=0 +tx_q1_packets=0 +tx_q2_bytes=0 +tx_q2_packets=0 +tx_q3_bytes=0 +tx_q3_packets=0 +tx_q4_bytes=0 +tx_q4_packets=0 Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin Acked-by: Kevin Traynor --- Changes since RFC: - dropped regex and used simpler string manipulations, --- lib/netdev-dpdk.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 51bb41551b..1e6079d544 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1582,6 +1582,16 @@ netdev_dpdk_get_xstat_name(struct netdev_dpdk *dev, uint64_t id) return dev->rte_xstats_names[id].name; } +static bool +is_queue_stat(const char *s) +{ + uint16_t tmp; + + return (s[0] == 'r' || s[0] == 't') && + (ovs_scan(s + 1, "x_q%"SCNu16"_packets", &tmp) || + ovs_scan(s + 1, "x_q%"SCNu16"_bytes", &tmp)); +} + static void netdev_dpdk_configure_xstats(struct netdev_dpdk *dev) OVS_REQUIRES(dev->mutex) @@ -1632,9 +1642,10 @@ netdev_dpdk_configure_xstats(struct netdev_dpdk *dev) id = rte_xstats[i].id; name = netdev_dpdk_get_xstat_name(dev, id); - /* We need to filter out everything except dropped, error and - * management counters. */ - if (string_ends_with(name, "_errors") || + /* For custom stats, we filter out everything except per rxq/txq basic + * stats, and dropped, error and management counters. */ + if (is_queue_stat(name) || + string_ends_with(name, "_errors") || strstr(name, "_management_") || string_ends_with(name, "_dropped")) {