#!/bin/sh # TOPO: 127.0.0.1 lo modprobe sctp pkill sctp_test 2> /dev/null sctp_test -H 127.0.0.1 -P 1234 -l > /dev/null 2>&1 & sleep 3 mkdir /sys/fs/cgroup/memory/sctp_mem > /dev/null 2>&1; echo "sctp_wmem testing:" echo "------------------" echo "$((8<<14)) bytes for wmem limit ->" echo $((8<<14)) >/sys/fs/cgroup/memory/sctp_mem/memory.kmem.tcp.limit_in_bytes { echo $BASHPID > /sys/fs/cgroup/memory/sctp_mem/cgroup.procs time sctp_test -H 127.0.0.1 -P 8000 -h 127.0.0.1 -p 1234 -s -c 5 > /dev/null 2>&1 echo "" } & wait $! echo "$((8<<16)) bytes for wmem limit ->" echo $((8<<16)) >/sys/fs/cgroup/memory/sctp_mem/memory.kmem.tcp.limit_in_bytes { echo $BASHPID > /sys/fs/cgroup/memory/sctp_mem/cgroup.procs time sctp_test -H 127.0.0.1 -P 8000 -h 127.0.0.1 -p 1234 -s -c 5 > /dev/null 2>&1 echo "" } & wait $! echo "sctp_rmem testing:" echo "------------------" echo "$((8<<13)) bytes for rmem limit ->" pkill sctp_test 2> /dev/null echo $((8<<13)) >/sys/fs/cgroup/memory/sctp_mem/memory.kmem.tcp.limit_in_bytes { echo $BASHPID > /sys/fs/cgroup/memory/sctp_mem/cgroup.procs sctp_test -H 127.0.0.1 -P 1234 -l > /dev/null 2>&1 } & sleep 3 time sctp_test -H 127.0.0.1 -P 8000 -h 127.0.0.1 -p 1234 -s -c 5 > /dev/null 2>&1 echo "" echo "$((8<<14)) bytes for rmem limit ->" pkill sctp_test 2> /dev/null echo $((8<<14)) >/sys/fs/cgroup/memory/sctp_mem/memory.kmem.tcp.limit_in_bytes { echo $BASHPID > /sys/fs/cgroup/memory/sctp_mem/cgroup.procs sctp_test -H 127.0.0.1 -P 1234 -l > /dev/null 2>&1 } & sleep 3 time sctp_test -H 127.0.0.1 -P 8000 -h 127.0.0.1 -p 1234 -s -c 5 > /dev/null 2>&1 echo "" echo "sctp_wmem_and_rmem testing:" echo "---------------------------" echo "$((8<<14)) bytes for wmem AND rmem limit ->" pkill sctp_test 2> /dev/null echo $((8<<14)) >/sys/fs/cgroup/memory/sctp_mem/memory.kmem.tcp.limit_in_bytes { echo $BASHPID > /sys/fs/cgroup/memory/sctp_mem/cgroup.procs sctp_test -H 127.0.0.1 -P 1234 -l > /dev/null 2>&1 & sleep 3 time sctp_test -H 127.0.0.1 -P 8000 -h 127.0.0.1 -p 1234 -s -c 5 > /dev/null 2>&1 echo "" } & wait