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
|
||||
|
||||
Reference in New Issue
Block a user