[v6,1/5] eal: limit telemetry to primary processes

Message ID 20211005135909.726091-2-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series improve telemetry support with in-memory mode |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Oct. 5, 2021, 1:59 p.m. UTC
  Telemetry interface should be exposed for primary processes only, since
secondary processes will conflict on socket creation, and since all
data in secondary process is generally available to primary. For
example, all device stats for ethdevs, cryptodevs, etc. will all be
common across processes.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/freebsd/eal.c | 2 +-
 lib/eal/linux/eal.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Power, Ciara Oct. 7, 2021, 1:11 p.m. UTC | #1
Hi Bruce,

>-----Original Message-----
>From: Richardson, Bruce <bruce.richardson@intel.com>
>Sent: Tuesday 5 October 2021 14:59
>To: dev@dpdk.org
>Cc: Power, Ciara <ciara.power@intel.com>; David Marchand
><david.marchand@redhat.com>; Burakov, Anatoly
><anatoly.burakov@intel.com>; Kevin Traynor <ktraynor@redhat.com>;
>Richardson, Bruce <bruce.richardson@intel.com>
>Subject: [PATCH v6 1/5] eal: limit telemetry to primary processes
>
>Telemetry interface should be exposed for primary processes only, since
>secondary processes will conflict on socket creation, and since all data in
>secondary process is generally available to primary. For example, all device stats
>for ethdevs, cryptodevs, etc. will all be common across processes.
>
>Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>---
> lib/eal/freebsd/eal.c | 2 +-
> lib/eal/linux/eal.c   | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index
>6cee5ae369..b06a2c1662 100644
>--- a/lib/eal/freebsd/eal.c
>+++ b/lib/eal/freebsd/eal.c
>@@ -946,7 +946,7 @@ rte_eal_init(int argc, char **argv)
> 		rte_eal_init_alert("Cannot clear runtime directory");
> 		return -1;
> 	}
>-	if (!internal_conf->no_telemetry) {
>+	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
>+!internal_conf->no_telemetry) {
> 		int tlog = rte_log_register_type_and_pick_level(
> 				"lib.telemetry", RTE_LOG_WARNING);
> 		if (tlog < 0)
>diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index 3577eaeaa4..0d0fc66668
>100644
>--- a/lib/eal/linux/eal.c
>+++ b/lib/eal/linux/eal.c
>@@ -1320,7 +1320,7 @@ rte_eal_init(int argc, char **argv)
> 		rte_eal_init_alert("Cannot clear runtime directory");
> 		return -1;
> 	}
>-	if (!internal_conf->no_telemetry) {
>+	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
>+!internal_conf->no_telemetry) {
> 		int tlog = rte_log_register_type_and_pick_level(
> 				"lib.telemetry", RTE_LOG_WARNING);
> 		if (tlog < 0)
>--
>2.30.2

Good idea, thanks!

Acked-by:  Ciara Power <ciara.power@intel.com>
  

Patch

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 6cee5ae369..b06a2c1662 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -946,7 +946,7 @@  rte_eal_init(int argc, char **argv)
 		rte_eal_init_alert("Cannot clear runtime directory");
 		return -1;
 	}
-	if (!internal_conf->no_telemetry) {
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY && !internal_conf->no_telemetry) {
 		int tlog = rte_log_register_type_and_pick_level(
 				"lib.telemetry", RTE_LOG_WARNING);
 		if (tlog < 0)
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 3577eaeaa4..0d0fc66668 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1320,7 +1320,7 @@  rte_eal_init(int argc, char **argv)
 		rte_eal_init_alert("Cannot clear runtime directory");
 		return -1;
 	}
-	if (!internal_conf->no_telemetry) {
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY && !internal_conf->no_telemetry) {
 		int tlog = rte_log_register_type_and_pick_level(
 				"lib.telemetry", RTE_LOG_WARNING);
 		if (tlog < 0)