added my Recipes
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
From 51a092ebb36dcc6180ceb93a9777258e826d9990 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 26 Sep 2018 18:11:10 -0700
|
||||
Subject: [PATCH] netlib.c: Move including sched.h out og function
|
||||
|
||||
The shutdown_control() has this code where system headers are being
|
||||
included inside function body and this results in compile errors on musl
|
||||
especially when sched.h is included because sched.h defines a macro
|
||||
which defines a static function. This means it ends up being a static
|
||||
function inside another function and compiler calls it out
|
||||
|
||||
In function 'bind_to_specific_processor':
|
||||
|
|
||||
/mnt/a/yoe/build/tmp/work/i586-yoe-linux-musl/netperf/2.7.0+git999-r0/recipe-sysroot/usr/include/sched.h:102:1:
|
||||
error: invalid storage class for function '__CPU_AND_S'
|
||||
| __CPU_op_func_S(AND, &)
|
||||
| ^~~~~~~~~~~~~~~
|
||||
|
||||
Moving the definition out of function definition fixes the problem
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/netlib.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/netlib.c b/src/netlib.c
|
||||
index 9258424..60b032d 100644
|
||||
--- a/src/netlib.c
|
||||
+++ b/src/netlib.c
|
||||
@@ -2262,6 +2262,10 @@ shutdown_control()
|
||||
|
||||
}
|
||||
|
||||
+#if HAVE_SCHED_SETAFFINITY
|
||||
+#include <sched.h>
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
bind_to_specific_processor will bind the calling process to the
|
||||
processor in "processor" It has lots of ugly ifdefs to deal with
|
||||
@@ -2308,7 +2312,6 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map)
|
||||
value will not tell you if you are bound vs unbound. */
|
||||
bindprocessor(BINDPROCESS,getpid(),(cpu_t)mapped_affinity);
|
||||
#elif HAVE_SCHED_SETAFFINITY
|
||||
-#include <sched.h>
|
||||
/* in theory this should cover systems with more CPUs than bits in a
|
||||
long, without having to specify __USE_GNU. we "cheat" by taking
|
||||
defines from /usr/include/bits/sched.h, which we ass-u-me is
|
||||
@@ -0,0 +1,37 @@
|
||||
From 6dd5b2b1f3ae3479647e2ef66e390d031066defe Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 12 Aug 2020 09:57:23 -0700
|
||||
Subject: [PATCH] nettest_omni: Remove duplicate variable definitions
|
||||
|
||||
These defines are already defined in nettest_bsd.c and exported by
|
||||
nettest_bsd.h this should fix build with -fno-common
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/HewlettPackard/netperf/pull/46]
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/nettest_omni.c | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
diff --git a/src/nettest_omni.c b/src/nettest_omni.c
|
||||
index 852eeb1..862088a 100644
|
||||
--- a/src/nettest_omni.c
|
||||
+++ b/src/nettest_omni.c
|
||||
@@ -458,14 +458,6 @@ static int client_port_max = 65535;
|
||||
|
||||
/* different options for the sockets */
|
||||
|
||||
-int
|
||||
- loc_nodelay, /* don't/do use NODELAY locally */
|
||||
- rem_nodelay, /* don't/do use NODELAY remotely */
|
||||
- loc_sndavoid, /* avoid send copies locally */
|
||||
- loc_rcvavoid, /* avoid recv copies locally */
|
||||
- rem_sndavoid, /* avoid send copies remotely */
|
||||
- rem_rcvavoid; /* avoid recv_copies remotely */
|
||||
-
|
||||
extern int
|
||||
loc_tcpcork,
|
||||
rem_tcpcork,
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
Subject: [PATCH] netperf: fix CPU_SETSIZE to build with eglibc
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
|
||||
---
|
||||
src/netlib.c | 7 ++++++-
|
||||
1 files changed, 6 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/netlib.c b/src/netlib.c
|
||||
index 206e002..e33aae6 100644
|
||||
--- a/src/netlib.c
|
||||
+++ b/src/netlib.c
|
||||
@@ -2265,7 +2265,12 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map)
|
||||
fall-back on what we had before, which is to use just the size of
|
||||
an unsigned long. raj 2006-09-14 */
|
||||
|
||||
-#if defined(__CPU_SETSIZE)
|
||||
+#if defined(CPU_SETSIZE)
|
||||
+#define NETPERF_CPU_SETSIZE CPU_SETSIZE
|
||||
+#define NETPERF_CPU_SET(cpu, cpusetp) CPU_SET(cpu, cpusetp)
|
||||
+#define NETPERF_CPU_ZERO(cpusetp) CPU_ZERO (cpusetp)
|
||||
+ typedef cpu_set_t netperf_cpu_set_t;
|
||||
+#elif defined(__CPU_SETSIZE)
|
||||
#define NETPERF_CPU_SETSIZE __CPU_SETSIZE
|
||||
#if defined(__CPU_SET_S)
|
||||
#define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET_S(cpu, sizeof (cpu_set_t), cpusetp)
|
||||
--
|
||||
1.7.1.1
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
#
|
||||
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
|
||||
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.org>.
|
||||
# Modified for Debian by Christoph Lameter <clameter@debian.org>
|
||||
# Modified for openembedded by Bruno Randolf <bruno.randolf@4g-systems.biz>
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: netperf
|
||||
# Required-Start: $remote_fs $local_fs $time
|
||||
# Required-Stop: $remote_fs $local_fs $time
|
||||
# Should-Start: $network $named
|
||||
# Should-Stop: $network $named
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: network benchmark
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
DAEMON=/usr/sbin/netserver
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting network benchmark server: netserver"
|
||||
start-stop-daemon -S -x $DAEMON > /dev/null 2>&1
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping network benchmark server: netserver"
|
||||
start-stop-daemon -K -x $DAEMON
|
||||
echo "."
|
||||
;;
|
||||
#reload)
|
||||
#
|
||||
# If the daemon can reload its config files on the fly
|
||||
# for example by sending it SIGHUP, do it here.
|
||||
#
|
||||
# If the daemon responds to changes in its config file
|
||||
# directly anyway, make this a do-nothing entry.
|
||||
#
|
||||
# start-stop-daemon --stop --signal 1 --verbose --exec $DAEMON
|
||||
# ;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented, move the "force-reload"
|
||||
# option to the "reload" entry above. If not, "force-reload" is
|
||||
# just the same as "restart".
|
||||
#
|
||||
start-stop-daemon -K -x $DAEMON
|
||||
sleep 1
|
||||
start-stop-daemon -S -x $DAEMON
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/netperf {start|stop|restart|force-reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Netperf Benchmark Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/netserver -D
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,29 @@
|
||||
From 78c9ae7d9a6735575bc72dd28a19b2bc3a251981 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Elble <aweits@rit.edu>
|
||||
Date: Mon, 8 Oct 2018 14:31:20 -0400
|
||||
Subject: [PATCH] netserver: don't change permissions on /dev/null
|
||||
|
||||
the (now default) suppress_debug=1 changes permissions on /dev/null
|
||||
to 0644. Don't do this.
|
||||
|
||||
Upstream-Status: Pending [https://github.com/HewlettPackard/netperf/pull/27/commits/78c9ae7d9a6735575bc72dd28a19b2bc3a251981]
|
||||
Signed-off-by: Ashish Sharma <asharma@mvista.com>
|
||||
|
||||
---
|
||||
src/netserver.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/netserver.c b/src/netserver.c
|
||||
index 00c8d23..86a1c45 100644
|
||||
--- a/src/netserver.c
|
||||
+++ b/src/netserver.c
|
||||
@@ -278,7 +278,8 @@ open_debug_file()
|
||||
|
||||
#if !defined(WIN32)
|
||||
|
||||
- chmod(FileName,0644);
|
||||
+ if (!suppress_debug)
|
||||
+ chmod(FileName,0644);
|
||||
|
||||
/* redirect stdin to "/dev/null" */
|
||||
rd_null_fp = fopen(NETPERF_NULL,"r");
|
||||
@@ -0,0 +1,58 @@
|
||||
Subject: [PATCH] netperf: fix vfork/fork
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
|
||||
---
|
||||
src/netserver.c | 12 ++++++++++--
|
||||
1 files changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/netserver.c b/src/netserver.c
|
||||
index 379a106..f6a8b09 100644
|
||||
--- a/src/netserver.c
|
||||
+++ b/src/netserver.c
|
||||
@@ -1020,7 +1020,7 @@ process_requests()
|
||||
void
|
||||
spawn_child() {
|
||||
|
||||
-#if defined(HAVE_FORK)
|
||||
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
|
||||
|
||||
if (debug) {
|
||||
fprintf(where,
|
||||
@@ -1038,7 +1038,11 @@ spawn_child() {
|
||||
|
||||
signal(SIGCLD,SIG_IGN);
|
||||
|
||||
+#if defined(HAVE_FORK)
|
||||
switch (fork()) {
|
||||
+#else
|
||||
+ switch (vfork()) {
|
||||
+#endif
|
||||
case -1:
|
||||
fprintf(where,
|
||||
"%s: fork() error %s (errno %d)\n",
|
||||
@@ -1405,7 +1409,7 @@ scan_netserver_args(int argc, char *argv[]) {
|
||||
|
||||
void
|
||||
daemonize() {
|
||||
-#if defined(HAVE_FORK)
|
||||
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
|
||||
|
||||
if (debug) {
|
||||
fprintf(where,
|
||||
@@ -1419,7 +1423,11 @@ daemonize() {
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
+#if defined(HAVE_FORK)
|
||||
switch (fork()) {
|
||||
+#else
|
||||
+ switch (vfork()) {
|
||||
+#endif
|
||||
case -1:
|
||||
fprintf(stderr,
|
||||
"%s: fork() error %s (errno %d)\n",
|
||||
--
|
||||
1.7.1.1
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
SUMMARY = "A networking benchmarking tool"
|
||||
DESCRIPTION = "Network performance benchmark including tests for TCP, UDP, sockets, ATM and more."
|
||||
SECTION = "net"
|
||||
HOMEPAGE = "http://www.netperf.org/"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=e661ab33a2a71ad6652c178dedf8aaa2"
|
||||
|
||||
PV = "2.7.0+git${SRCPV}"
|
||||
|
||||
SRC_URI = "git://github.com/HewlettPackard/netperf.git;branch=master;protocol=https \
|
||||
file://cpu_set.patch \
|
||||
file://vfork.patch \
|
||||
file://init \
|
||||
file://netserver.service \
|
||||
file://0001-netlib.c-Move-including-sched.h-out-og-function.patch \
|
||||
file://0001-nettest_omni-Remove-duplicate-variable-definitions.patch \
|
||||
file://netserver_permissions.patch \
|
||||
"
|
||||
|
||||
SRCREV = "3bc455b23f901dae377ca0a558e1e32aa56b31c4"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit update-rc.d autotools texinfo systemd
|
||||
|
||||
# cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros
|
||||
CFLAGS:append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE"
|
||||
|
||||
# set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files
|
||||
# larger than 2GB
|
||||
CFLAGS:append = " -D_FILE_OFFSET_BITS=64"
|
||||
|
||||
PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools,"
|
||||
PACKAGECONFIG[intervals] = "--enable-intervals,--disable-intervals,,"
|
||||
PACKAGECONFIG[histogram] = "--enable-histogram,--disable-histogram,,"
|
||||
|
||||
# autotools.bbclass attends to include m4 files with path depth <= 2 by
|
||||
# "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4.
|
||||
do_configure:prepend() {
|
||||
test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files
|
||||
}
|
||||
|
||||
do_install() {
|
||||
sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init
|
||||
install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d ${D}${systemd_system_unitdir}
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
sed -e 's#/usr/sbin/#${sbindir}/#g' ${WORKDIR}/netserver.service > ${D}${systemd_system_unitdir}/netserver.service
|
||||
fi
|
||||
install -m 4755 src/netperf ${D}${bindir}
|
||||
install -m 4755 src/netserver ${D}${sbindir}
|
||||
install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
|
||||
|
||||
# man
|
||||
install -d ${D}${mandir}/man1/
|
||||
install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1
|
||||
install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1
|
||||
|
||||
# move scripts to examples directory
|
||||
install -d ${D}${docdir}/netperf/examples
|
||||
install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/
|
||||
|
||||
# docs ..
|
||||
install -m 0644 ${S}/COPYING ${D}${docdir}/netperf
|
||||
install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf
|
||||
install -m 0644 ${S}/README ${D}${docdir}/netperf
|
||||
install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf
|
||||
}
|
||||
|
||||
RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}"
|
||||
|
||||
INITSCRIPT_NAME="netperf"
|
||||
INITSCRIPT_PARAMS="defaults"
|
||||
SYSTEMD_SERVICE:${PN} = "netserver.service"
|
||||
Reference in New Issue
Block a user