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 174684597E; Fri, 13 Sep 2024 19:59:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7F5942EFC; Fri, 13 Sep 2024 19:59:52 +0200 (CEST) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by mails.dpdk.org (Postfix) with ESMTP id 7BA0A402B3 for ; Fri, 13 Sep 2024 19:59:51 +0200 (CEST) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6c359c1a2fdso9547146d6.2 for ; Fri, 13 Sep 2024 10:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726250391; x=1726855191; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ya3aN/NBRtqqKVfWSDvye/mEh+Rd2vRxW6ydOC4El4M=; b=TJ/K6DtOwu8/oIlM20MDppkLU2kV6YYFO9GiuqTUumZZ0AMFvQIkGX9FimxmLRqEY3 LtiwfUUe7V9yn0BoUE/PRJS1QMRf0LEIB7UY+17dwuomvowOqVl2D/HmbsDWpOKhlzQT k8J+IPK/czB8Q95tf3cHcXuzuKprMjtwbECwHtFYEr9ZIeZJVdnZwTCf+jshLJhX6BQf /2CeM5ExPojyjR98YUlAMlfAzGkFv84n++b48MazXLlx2qYUYUNNy3L1taQhaioqSaOl xJHiYFcedKwOaoi5wsUwlVm+9RbTbtWHiTpBKPd1BAg8kQFfpkF7XtVYAAcF5Lo7WbiT 4+wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726250391; x=1726855191; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ya3aN/NBRtqqKVfWSDvye/mEh+Rd2vRxW6ydOC4El4M=; b=czNStIHAC1rZboHzJ5n/v9qGva86j9QFpUfhMrKNxFIZKelK/1AJaCmll/AJ0pzwPT 0JBviieC1vYFSq4wXzTS/HtR0eipLXtu8XUoLFYZKH2kkXIkxZleaBRVmnn9XPgBy7pZ sVQA1xaqLxJGgev/+MRBQDETtsxnDuaGE3+xu9IobQndunaiR+pQ/GZM9Wkrz54i524q bXfVXqToFTMwdaqNhLyIwhMR2q1F57qyxqW8T83WyZ/Thd3xaCefrGZOZXsL8QAylY5u 3/im5VQpkkPvL07Q+fitvvWQC2obFXJkP0hk8BMZVqdQ/3umlSpeYVKSap1fLVOeUf2L 8Sag== X-Gm-Message-State: AOJu0Yw7y5mHDKEJKCqGYbl9mEI4Qs4HdNZPdjpH16w8LVPeYOT7vre3 Dd0ZJEE3mFUhiWB+cCl7kNB8rJjgGCb9Qd/GpU+bqAUrCawFGO1I X-Google-Smtp-Source: AGHT+IERkHD9vO3cSRimZzNCqGKX5i4xFFL3ZOUddTa6wNHsrgon4Yf0g88yd77xv82eyUrCCEzF2w== X-Received: by 2002:a05:6214:4b0a:b0:6c5:52c8:9de4 with SMTP id 6a1803df08f44-6c57dc951f9mr68368916d6.0.1726250390589; Fri, 13 Sep 2024 10:59:50 -0700 (PDT) Received: from carbon.polymtl.ca (Sansfil-Securise-Employes-Poly-234-77.polymtl.ca. [132.207.234.77]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5347747a0sm69678196d6.116.2024.09.13.10.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 10:59:49 -0700 (PDT) From: Adel Belkhiri To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org, Adel Belkhiri Subject: [PATCH] ethdev: optimize activation of fast-path tracepoints Date: Fri, 13 Sep 2024 13:58:28 -0400 Message-Id: <20240913175828.21640-1-adel.belkhiri@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Adel Belkhiri Split the tracepoints rte_ethdev_trace_rx_burst and rte_eth_trace_call_rx_callbacks into two separate ones for empty and non-empty calls to avoid saturating quickly the trace buffer. Signed-off-by: Adel Belkhiri --- .mailmap | 1 + lib/ethdev/ethdev_private.c | 8 ++++++-- lib/ethdev/ethdev_trace_points.c | 14 ++++++++++---- lib/ethdev/rte_ethdev.h | 5 ++++- lib/ethdev/rte_ethdev_trace_fp.h | 23 +++++++++++++++++++++-- lib/ethdev/version.map | 3 ++- 6 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.mailmap b/.mailmap index 4a508bafad..e86241dced 100644 --- a/.mailmap +++ b/.mailmap @@ -16,6 +16,7 @@ Abraham Tovar Adam Bynes Adam Dybkowski Adam Ludkiewicz +Adel Belkhiri Adham Masarwah Adrian Moreno Adrian Pielech diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 626524558a..9aca7bb635 100644 --- a/lib/ethdev/ethdev_private.c +++ b/lib/ethdev/ethdev_private.c @@ -298,8 +298,12 @@ rte_eth_call_rx_callbacks(uint16_t port_id, uint16_t queue_id, cb = cb->next; } - rte_eth_trace_call_rx_callbacks(port_id, queue_id, (void **)rx_pkts, - nb_rx, nb_pkts); + if (unlikely(nb_rx > 0)) + rte_eth_trace_call_rx_callbacks_nonempty(port_id, queue_id, (void **)rx_pkts, + nb_rx, nb_pkts); + else + rte_eth_trace_call_rx_callbacks_empty(port_id, queue_id, (void **)rx_pkts, + nb_pkts); return nb_rx; } diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 99e04f5893..6ecbee289b 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -25,14 +25,20 @@ RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_stop, RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_close, lib.ethdev.close) -RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst, - lib.ethdev.rx.burst) +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst_empty, + lib.ethdev.rx.burst.empty) + +RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_rx_burst_nonempty, + lib.ethdev.rx.burst.nonempty) RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_tx_burst, lib.ethdev.tx.burst) -RTE_TRACE_POINT_REGISTER(rte_eth_trace_call_rx_callbacks, - lib.ethdev.call_rx_callbacks) +RTE_TRACE_POINT_REGISTER(rte_eth_trace_call_rx_callbacks_empty, + lib.ethdev.call_rx_callbacks.empty) + +RTE_TRACE_POINT_REGISTER(rte_eth_trace_call_rx_callbacks_nonempty, + lib.ethdev.call_rx_callbacks.nonempty) RTE_TRACE_POINT_REGISTER(rte_eth_trace_call_tx_callbacks, lib.ethdev.call_tx_callbacks) diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 548fada1c7..e9dbbf677b 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -6132,7 +6132,10 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, } #endif - rte_ethdev_trace_rx_burst(port_id, queue_id, (void **)rx_pkts, nb_rx); + if (unlikely(nb_rx > 0)) + rte_ethdev_trace_rx_burst_nonempty(port_id, queue_id, (void **)rx_pkts, nb_rx); + else + rte_ethdev_trace_rx_burst_empty(port_id, queue_id, (void **)rx_pkts); return nb_rx; } diff --git a/lib/ethdev/rte_ethdev_trace_fp.h b/lib/ethdev/rte_ethdev_trace_fp.h index 40b6e4756b..d23865996a 100644 --- a/lib/ethdev/rte_ethdev_trace_fp.h +++ b/lib/ethdev/rte_ethdev_trace_fp.h @@ -18,7 +18,16 @@ extern "C" { #include RTE_TRACE_POINT_FP( - rte_ethdev_trace_rx_burst, + rte_ethdev_trace_rx_burst_empty, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **pkt_tbl), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(pkt_tbl); +) + +RTE_TRACE_POINT_FP( + rte_ethdev_trace_rx_burst_nonempty, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, void **pkt_tbl, uint16_t nb_rx), rte_trace_point_emit_u16(port_id); @@ -38,7 +47,17 @@ RTE_TRACE_POINT_FP( ) RTE_TRACE_POINT_FP( - rte_eth_trace_call_rx_callbacks, + rte_eth_trace_call_rx_callbacks_empty, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, + void **rx_pkts, uint16_t nb_pkts), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u16(queue_id); + rte_trace_point_emit_ptr(rx_pkts); + rte_trace_point_emit_u16(nb_pkts); +) + +RTE_TRACE_POINT_FP( + rte_eth_trace_call_rx_callbacks_nonempty, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t queue_id, void **rx_pkts, uint16_t nb_rx, uint16_t nb_pkts), rte_trace_point_emit_u16(port_id); diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 1669055ca5..92cd4d7a2d 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -207,7 +207,8 @@ EXPERIMENTAL { rte_flow_dev_dump; # added in 20.05 - __rte_ethdev_trace_rx_burst; + __rte_ethdev_trace_rx_burst_empty; + __rte_ethdev_trace_rx_burst_nonempty; __rte_ethdev_trace_tx_burst; rte_flow_get_aged_flows; -- 2.34.1