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 945BC459CE; Wed, 18 Sep 2024 18:29:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69EEF4025E; Wed, 18 Sep 2024 18:29:35 +0200 (CEST) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by mails.dpdk.org (Postfix) with ESMTP id 5FD424003C for ; Wed, 18 Sep 2024 18:29:33 +0200 (CEST) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-7093b53f315so1064525a34.2 for ; Wed, 18 Sep 2024 09:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726676972; x=1727281772; 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=yGgcjrJwz5fMr7OuCb1+ceKGbD9KtjUHKRp59F/3x08=; b=Wwr+DL5svIStq07DBxLggAnrMqsD+brAZ1adHP1ODlckYh/fCWu6dVPUjfgLtdn/qA MOycO+0FBmmUl/eC2U7a96bQpOwUgwzWVTUr1XJqHqY+zi+hLwbUQdKKpd836qfMU5L3 NQvaVyBKObAbZeHYQfCU+CkTSHcaOk/Pupl4/B4hjR+XXkONZrKMGvc5OziWtz3ikHRS pyM6Rw/xIdzBPKfMKizrRKmpfOkfC/krpgYNz9mt2QBi5h8tQf+Ippn+D0Z+zBgKikOG qPqF78lldUhVXVWUztygWsmIYYL70fTMfP+SVOlL1drAYHzEsnkWQcb2dNssjDEOqIkc O2XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726676972; x=1727281772; 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=yGgcjrJwz5fMr7OuCb1+ceKGbD9KtjUHKRp59F/3x08=; b=ceRmZPCZe1UKbpOpqQvEyiqj1olSjI33p6W30amHQ8dy35zuqO6VT/8ulsH+E5nKvq gf9igYw1u0sXIsb634Xab1ufW1J9jYwSqSY4eiuSZJhpTjRIHrmwlulORYOYQWrZSW+B zbSrasknaPgt8UmXfxoJSIswC5rHunaFQBvAWsCrIzNZb+wF+pDtjv9qRagqCm41miJ2 ToNEIXtrkkVbnYlcsGyEIQuaiLB6Wd983yUdy2MfbSiplnqfPKY2cOE0pbXNjn+5Y38I kCDTEsGiwZVRggcLIl351wKbjjHAk0BeCgzP5mz3NduCPAjFxkNuNPJ4MHtpMDe/XHPb /gyA== X-Gm-Message-State: AOJu0YzrvMUO8eC3AHjrXlMpvEeuuiq8Xb73sYjbfW5ipN9rknVqdMF9 PQp3sJEWRELtmTHWHS0317F/Zf8ymhbO7/W+/LZgxFDFQ46PRF2e X-Google-Smtp-Source: AGHT+IFLI+x1LuCpgDCjgD86LpgLiROAZBOE0quD/Jb3ze6TlN8cKq+LjYdD/azoPtn3AzxTEGgkvA== X-Received: by 2002:a05:6358:6f94:b0:1b7:f595:d0ed with SMTP id e5c5f4694b2df-1bc39408cffmr466237955d.1.1726676972179; Wed, 18 Sep 2024 09:29:32 -0700 (PDT) Received: from carbon.. (modemcable170.45-80-70.mc.videotron.ca. [70.80.45.170]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-459aac68736sm50535071cf.9.2024.09.18.09.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 09:29:31 -0700 (PDT) From: Adel Belkhiri To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org, Adel Belkhiri Subject: [PATCH v2] ethdev: optimize the activation of fast-path tracepoints Date: Wed, 18 Sep 2024 12:27:50 -0400 Message-Id: <20240918162750.116243-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 + doc/guides/rel_notes/release_24_11.rst | 3 ++- 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 | 7 ++++++- 7 files changed, 50 insertions(+), 11 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/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 0ff70d9057..10e45fc294 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -67,7 +67,8 @@ Removed Items This section is a comment. Do not overwrite or remove it. Also, make sure to start the actual text at the margin. ======================================================= - +* ethdev: Removed the __rte_ethdev_trace_rx_burst symbol, as the corresponding + tracepoint was split into two separate ones for empty and non-empty calls. API Changes ----------- diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index 626524558a..eed8c78747 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)) + 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..eef254c463 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)) + 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..f6aca95069 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -207,7 +207,6 @@ EXPERIMENTAL { rte_flow_dev_dump; # added in 20.05 - __rte_ethdev_trace_rx_burst; __rte_ethdev_trace_tx_burst; rte_flow_get_aged_flows; @@ -325,6 +324,12 @@ EXPERIMENTAL { rte_flow_template_table_resizable; rte_flow_template_table_resize; rte_flow_template_table_resize_complete; + + # added in 24.11 + __rte_ethdev_trace_rx_burst_empty; + __rte_ethdev_trace_rx_burst_nonempty; + __rte_eth_trace_call_rx_callbacks_empty; + __rte_eth_trace_call_rx_callbacks_nonempty; }; INTERNAL { -- 2.34.1