From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 17 Feb 2023 16:36:20 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pT2ma-00AE4d-9T for lore@lore.pengutronix.de; Fri, 17 Feb 2023 16:36:20 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pT2mZ-0003TR-LL; Fri, 17 Feb 2023 16:36:19 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pT2m5-0001Y2-0M; Fri, 17 Feb 2023 16:35:49 +0100 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pT2m3-005cKP-49; Fri, 17 Feb 2023 16:35:48 +0100 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pT2m3-005IrD-G8; Fri, 17 Feb 2023 16:35:47 +0100 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 17 Feb 2023 16:35:47 +0100 Message-Id: <20230217153547.1262993-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213133107.390465-1-s.pueschel@pengutronix.de> References: <20230213133107.390465-1-s.pueschel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] Added sockperf benchmarking utility X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: =?UTF-8?q?Sven=20P=C3=BCschel?= Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as cceeee585de412653aa6d8dd2fd91d5d0c076275. Michael [sent from post-receive hook] On Fri, 17 Feb 2023 16:35:46 +0100, Sven Püschel wrote: > Signed-off-by: Sven Püschel > Message-Id: <20230213133107.390465-1-s.pueschel@pengutronix.de> > Signed-off-by: Michael Olbrich > > diff --git a/patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch b/patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch > new file mode 100644 > index 000000000000..5d15e2787923 > --- /dev/null > +++ b/patches/sockperf-3.10/0001-Fixed-AArch32-compilation.patch > @@ -0,0 +1,69 @@ > +From: =?UTF-8?q?Sven=20P=C3=BCschel?= > +Date: Mon, 13 Feb 2023 10:16:51 +0100 > +Subject: [PATCH] Fixed AArch32 compilation > +MIME-Version: 1.0 > +Content-Type: text/plain; charset=UTF-8 > +Content-Transfer-Encoding: 8bit > + > +sockperf added support for AArch64, but at the same time it broke AArch32 support, > +as this wasn't catched by a compiler macro anymore and resulted in trying to assemble a rdtsc instruction. > + > +See https://github.com/Mellanox/sockperf/commit/d84e8179f8ab007c7a19dfe263691b0429df7565 > +and https://github.com/Mellanox/sockperf/pull/187 > + > +Signed-off-by: Sven Püschel > +--- > + src/sockperf.cpp | 9 +++++++++ > + src/ticks_os.h | 5 +++++ > + 2 files changed, 14 insertions(+) > + > +diff --git a/src/sockperf.cpp b/src/sockperf.cpp > +index 293d21747592..5d6ee4141b35 100644 > +--- a/src/sockperf.cpp > ++++ b/src/sockperf.cpp > +@@ -2205,6 +2205,13 @@ static int parse_common_opt(const AOPT_OBJECT *common_obj) { > + #endif /* DEFINED_TLS */ > + } > + > ++#if defined(__arm__) && !defined(__aarch64__) > ++ if (!s_user_params.b_no_rdtsc) { > ++ log_msg("AArch32 target build does not support rdtsc, use --no-rdtsc"); > ++ rc = SOCKPERF_ERR_BAD_ARGUMENT; > ++ } > ++#endif > ++ > + // resolve address: -i, -p and --tcp options must be processed before > + if (!rc) { > + int res = resolve_sockaddr(host_str, port_str, s_user_params.sock_type, > +@@ -3868,6 +3875,7 @@ packet pace limit = %d", > + log_dbg("+INFO: taking time, using the given settings, consumes %.3lf nsec", > + (double)(end - start).toNsec() / SIZE); > + > ++#if !defined(__arm__) || defined(__aarch64__) > + ticks_t tstart = 0, tend = 0; > + tstart = os_gettimeoftsc(); > + > +@@ -3878,6 +3886,7 @@ packet pace limit = %d", > + double ticks_per_second = (double)get_tsc_rate_per_second(); > + log_dbg("+INFO: taking rdtsc directly consumes %.3lf nsec", > + tdelta / SIZE * 1000 * 1000 * 1000 / ticks_per_second); > ++#endif > + > + // step #5: check is user defined a specific SEED value to be used in all rand() calls > + // if no seed value is provided, the rand() function is automatically seeded with a value of > +diff --git a/src/ticks_os.h b/src/ticks_os.h > +index 0f23b2c6f6f5..8750e0374245 100644 > +--- a/src/ticks_os.h > ++++ b/src/ticks_os.h > +@@ -99,6 +99,11 @@ inline ticks_t os_gettimeoftsc() { > + asm volatile("isb" : : : "memory"); > + asm volatile("mrs %0, cntvct_el0" : "=r" (ret)); > + return ret; > ++#elif defined(__arm__) > ++ // so the compiler will not complain. for > ++ // AArch32 compile, this inline is not used > ++ // since rdtsc is only supported in an optional timer extension > ++ upper_32 = lower_32 = 0; > + #else > + // ReaD Time Stamp Counter (RDTCS) > + __asm__ __volatile__("rdtsc" : "=a"(lower_32), "=d"(upper_32)); > diff --git a/patches/sockperf-3.10/series b/patches/sockperf-3.10/series > new file mode 100644 > index 000000000000..5f59ae9305ae > --- /dev/null > +++ b/patches/sockperf-3.10/series > @@ -0,0 +1,4 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-Fixed-AArch32-compilation.patch > +# 84265c4b5947716cec9ccf808fa7f92e - git-ptx-patches magic > diff --git a/rules/sockperf.in b/rules/sockperf.in > new file mode 100644 > index 000000000000..91851c2ed775 > --- /dev/null > +++ b/rules/sockperf.in > @@ -0,0 +1,8 @@ > +## SECTION=test_suites > + > +config SOCKPERF > + tristate > + select GCCLIBS_CXX > + prompt "sockperf" > + help > + Network benchmarking utility over socket API > diff --git a/rules/sockperf.make b/rules/sockperf.make > new file mode 100644 > index 000000000000..55b96875d5d4 > --- /dev/null > +++ b/rules/sockperf.make > @@ -0,0 +1,60 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2023 by Mellanox Technologies Ltd. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_SOCKPERF) += sockperf > + > +# > +# Paths and names > +# > +SOCKPERF_VERSION := 3.10 > +SOCKPERF_MD5 := c589f072adf8c00eb95ef83c2d371f28 > +SOCKPERF := sockperf-$(SOCKPERF_VERSION) > +SOCKPERF_SUFFIX := tar.gz > +SOCKPERF_URL := https://github.com/Mellanox/sockperf/archive/refs/tags/$(SOCKPERF_VERSION).$(SOCKPERF_SUFFIX) > +SOCKPERF_SOURCE := $(SRCDIR)/$(SOCKPERF).$(SOCKPERF_SUFFIX) > +SOCKPERF_DIR := $(BUILDDIR)/$(SOCKPERF) > +SOCKPERF_LICENSE := BSD-3-Clause > +SOCKPERF_LICENSE_FILES := file://copying;md5=13ab6d8129b2b03a18ec815d88b545ce > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +SOCKPERF_CONF_TOOL := autoconf > +SOCKPERF_CONF_ENV := $(CROSS_ENV) GIT_CEILING_DIRECTORIES="$(BUILDDIR)" > +SOCKPERF_MAKE_ENV := $(CROSS_ENV) GIT_CEILING_DIRECTORIES="$(BUILDDIR)" > + > +$(STATEDIR)/sockperf.prepare: > + @$(call targetinfo) > + @$(call world/execute, SOCKPERF, ./autogen.sh) > + @$(call world/prepare, SOCKPERF) > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/sockperf.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, sockperf) > + @$(call install_fixup, sockperf,PRIORITY,optional) > + @$(call install_fixup, sockperf,SECTION,base) > + @$(call install_fixup, sockperf,AUTHOR,"Mellanox Technologies Ltd.") > + @$(call install_fixup, sockperf,DESCRIPTION,missing) > + > + @$(call install_copy, sockperf, 0, 0, 0755, -, /usr/bin/sockperf) > + > + @$(call install_finish, sockperf) > + > + @$(call touch) > + > +# vim: syntax=make