diff --git a/misc/make.chart.sh b/misc/make.chart.sh new file mode 100644 index 0000000..1bd5fff --- /dev/null +++ b/misc/make.chart.sh @@ -0,0 +1,19 @@ + +# This is a script to convert iperf3 json output into a category/series +# for Highcharts. +# +# It uses the last/latest file of pps.run.* in the current directory to do +# so. + +#jq '{ tx_pipe, frame_max, pps: .server_output_json.intervals | map((.sum.packets - .sum.lost_packets) / .sum.seconds) | max }' $(ls pps.run.* | tail -n 1) | + +jq '{ tx_pipe, frame_max, pps: ((.end.sum.packets - .end.sum.lost_packets) / .end.sum.seconds) }' $(ls pps.run.* | tail -n 1) | + jq -c -s ' +. as $data | ([ map(.frame_max) | .[] | tonumber ] | unique | map(tostring)) as $frame_max | +{ + categories: $frame_max, + series: group_by(.tx_pipe) | [ .[] | . as $inner | {name: ($inner[0].tx_pipe + " Pipe"), data: [ $frame_max[] as $var | ($inner | map(select(.frame_max == $var)) | .[] | .pps ) ] } ] +}' + +# Highcharts.chart('container', { title: { text: "CDCE Throughput"}, yAxis: { title: { text: "pps"}}, xAxis: { title: { text: "number of pipes"}, categories: ["4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23"] }, series: [{"name":"1","data":[29940.407098764797,36154.11736868862,45507.59769592212,50646.40719270156,59260.46999965924,53334.51252727618,39827.03168514981,43022.11058280793,46820.46763377915,49496.46962081698,54550.97901553943,56699.34983862022,60777.86530706674,66064.10985804803,69633.86324771456,67818.2860742334,64291.95386002977,58180.31462099055,57854.950819567224,59796.81712491383]},{"name":"2","data":[54018.07455365272,2666.3722412451893,1686.0052914627609,62847.47803305921,73385.1545532907,70190.24158538337,59162.38794926533,70138.56987837842,38411.873951424226,40170.900529416926,40278.42767636064,71745.97797561514,60030.32466013573,37724.61702094839,41862.6613725577,44400.009434973814,84044.03843797649,41434.9974988812,43192.90613725992,40397.63260679237]},{"name":"3","data":[528.6741060987823,3296.8665814097358,66746.45549623053,2921.2674085753993,56212.392129239,2154.6283954573505,73736.66361467424,23055.13799185539,74006.03462817105,32273.63314073333,30045.72111543271,68346.1089081443,29852.686654847865,36935.81267495932,37549.90602931568,44269.8459735422,78443.71803717775,43715.210500537534,34159.66525169697,71781.15897924671]},{"name":"4","data":[32452.58043581666,453.6193544512509,894.2824612766568,2734.968498256071,62375.04145178333,926.5636073370282,74917.39852729661,47243.36576088211,72506.7916626548,27344.162758696057,43859.41449008116,40707.91022631369,50838.2005085197,35719.77705253432,33984.038136639196,22557.099981151674,78617.03853902647,65232.280047831766,39089.26466145072,37055.6958028612]}] }); +# Highcharts.chart('container', { title: { text: "CDCE Throughput"}, yAxis: { title: { text: "pps"}}, xAxis: { title: { text: "number of frames"}, categories: ["4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23"] }, series: [{"name":"1 Pipe","data":[29940.407098764797,36154.11736868862,45507.59769592212,50646.40719270156,59260.46999965924,53334.51252727618,39827.03168514981,43022.11058280793,46820.46763377915,49496.46962081698,54550.97901553943,56699.34983862022,60777.86530706674,66064.10985804803,69633.86324771456,67818.2860742334,64291.95386002977,58180.31462099055,57854.950819567224,59796.81712491383]},{"name":"2 Pipe","data":[54018.07455365272,2666.3722412451893,1686.0052914627609,62847.47803305921,73385.1545532907,70190.24158538337,59162.38794926533,70138.56987837842,38411.873951424226,40170.900529416926,40278.42767636064,71745.97797561514,60030.32466013573,37724.61702094839,41862.6613725577,44400.009434973814,84044.03843797649,41434.9974988812,43192.90613725992,40397.63260679237]},{"name":"3 Pipe","data":[528.6741060987823,3296.8665814097358,66746.45549623053,2921.2674085753993,56212.392129239,2154.6283954573505,73736.66361467424,23055.13799185539,74006.03462817105,32273.63314073333,30045.72111543271,68346.1089081443,29852.686654847865,36935.81267495932,37549.90602931568,44269.8459735422,78443.71803717775,43715.210500537534,34159.66525169697,71781.15897924671]},{"name":"4 Pipe","data":[32452.58043581666,453.6193544512509,894.2824612766568,2734.968498256071,62375.04145178333,926.5636073370282,74917.39852729661,47243.36576088211,72506.7916626548,27344.162758696057,43859.41449008116,40707.91022631369,50838.2005085197,35719.77705253432,33984.038136639196,22557.099981151674,78617.03853902647,65232.280047831766,39089.26466145072,37055.6958028612]}] }); diff --git a/misc/mbuf.d b/misc/mbuf.d new file mode 100644 index 0000000..e687da2 --- /dev/null +++ b/misc/mbuf.d @@ -0,0 +1,6 @@ +::ip_output:entry +{ + pkthdr = args[0]->m_pkthdr; + if (pkthdr.rsstype != 0 && pkthdr.flowid != 0x61605a86) + printf("flowid: %#x rsstype: %#x\n", pkthdr.flowid, pkthdr.rsstype); +} diff --git a/misc/reload.cdce.sh b/misc/reload.cdce.sh new file mode 100644 index 0000000..a103773 --- /dev/null +++ b/misc/reload.cdce.sh @@ -0,0 +1,12 @@ +ifconfig ue0 -vnet testjail +sleep 2 +kldunload if_cdce + +#ugen=$(usbconfig | grep "Realtek USB" | awk -F: '{ print $1 }') +#usbconfig $ugen power_off + +kldload /boot/modules/if_cdce.ko +#usbconfig $ugen power_on +sleep 1 +ifconfig ue0 vnet testjail +jexec testjail ifconfig ue0 172.29.5.5 diff --git a/misc/run.pps.sh b/misc/run.pps.sh new file mode 100644 index 0000000..68c619c --- /dev/null +++ b/misc/run.pps.sh @@ -0,0 +1,23 @@ +# Note: +# Make sure you run the server w/ the -J option so that the JSON +# version of the server info is provided instead of the raw text. + +set -e + +outfile=pps.run.$(TZ=UTC date -Iminutes) +: > ${outfile} + +for tx_pipe in $(jot 4 1); do + for frame_max in $( jot 20 4 ); do + (cd /usr/src/sys/modules/usb/cdce; make CONF_CFLAGS="-DCDCE_FRAMES_MAX=${frame_max} -DCDCE_MAX_TX=${tx_pipe}" clean all install) > /dev/null + sleep .5 + sh reload.cdce.sh + sleep .5 + starttime=$(TZ=UTC date -Iseconds) + export tx_pipe frame_max starttime + jexec testjail iperf3 --get-server-output -J -l 40 -b 800mbps -u -c 172.29.5.4 | jq '. + { tx_pipe: env.tx_pipe, frame_max: env.frame_max, starttime: env.starttime }' >> ${outfile} + jq -c '{ tx_pipe, frame_max, pps: .server_output_json.intervals | map((.sum.packets - .sum.lost_packets) / .sum.seconds) | max }' ${outfile} | tail -n 1 + done +done + +echo results written to: ${outfile}