Lines Matching +full:txrx +full:- +full:3
3 # - Depending on bash 3 (or higher) syntax
8 set -o errexit
10 ## -- General shell logging cmds --
23 if [[ -n "$VERBOSE" ]]; then
28 ## -- Pktgen proc config commands -- ##
67 if [[ ! -e "$proc_ctrl" ]]; then
68 err 3 "proc file:$proc_ctrl does not exists (dev added to thread?)"
70 if [[ ! -w "$proc_ctrl" ]]; then
111 [[ $EUID -eq 0 ]] && trap 'pg_ctrl "reset"' EXIT
113 ## -- General shell tricks --
118 if [ "$EUID" -ne 0 ]; then
119 if [ -x $0 ]; then # Directly executable use sudo
132 if [[ $node == -1 ]]; then
143 local queues="${IFACE}-.*TxRx"
145 irqs=$(grep "$queues" /proc/interrupts | cut -f1 -d:)
146 [ -z "$irqs" ] && irqs=$(grep $IFACE /proc/interrupts | cut -f1 -d:)
147 [ -z "$irqs" ] && irqs=$(for i in `ls -Ux /sys/class/net/$IFACE/device/msi_irqs` ;\
148 do grep "$i:.*TxRx" /proc/interrupts | grep -v fdir | cut -f 1 -d : ;\
150 [ -z "$irqs" ] && err 3 "Could not find interrupts for $IFACE"
160 local node_cpu_range_list=`cut -f1- -d, --output-delimiter=" " \
165 node_cpu_list="$node_cpu_list "`seq -s " " ${cpu_range//-/ }`
171 # Check $1 is in between $2, $3 ($2 <= $1 <= $3)
172 function in_between() { [[ ($1 -ge $2) && ($1 -le $3) ]] ; }
180 local sep_cnt=$(tr -cd $sep <<< $1 | wc -c)
189 shrink=( $(egrep -o "$sep{2,}" <<< $addr) )
190 if [[ ${#shrink[@]} -ne 0 ]]; then
191 if [[ ${#shrink[@]} -gt 1 || ( ${shrink[0]} != $sep2 ) ]]; then
198 [[ ${addr: -1} == $sep ]] && addr=${addr}0
199 echo "${addr/$sep2/$(printf ':0%.s' $(seq $[8-sep_cnt])):}"
206 [[ ${FUNCNAME[1]: -1} == 6 ]] && local IP6=6
209 local max=$[ 2**(len*2)-1 ]
217 if [[ -n $prefix ]]; then
225 IFS=$sep read -a addr <<< $net
249 [[ ${FUNCNAME[1]: -1} == 6 ]] && local IP6=6
256 if [[ -z $prefix ]]; then
267 local remain=$[ bitlen-prefix ]
276 IFS=$sep read -ra ip <<< $net
310 IFS="-" read -ra port_list <<< $port_str
313 max_port=${port_list[1]:-$min_port}
327 if [[ $min_port -le $max_port ]]; then
333 err 5 "Invalid port(s): $min_port-$max_port"