-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbashrc
12953 lines (10940 loc) · 340 KB
/
bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Source global definitions"
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
debian=0
cloud=0
username=cmi
test -f /usr/bin/lsb_release && debian=1
ofed_mlx5=0
/sbin/modinfo mlx5_core -n > /dev/null 2>&1 && /sbin/modinfo mlx5_core -n | egrep "extra|updates" > /dev/null 2>&1 && ofed_mlx5=1
numvfs=17
numvfs=1
numvfs=3
# alias virc="vi /images/cmi/sm/bashrc"
# alias rc=". /images/cmi/sm/bashrc"
alias virc='vi ~/.bashrc'
alias rc='. ~/.bashrc'
[[ "$(hostname -s)" == "dev-r630-03" ]] && host_num=13
[[ "$(hostname -s)" == "dev-r630-04" ]] && host_num=14
# [[ "$(hostname -s)" == "dev-chrism-vm1" ]] && host_num=15
# [[ "$(hostname -s)" == "dev-chrism-vm2" ]] && host_num=16
# [[ "$(hostname -s)" == "dev-chrism-vm3" ]] && host_num=17
# [[ "$(hostname -s)" == "dev-chrism-vm4" ]] && host_num=18
[[ "$(hostname -s)" == "c-236-149-180-183" ]] && host_num=83
[[ "$(hostname -s)" == "c-236-149-180-184" ]] && host_num=84
[[ "$(hostname -s)" == "c-236-148-240-245" ]] && host_num=45
[[ "$(hostname -s)" == "c-235-13-1-007" ]] && host_num=7
[[ "$(hostname -s)" == "c-235-13-1-008" ]] && host_num=8
[[ "$(hostname -s)" == "qa-h-vrt-074" ]] && host_num=74
function get_vf
{
local h=$1
local p=$2
local n=$3
h=$(printf "%02d" $h)
p=$(printf "%02d" $p)
n=$(printf "%02x" $n)
[[ $# != 3 ]] && return
local l=$link
local dir1=/sys/class/net/$l
[[ ! -d $dir1 ]] && return
local dir2=$(readlink $dir1)
# dir1=/sys/class/net/enp4s0f0
# dir2=../../devices/pci0000:00/0000:00:02.0/0000:04:00.0/net/enp4s0f0
cd $dir1
cd ../$dir2
cd ../../../
# /sys/devices/pci0000:00/0000:00:02.0
for a in $(find . -name address); do
local mac=$(cat $a)
if [[ "$mac" == "02:25:d0:$h:$p:$n" ]]; then
dirname $a | xargs basename
fi
done
}
if (( host_num == 13 )); then
export DISPLAY=MTBC-CHRISM:0.0
export DISPLAY=localhost:10.0 # via vpn
link_name=2
link_pre=enp4s0f0n
link=${link_pre}p0
link2_pre=enp4s0f1n
link2=${link2_pre}p1
uname -r | grep 4.19.36 > /dev/null 2>&1
if (( $? == 0 )) ; then
link_name=1
link=enp4s0f0
fi
link_name=1
link=enp4s0f0
rhost_num=14
link_remote_ip=192.168.1.$rhost_num
link_remote_ip2=192.168.2.$rhost_num
link_remote_ipv6=1::$rhost_num
link_mac=b8:59:9f:bb:31:66
remote_mac=b8:59:9f:bb:31:82
machine_num=1
if (( link_name == 2 )); then
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))=${link}v$i
eval rep$((i+1))=${link_pre}pf0vf$i
done
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))_2=${link2}v$i
eval rep$((i+1))_2=${link2_pre}pf1vf$i
done
fi
if (( link_name == 1 )); then
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))=${link}v$i
eval rep$((i+1))=${link}_$i
done
fi
if [[ "$USER" == "root" ]]; then
echo 1 > /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal;
echo 2000000 > /proc/sys/net/netfilter/nf_conntrack_max
fi
# modprobe aer-inject
elif (( host_num == 14 )); then
# export DISPLAY=MTBC-CHRISM:0.0
export DISPLAY=localhost:10.0
link=enp4s0f0np0
link2=enp4s0f1np1
link_name=2
link_pre=enp4s0f0n
link=${link_pre}p0
link2_pre=enp4s0f1n
link2=${link2_pre}p1
link_name=1
link=enp4s0f0
link2=enp4s0f1
rhost_num=13
link_remote_ip=192.168.1.$rhost_num
link_remote_ip2=192.168.2.$rhost_num
link_remote_ipv6=1::$rhost_num
link_mac=b8:59:9f:bb:31:82
remote_mac=b8:59:9f:bb:31:66
machine_num=2
vf1=enp4s0f2
vf2=enp4s0f3
vf3=enp4s0f4
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))=${link}v$i
# eval rep$((i+1))=${link}_$i
eval rep$((i+1))=${link_pre}pf0vf$i
done
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))_2=${link2}v$i
# eval rep$((i+1))_2=${link2}_$i
eval rep$((i+1))_2=${link2_pre}pf1vf$i
done
if (( link_name == 1 )); then
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))=${link}v$i
eval rep$((i+1))=${link}_$i
done
fi
# modprobe aer-inject
if [[ "$USER" == "root" ]]; then
echo 1 > /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal;
echo 5000000 > /proc/sys/net/netfilter/nf_conntrack_max
fi
elif (( host_num == 83 )); then
machine_num=1
rhost_num=84
link_mac=0c:42:a1:d1:d0:e4
remote_mac=0c:42:a1:d1:d0:e0
cloud=1
elif (( host_num == 84 )); then
machine_num=2
rhost_num=83
link_mac=0c:42:a1:d1:d0:e0
remote_mac=0c:42:a1:d1:d0:e4
cloud=1
elif (( host_num == 45 )); then
machine_num=1
cloud=1
elif (( host_num == 8 )); then
link_mac=04:3f:72:d2:af:4e
machine_num=1
cloud=1
elif (( host_num == 7 )); then
machine_num=2
link_mac=04:3f:72:d2:af:62
cloud=1
elif (( host_num == 74 )); then
link=ens4f0
fi
if (( cloud == 1 )); then
link_name=1
link=enp8s0f0
link2=enp8s0f1
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))=$(get_vf $host_num 1 $((i+1)))
eval rep$((i+1))=${link}_$i
done
for (( i = 0; i < numvfs; i++)); do
eval vf$((i+1))_2=$(get_vf $host_num 2 $((i+1)))
eval rep$((i+1))_2=${link2}_$i
done
vf1=enp8s0f2
vf2=enp8s0f3
vf3=enp8s0f4
link_remote_ip=192.168.1.$rhost_num
fi
vni=200
vni=100
vid=5
svid=1000
vid2=6
vxlan_port=4000
vxlan_port=4789
vxlan_mac=24:25:d0:e2:00:00
ecmp=0
ports=2
ports=1
base_baud=115200
base_baud=9600
cpu_num=$(nproc)
if (( cloud == 0 )); then
cpu_num2=$((cpu_num*2))
else
cpu_num2=$((cpu_num-1))
fi
nfs_dir="/auto/mtbcswgwork/cmi"
if which kdump-config > /dev/null 2>&1; then
crash_dir=$(kdump-config show | grep KDUMP_COREDIR | awk '{print $2}')
else
crash_dir=/var/crash
fi
linux_dir=$(readlink /lib/modules/$(uname -r)/build)
images=images
# Append to history
shopt -s histappend
[[ $(hostname -s) != vnc14 ]] && shopt -s autocd
ofed=0
uname -r | grep 3.10 > /dev/null 2>&1 && ofed=1
centos=0
centos72=0
if uname -r | grep 3.10.0-327 > /dev/null 2>&1; then
unum=327
centos=1
centos72=1
fi
kernel49=0
uname -r | grep 4.9 > /dev/null 2>&1 && kernel49=1
centos74=0
if uname -r | grep 3.10.0-693 > /dev/null 2>&1; then
unum=693
centos=1
centos74=1
fi
jd_kernel=0
if uname -r | grep 3.10.0-693.21.3 > /dev/null 2>&1; then
unum=693
centos=1
jd_kernel=1
fi
centos75=0
if uname -r | grep 3.10.0-862 > /dev/null 2>&1; then
unum=862
centos=1
centos75=1
fi
centos76=0
if uname -r | grep 3.10.0-957 > /dev/null 2>&1; then
unum=957
centos=1
centos76=1
fi
# if [[ "$UID" == "0" ]]; then
# dmidecode | grep "Red Hat" > /dev/null 2>&1
# rh=$?
# fi
export LC_ALL=en_US.UTF-8
# export DISPLAY=:0.0
# --add-kernel-support --upstream-libs --dpdk
# export DPDK_DIR=/images/cmi/dpdk-stable-17.11.2
export DPDK_DIR=/root/dpdk-stable-17.11.4
# export RTE_SDK=$DPDK_DIR
# export MLX5_GLUE_PATH=/lib
# export DPDK_TARGET=x86_64-native-linuxapp-gcc
# export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
# make install T=$DPDK_TARGET DESTDIR=install
# export LD_LIBRARY_PATH=$DPDK_DIR/x86_64-native-linuxapp-gcc/lib
# export INSTALL_MOD_STRIP=1
unset CONFIG_LOCALVERSION_AUTO
link_ip=192.168.1.$host_num
link2_ip=192.168.2.$host_num
link_ipv6=1::$host_num
link2_ipv6=2::$host_num
br=br
br2=br2
vx=vxlan0
vx2=vxlan1
bond=bond0
macvlan=macvlan1
# if [[ "$USER" == "root" ]]; then
# if [[ "$(virt-what)" == "" && $centos72 != 1 ]]; then
# echo 1 > /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal
# echo 2000000 > /proc/sys/net/netfilter/nf_conntrack_max
# fi
# fi
link_ip_vlan=1.1.1.100
link_ip_vxlan=1.1.1.200
link_ipv6_vxlan=1::200
brd_mac=ff:ff:ff:ff:ff:ff
if (( centos72 == 1 )); then
vx_rep=dummy_4789
else
vx_rep=vxlan_sys_$vxlan_port
fi
alias scp='scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
alias ssh='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
alias noga='/.autodirect/sw_tools/Internal/Noga/RELEASE/latest/cli/noga_manage.py'
cx5=0
function get_pci
{
# if [[ -e /sys/class/net/$link/device && -f /usr/sbin/lspci ]]; then
if [[ -e /sys/class/net/$link/device ]]; then
pci=$(basename $(readlink /sys/class/net/$link/device))
pci_id=$(echo $pci | cut -b 6-)
lspci -d 15b3: -nn | grep $pci_id | grep 1019 > /dev/null && cx5=1
lspci -d 15b3: -nn | grep $pci_id | grep 1017 > /dev/null && cx5=1
pci2=$(basename $(readlink /sys/class/net/$link2/device) 2> /dev/null)
fi
}
get_pci
alias dpdk-test="sudo build/app/testpmd -c7 -n3 --log-level 8 --vdev=net_pcap0,iface=$link --vdev=net_pcap1,iface=$link2 -- -i --nb-cores=2 --nb-ports=2 --total-num-mbufs=2048"
# testpmd> set fwd flowgen
# testpmd> start
# testpmd> show port stats 0
alias testpmd-ovs='testpmd -l 0-8 -n 4 --socket-mem=1024,1024 -w 04:00.0 -w 04:00.1 -- -i'
alias testpmd-ovs1='testpmd -l 0-8 -n 4 --socket-mem=1024,1024 -w 04:00.3 -- -i'
alias mac1="ip l show $link | grep ether; ip link set dev $link address $link_mac; ip l show $link | grep ether"
alias mac2="ip l show $link | grep ether; ip link set dev $link address $link_mac2; ip l show $link | grep ether"
alias vxlan6="ovs-vsctl add-port $br $vx -- set interface $vx type=vxlan options:remote_ip=$link_remote_ipv6 options:key=$vni options:dst_port=$vxlan_port"
alias vxlan1="ovs-vsctl add-port $br $vx -- set interface $vx type=vxlan options:remote_ip=$link_remote_ip options:key=$vni options:dst_port=$vxlan_port"
alias vxlan4000="ovs-vsctl add-port $br $vx -- set interface $vx type=vxlan options:remote_ip=$link_remote_ip options:key=$vni options:dst_port=4000"
alias vxlan4789="ovs-vsctl add-port $br $vx -- set interface $vx type=vxlan options:remote_ip=$link_remote_ip options:key=$vni options:dst_port=4789"
alias vxlan1-2="ovs-vsctl add-port $br2 $vx2 -- set interface $vx2 type=vxlan options:remote_ip=$link_remote_ip2 options:key=$vni options:dst_port=$vxlan_port"
alias vxlan2="ovs-vsctl del-port $br $vx"
alias vx='vxlan2; vxlan1'
alias ipmirror="ifconfig $link 0; ip addr add dev $link $link_ip_vlan/16; ip link set $link up"
alias vsconfig="sudo ovs-vsctl get Open_vSwitch . other_config"
function vsconfig3
{
set -x
ovs-vsctl get Open_vSwitch . other_config
ovs-vsctl get Port $rep2 other_config
set +x
}
alias vsconfig-idle='ovs-vsctl set Open_vSwitch . other_config:max-idle=30000'
alias vsconfig-hw='ovs-vsctl set Open_vSwitch . other_config:hw-offload="true"'
alias vsconfig-sw='ovs-vsctl set Open_vSwitch . other_config:hw-offload="false"'
alias vsconfig-skip_sw='ovs-vsctl set Open_vSwitch . other_config:tc-policy=skip_sw'
alias vsconfig-skip_hw='ovs-vsctl set Open_vSwitch . other_config:tc-policy=skip_hw'
alias ovs-log='sudo tail -f /var/log/openvswitch/ovs-vswitchd.log'
alias ovs2-log=' tail -f /var/log/openvswitch/ovsdb-server.log'
alias p23="ping 1.1.1.23"
alias p6="ping6 2017::14"
alias 3.10='cd /usr/src/debug/kernel-3.10.0-327.el7/linux-3.10.0-327.el7.x86_64'
alias restart-network='/etc/init.d/network restart'
alias crash2="$nfs_dir/crash/crash -i /root/.crash //boot/vmlinux-$(uname -r).bz2"
# use 'crash -s' to avoid the following error
# log: cannot determine length of symbol: log_end
if test -f /$images/cmi/crash/crash; then
CRASH="sudo /$images/cmi/crash/crash"
else
CRASH="sudo /bin/crash"
fi
VMLINUX=$linux_dir/vmlinux
alias crash1="$CRASH -i /root/.crash $VMLINUX"
alias c=crash1
# -d8 to add debug info
if (( centos == 1 && jd_kernel == 0 )); then
VMLINUX=/usr/lib/debug/lib/modules/3.10.0-${unum}.el7.x86_64/vmlinux
alias c="$CRASH -i /root/.crash /usr/lib/debug/lib/modules/$(uname -r)/vmlinux"
fi
alias c0="$CRASH -i /root/.crash $crash_dir/vmcore.0 $VMLINUX"
alias c1="$CRASH -i /root/.crash $crash_dir/vmcore.1 $VMLINUX"
alias c2="$CRASH -i /root/.crash $crash_dir/vmcore.2 $VMLINUX"
alias c3="$CRASH -i /root/.crash $crash_dir/vmcore.3 $VMLINUX"
alias c4="$CRASH -i /root/.crash $crash_dir/vmcore.4 $VMLINUX"
alias c5="$CRASH -i /root/.crash $crash_dir/vmcore.5 $VMLINUX"
alias c6="$CRASH -i /root/.crash $crash_dir/vmcore.6 $VMLINUX"
alias c7="$CRASH -i /root/.crash $crash_dir/vmcore.7 $VMLINUX"
alias c8="$CRASH -i /root/.crash $crash_dir/vmcore.8 $VMLINUX"
alias c9="$CRASH -i /root/.crash $crash_dir/vmcore.9 $VMLINUX"
alias jd-ovs="del-br; br; ~cmi/bin/ct_lots_rule.sh $rep2 $rep3"
alias jd-vxlan="del-br; brx; ~cmi/bin/ct_lots_rule_vxlan.sh $rep2 $vx"
alias jd-vxlan-ttl="del-br; brx; ~cmi/bin/ct_lots_rule_vxlan-ttl.sh $rep2 $vx"
alias jd-vxlan2="~cmi/bin/ct_lots_rule_vxlan2.sh $rep2 $vx"
alias jd-ovs2="~cmi/bin/ct_lots_rule2.sh $rep2 $rep3 $rep4"
alias jd-ovs-ttl="del-br; br; ~cmi/bin/ct_lots_rule_ttl.sh $rep2 $rep3"
alias ovs-ttl="~cmi/bin/ovs-ttl.sh $rep2 $rep3"
alias pc="picocom -b $base_baud /dev/ttyS1"
alias pcu="picocom -b $base_baud /dev/ttyUSB0"
alias sw='vsconfig-sw; restart-ovs'
alias hw='vsconfig-hw; restart-ovs'
# bluefield
# mlxdump -d 81:00.0 fsdump --type=FT --no_zero
alias fsdump5="mlxdump -d $pci fsdump --type FT --gvmi=0 --no_zero=1"
alias fsdump52="mlxdump -d $pci2 fsdump --type FT --gvmi=1 --no_zero=1"
alias fsdump5="mlxdump -d $pci fsdump --type FT --gvmi=0 --no_zero"
alias fsdump52="mlxdump -d $pci2 fsdump --type FT --gvmi=1 --no_zero"
function fsdump
{
fsdump5 > /root/1.txt
fsdump52 > /root/2.txt
}
alias con='virsh console'
alias con1='virsh console vm1'
alias con2='virsh console vm2'
alias con3='virsh console vm3'
alias con4='virsh console vm4'
alias con5='virsh console vm5'
alias con6='virsh console vm6'
alias con7='virsh console vm7'
alias con8='virsh console vm8'
alias mount-image='mount /dev/mapper/centos74-root /mnt'
alias start1='virsh start vm1'
alias start2='virsh start vm2'
alias start3='virsh start vm3'
alias stop1='virsh destroy vm1'
alias stop2='virsh destroy vm2'
alias stop3='virsh destroy vm3'
alias start1c='virsh start vm1 --console'
alias restart1='stop1; sleep 5; start1'
alias restart2='stop2; sleep 5; start2'
alias restart2='stop3; sleep 5; start3'
alias start-all='start1; start2'
alias stop-all='stop1; stop2'
alias start-all3='start1; start2; start3'
alias stop-all3='stop1; stop2; stop3'
alias restart-all='stop-all; start-all'
alias dud='du -h -d 1'
alias dus='du -sh * | sort -h'
alias clone-git='git clone git@github.com:git/git.git'
alias clone-sflowtool='git clone https://github.com/sflow/sflowtool.git'
alias clone-gdb="git clone git://sourceware.org/git/binutils-gdb.git"
alias clone-ethtool='git clone https://git.kernel.org/pub/scm/network/ethtool/ethtool.git'
alias clone-ofed='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git'
alias clone-ofed5_0='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_5_0'
alias clone-ofed5_1='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_5_1'
alias clone-ofed5_2='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_5_2'
alias clone-ofed='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_5_0_2'
alias clone-ofed-bd='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_4_6_3_bd'
alias clone-ofed-bd-fix='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_4_6_3_bd_fix'
alias clone-ofed-4.7='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_4_7_3'
alias clone-ofed-4.6='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/mlnx-ofa_kernel-4.0.git --branch=mlnx_ofed_4_6_3'
alias clone-asap='git clone ssh://l-gerrit.mtl.labs.mlnx:29418/asap_dev_reg; cp ~/config_chrism_cx5.sh asap_dev_reg'
alias clone-iproute2-ct='git clone https://github.com/roidayan/iproute2 --branch=ct-one-table'
alias clone-iproute='git clone ssh://gerrit.mtl.com:29418/mlnx_ofed/iproute2'
alias clone-iproute2-upstream='git clone git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git'
alias clone-systemtap='git clone git://sourceware.org/git/systemtap.git'
alias clone-systemd='git clone git@github.com:systemd/systemd.git'
alias clone-crash-upstream='git clone git@github.com:crash-utility/crash.git'
alias clone-crash='git clone https://github.com/mishuang2017/crash.git'
alias clone-sm='git clone https://github.com/mishuang2017/sm'
alias clone-bin='git clone https://github.com/mishuang2017/bin.git'
alias clone-c='git clone https://github.com/mishuang2017/c.git'
alias clone-rpmbuild='git clone git@github.com:mishuang2017/rpmbuild.git'
alias clone-ovs='git clone ssh://10.7.0.100:29418/openvswitch'
alias clone-ovs-ofed-5.2='git clone ssh://10.7.0.100:29418/openvswitch --branch=mlnx_ofed_5_2'
alias clone-ovs-upstream='git clone git@github.com:openvswitch/ovs.git'
alias clone-ovs-mishuang='git clone git@github.com:mishuang2017/ovs.git'
alias clone-ovs-ct='git clone https://github.com/roidayan/ovs --branch=ct-one-table-2.10'
alias clone-ovs-ct-one-table-2.10='git clone ssh://10.7.0.100:29418/openvswitch --branch=ct-one-table-2.10'
alias clone-ovs-ct2='git clone git@github.com:mishuang2017/ovs --branch=2.13.0-ct'
alias clone-linux="git clone ssh://cmi@l-gerrit.lab.mtl.com:29418/upstream/linux"
alias clone-linux-4.19-bd='git clone git@github.com:mishuang2017/linux --branch=4.19-bd'
alias clone-scripts="git clone ssh://cmi@l-gerrit.lab.mtl.com:29418/upstream/scripts"
alias clone-bcc='git clone https://github.com/iovisor/bcc.git'
alias clone-bpftrace='git clone https://github.com/iovisor/bpftrace'
alias clone-drgn='git clone https://github.com/osandov/drgn.git' # pip3 install drgn
alias clone-wrk='git clone git@github.com:wg/wrk.git'
alias clone-netperf='git clone git@github.com:HewlettPackard/netperf.git'
alias pull='git pull origin master'
alias wget_teams='wget https://packages.microsoft.com/repos/ms-teams/pool/main/t/teams/teams_1.3.00.16851_amd64.deb' # apt install ./teams_1.3.00.teams_1.3.00.16851_amd64.deb
alias clone-ubuntu-xenial='git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xential.git'
alias clone-ubuntu='git clone git://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git'
# https://packages.ubuntu.com/source/xenial/linux
# http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_4.4.0.orig.tar.gz
# http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_4.4.0-145.171.diff.gz
alias git-net='git remote add net git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git'
alias git-net-next='git remote add net-next git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git'
alias gg='git grep -n'
alias dmesg='dmesg -T'
# evolution, default value 1500=1.5s
alias evolution_mark_read='gsettings set org.gnome.evolution.mail mark-seen-timeout 1'
alias git-log='git log --tags --source'
alias v4.14='git checkout v4.14; git checkout -b 4.14'
alias v4.20='git checkout v4.20; git checkout -b 4.20'
alias v4.19='git checkout v4.19; git checkout -b 4.19'
alias v5.1='git checkout v5.1; git checkout -b 5.1'
alias v5.2='git checkout v5.2; git checkout -b 5.2'
alias v5.3='git checkout v5.3; git checkout -b 5.3'
alias v5.4='git checkout v5.4; git checkout -b 5.4'
alias v5.5='git checkout v5.5; git checkout -b 5.5'
alias v5.9='git checkout v5.9; git checkout -b 5.9'
alias v4.10='git checkout v4.10; git checkout -b 4.10'
alias v4.8='git checkout v4.8; git checkout -b 4.8'
alias v4.8-rc4='git checkout v4.8-rc4; git checkout -b 4.8-rc4'
alias v4.4='git checkout v4.4; git checkout -b 4.4'
alias v6000='git checkout rel-12_25_6000; git checkout -b 12_25_6000'
alias ab='rej; git am --abort'
alias gr='git add -u; git am --resolved'
alias gar='git add -A; git am --resolved'
alias gs='git status'
alias gc='git commit -a'
# alias amend='git commit --amend'
alias slog='git slog'
alias slog1='git slog -1'
alias slog2='git slog -2'
alias slog3='git slog -3'
alias slog4='git slog -4'
alias slog10='git slog -10'
alias git1='git slog v4.11.. drivers/net/ethernet/mellanox/mlx5/core/'
alias gita='git log --tags --source --author="chrism@mellanox.com"'
alias gitvlad='git log --tags --source --author="vladbu@mellanox.com"'
alias gitroi='git log --tags --source --author="roid@mellanox.com"'
alias gitpaul='git log --tags --source --author="paulb@mellanox.com"'
alias gityossi='git log --tags --source --author="yossiku@mellanox.com"'
alias gitelib='git log --tags --source --author="elibr@mellanox.com"'
alias git-linux-origin="git remote set-url origin ssh://cmi@l-gerrit.lab.mtl.com:29418/upstream/linux"
alias git-linus='git remote add linus git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git; git fetch --tags linus'
alias git-net-next='git remote add net-next git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git; fetch net-next master'
# alias git-vlad='git remote add vlad git@github.com:vbuslov/linux.git'
alias git-vlad-v5.4='git log --author=vladbu@mellanox.com --oneline v5.4..'
alias git-vlad-v5.3='git log --author=vladbu@mellanox.com --oneline v5.3..v5.4'
alias git-vlad-v5.2='git log --author=vladbu@mellanox.com --oneline v5.2..v5.3'
alias git-vlad-v5.1='git log --author=vladbu@mellanox.com --oneline v5.1..v5.2'
# git checkout v4.12
# for legacy
alias debug-esw='debugm 8; debug-file drivers/net/ethernet/mellanox/mlx5/core/eswitch.c'
alias debug-esw='debugm 8; debug-file drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c'
alias rx='rxdump -d 03:00.0 -s 0'
alias rx2='rxdump -d 03:00.0 -s 0 -m'
alias sx='sxdump -d 03:00.0 -s 0'
alias or='ssh root@10.209.32.230'
alias t="tcpdump -enn -i $link"
alias t1="tcpdump -enn -v -i $link"
alias t2="tcpdump -enn -vv -i $link"
alias t4="tcpdump -enn -vvvv -i $link"
alias ti='sudo tcpdump -enn -i'
alias mount-mswg='sudo mkdir -p /mswg; sudo mount 10.4.0.102:/vol/mswg/mswg /mswg/'
alias mount-swgwork='sudo mkdir -p /swgwork; sudo mount l1:/vol/swgwork /swgwork'
alias tvf1="tcpdump ip src host 1.1.1.14 -e -xxx -i $vf1"
alias tvf2="tcpdump ip src host 1.1.1.14 -e -xxx -i $vf2"
alias tvx="tcpdump ip dst host 1.1.13.2 -e -xxx -i $vx"
alias watch_netstat='watch -d -n 1 netstat -s'
alias w1='watch -d -n 1'
alias watch_buddy='watch -d -n 1 cat /proc/buddyinfo'
alias watch_upcall='watch -d -n 1 ovs-appctl upcall/show'
alias watch_sar='watch -d -n 1 sar -n DEV 1'
alias watch_lockdep='w1 cat /proc/lockdep_stats'
# sar -n TCP 1
# pidstat -t -p 3794
alias ct=conntrack
alias rej='find . -name *rej -exec rm {} \;'
alias f='find . -name'
alias up="mlxlink -d $pci -p 1 -a UP"
alias down="mlxlink -d $pci -p 1 -a DN"
alias m1="mlxlink -d $pci"
alias modv='modprobe --dump-modversions'
alias ctl='sudo systemctl'
# alias dmesg='dmesg -T'
alias dmesg1='dmesg -HwT'
alias win='vncviewer 10.75.201.135:0'
# alias uperf="$nfs_dir/uperf-1.0.5/src/uperf"
alias chown-linux="sudo chown -R cmi.mtl $linux_dir"
alias chown1="sudo chown -R cmi.mtl ."
alias sb='tmux save-buffer'
alias sm="cd /$images/cmi"
alias sms="cd /$images/cmi/sm"
alias smip="cd /$images/cmi/iproute2"
alias smipu="cd /$images/cmi/iproute2-upstream"
alias smb2="cd /$images/cmi/bcc/tools"
alias smb="cd /$images/cmi/bcc/examples/tracing"
alias smk="cd /$images/cmi/sm/drgn"
alias smdo="cd ~cmi/sm/drgn/ovs"
alias d-ovs="sudo ~cmi/sm/drgn/ovs/ovs.py"
alias sk="cd /swgwork/cmi"
alias softirq="/$images/cmi/bcc/tools/softirqs.py 1"
alias hardirq="/$images/cmi/bcc/tools/hardirqs.py 5"
if [[ "$USER" == "mi" ]]; then
kernel=$(uname -r | cut -d. -f 1-6)
arch=$(uname -m)
fi
alias spec="cd /$images/mi/rpmbuild/SPECS"
alias sml="cd /$images/cmi/linux"
alias sml2="cd /$images/cmi/linux_dmytro"
alias sml3="cd /$images/cmi/linux3"
alias sm5="cd /$images/cmi/5.4"
alias 5c="cd /$images/cmi/5.4-ct"
alias sm-build="cdr; cd build"
alias smu="cd /$images/cmi/upstream"
alias smm="cd /$images/cmi/mlnx-ofa_kernel-4.0"
alias smm2="cd /$images/cmi/mlnx-ofa_kernel-4.0-dmytro"
alias o5="cd /$images/cmi/ofed-5.0/mlnx-ofa_kernel-4.0"
alias o5-5.4="cd /$images/cmi/ofed-5.0/mlnx-ofa_kernel-4.0"
alias m7="cd /$images/cmi/ofed-4.7/mlnx-ofa_kernel-4.0"
alias m6="cd /$images/cmi/ofed-4.6/mlnx-ofa_kernel-4.0"
alias cd-test="cd $linux_dir/tools/testing/selftests/tc-testing/"
alias vi-action="vi $linux_dir/tools/testing/selftests/tc-testing/tc-tests/actions//tests.json"
alias vi-filter="vi $linux_dir/tools/testing/selftests/tc-testing/tc-tests/filters//tests.json"
alias smo="cd /$images/cmi/openvswitch"
alias smo2="cd /$images/cmi/ovs"
alias smo3="cd /$images/cmi/ovs_2.13"
alias smt="cd /$images/cmi/ovs-tests"
alias cfo="cd /$images/cmi/openvswitch; cscope -d"
alias ipa='ip a'
alias ipl='ip l'
alias ipal='ip a l'
alias smd='cd /usr/src/debug/kernel-3.10.0-327.el7/linux-3.10.0-327.el7.x86_64'
alias rmswp='find . -name *.swp -exec rm {} \;'
alias cd-drgn='cd /usr/local/lib64/python3.6/site-packages/drgn-0.0.1-py3.6-linux-x86_64.egg/drgn/helpers/linux/'
alias smdr="cd /$images/cmi/drgn/"
alias sm2="cd $nfs_dir"
alias smc="sm; cd crash; vi net.c"
alias smi='cd /var/lib/libvirt/images'
alias smi2='cd /etc/libvirt/qemu'
alias smn='cd /etc/sysconfig/network-scripts/'
alias bfdb='bridge fdb'
alias bfdb1='bridge fdb | grep 25'
alias vs='sudo ovs-vsctl'
alias of='sudo ovs-ofctl'
alias dp='sudo ovs-dpctl'
alias dpd="sudo ~cmi/bin/ovs-df.sh"
alias dpd-bond='dpd -m | grep -v arp | grep -v "bond0$" | grep offloaded | grep bond0'
alias dpd0='sudo ovs-dpctl dump-flows --name'
alias dpd1='sudo ovs-dpctl dump-flows --name | grep "in_port(enp4s0f0)"'
alias dpd2='sudo ovs-dpctl dump-flows --name | grep "in_port(enp4s0f0_1)"'
alias app='sudo ovs-appctl'
alias fdbs='sudo ovs-appctl fdb/show'
alias fdbi='sudo ovs-appctl fdb/show br-int'
alias fdbe='sudo ovs-appctl fdb/show br-ex'
alias fdb='of show br-int | grep addr; fdbi; of show br-ex | grep addr; fdbe'
alias fdb-br='of show br | grep addr; sudo ovs-appctl fdb/show br'
alias app1='sudo ovs-appctl dpctl/dump-flows'
alias appn='sudo ovs-appctl dpctl/dump-flows --names'
alias app-ct='sudo ovs-appctl app dpctl/dump-conntrack'
alias p1="ping $link_remote_ip"
alias p=p1
alias p2="ping $link_remote_ip2"
# tc -s filter show dev enp4s0f0_1 root
alias tcss="tc -stats filter show dev $link protocol ip parent ffff:"
alias tcss="tc -stats filter show dev $link ingress"
alias tcs2="tc filter show dev $link protocol arp parent ffff:"
alias tcs3="tc filter show dev $link protocol 802.1Q parent ffff:"
alias tcss-rep2="tc -stats filter show dev $rep2 parent ffff:"
alias tcss-rep2-ip="tc -stats filter show dev $rep2 protocol ip parent ffff:"
alias tcss-rep2-ipv6="tc -stats filter show dev $rep2 protocol ipv6 parent ffff:"
alias tcss-rep2-arp="tc -stats filter show dev $rep2 protocol arp parent ffff:"
alias rep2='tcss-rep2-ip'
alias rep2-all='tcss-rep2'
alias tcss-rep3="tc -stats filter show dev $rep3 parent ffff:"
alias tcss-rep3-ip="tc -stats filter show dev $rep3 protocol ip parent ffff:"
alias rep3='tcss-rep3-ip'
alias tcss-rep-port2="tc -stats filter show dev enp4s0f1_1 parent ffff:"
alias tcss-rep-ip-port2="tc -stats filter show dev enp4s0f1_1 protocol ip parent ffff:"
alias tcss-rep="tc -stats filter show dev $rep1 ingress"
alias tcss-rep-ip="tc -stats filter show dev $rep1 protocol ip parent ffff:"
alias tcss-rep-arp="tc -stats filter show dev $rep1 protocol arp parent ffff:"
alias rep='tcss-rep'
alias tl=tcss-link
alias tcss-link-ip="tc -stats filter show dev $link protocol ip parent ffff:"
alias tcss-link-arp="tc -stats filter show dev $link protocol arp parent ffff:"
alias tcss-link="tc -stats filter show dev $link parent ffff:"
alias tcss-vxlan="tc -stats filter show dev $vx_rep parent ffff:"
alias vxlan=tcss-vxlan
alias tcss-vxlan-arp="tc -stats filter show dev $vx_rep protocol arp parent ffff:"
alias tcss-vxlan-all="tc -stats filter show dev $vx_rep ingress"
alias tcss-vx-ip="tc -stats filter show dev $vx protocol ip parent ffff:"
alias tcss-vx-arp="tc -stats filter show dev $vx protocol arp parent ffff:"
alias tcss-vx="tc -stats filter show dev $vx ingress"
# "tc -s filter show dev enp4s0f0_0 ingress"
alias tcs-rep="tc filter show dev $rep1 protocol ip parent ffff:"
alias tcs-arp-rep="tc filter show dev $rep1 protocol arp parent ffff:"
alias s="[[ $UID == 0 ]] && su - cmi"
alias susu='sudo su'
alias s2='su - mi'
alias s0="[[ $UID == 0 ]] && su cmi"
alias e=exit
alias vnc2="ssh cmi@10.7.2.14"
alias vnc="ssh cmi@10.75.68.111"
alias netstat1='netstat -ntlp'
alias bf12='ssh root@bu-lab12v' # minicom
alias bf31='ssh root@bu-lab31v' # HV
alias 13='ssh -X root@10.75.205.13'
alias 14='ssh -X root@10.75.205.14'
alias i1='ssh -X root@10.130.41.1'
alias i2='ssh -X root@10.130.42.1'
alias i3='ssh -X root@10.130.43.1'
alias 15='ssh root@10.75.205.15'
alias vm1=15
alias 16='ssh root@10.75.205.16'
alias vm2=16
alias 17='ssh root@10.75.205.17'
alias vm3=17
alias 18='ssh root@10.75.205.18'
alias vm4=18
alias 9='ssh root@10.75.205.9'
alias vm5=9
alias 8='ssh root@10.75.205.8'
alias vm6=8
alias b3='lspci -d 15b3: -nn'
alias ..='cd ..'
alias ...='cd ../..'
alias lc='ls --color'
alias l='ls -lh'
alias ll='ls -lh'
alias df='df -h'
alias vi='vim'
alias vd='vimdiff'
alias vipr='vi ~/.profile'
alias virca='vi ~/.bashrc*'
alias visc='vi ~/.screenrc'
alias vv='vi ~/.vimrc'
alias vis='vi ~/.ssh/known_hosts'
alias vin='vi ~/sm/notes.txt'
alias vij='vi ~/Documents/jd.txt'
alias vi1='vi ~/Documents/ovs.txt'
alias vi2='vi ~/Documents/mirror.txt'
alias vip='vi ~/Documents/private.txt'
alias viperf='vi ~/Documents/perf.txt'
alias vime='sudo vim /boot/grub/menu.lst'
alias vig='sudo vim /boot/grub2/grub.cfg'
alias vig1='sudo vim /boot/grub/grub.conf'
alias vig2='sudo vim /etc/default/grub'
alias viu="vi $nfs_dir/uperf-1.0.5/workloads/netperf.xml"
alias vit='vi ~/.tmux.conf'
alias vic='vi ~/.crash'
alias viu='vi /etc/udev/rules.d/82-net-setup-link.rules'
alias vigdb='vi ~/.gdbinit'
alias vi_update_skb='vi -t mlx5e_rep_tc_update_skb'
alias vi_psample="vi net/psample/psample.c net/sched/psample_stub.c include/net/psample.h"
alias vi_sample1="vi drivers/net/ethernet/mellanox/mlx5/core/en/tc_sample.c drivers/net/ethernet/mellanox/mlx5/core/en/tc_sample.h "
alias vi_sample="vi drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c drivers/net/ethernet/mellanox/mlx5/core/esw/sample.h "
alias vi_ct="vi drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h "
alias vi_cts="vi drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c drivers/net/ethernet/mellanox/mlx5/core/en/tc_sample.c \
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h drivers/net/ethernet/mellanox/mlx5/core/en/tc_sample.h"
alias vi_mod_hdr='vi drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c '
alias vi_vport="vi drivers/net/ethernet/mellanox/mlx5/core/esw/vporttbl.c "
alias vi_offloads="vi drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c "
alias vi_esw="vi drivers/net/ethernet/mellanox/mlx5/core/eswitch.h "
alias vi_mapping='vi drivers/net/ethernet/mellanox/mlx5/core/en/mapping.c drivers/net/ethernet/mellanox/mlx5/core/en/mapping.h '
alias vi_chains="vi drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.h "
alias vi_en_tc="vi drivers/net/ethernet/mellanox/mlx5/core/en_tc.c "
alias r12="vi /labhome/cmi/sflow/ofproto/0/r12/*"
alias vi_esw2="vi include/linux/mlx5/eswitch.h "
alias vi_netdev-offload-tc="vi lib/netdev-offload-tc.c"
alias vi-tc="vi lib/netdev-offload-tc.c"
alias vi-dpdk="vi lib/netdev-offload-dpdk.c"
alias vi_netdev-offload="vi lib/netdev-offload.c"
alias vi_dpif-netlink="vi lib/dpif-netlink.c"
alias vi_ovs_in='vi utilities/ovs-kmod-ctl.in'
alias vi_errno='vi include/uapi/asm-generic/errno.h '
alias vi_act_ct='vi net/sched/act_ct.c '
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ta='type -all'
# alias grep='grep --color=auto'
alias h='history'
alias screen='screen -h 1000'
alias path='echo -e ${PATH//:/\\n}'
alias x=~cmi/bin/x.py
alias cf=" cscope -d"
alias cfm="smm; cscope -d"
alias cf2="cd /auto/mtbcswgwork/cmi/iproute2; cscope -d"
alias cf3='sm3; cscope -d'
alias cfc='cd /usr/src/debug/*/*; cscope -d'
alias cdr="cd /lib/modules/$(uname -r)"
alias nc-server='nc -l -p 80 < /dev/zero'
alias nc-client='nc localhost 80 > /dev/null'
alias nc-client='nc 1.1.1.1 80 > /dev/null'
alias nc-client="nc 192.168.1.$rhost_num 80 > /dev/null"
# password is windows password
alias mount-setup="mkdir -p /mnt/setup; mount -o username=cmi //10.200.0.25/Setup /mnt/setup"
alias qlog='less /var/log/libvirt/qemu/vm1.log'
# alias vd='virsh dumpxml vm1'
alias simx='/opt/simx/bin/manage_vm_simx_support.py -n vm2'
alias vfs99="mlxconfig -d $pci set SRIOV_EN=1 NUM_OF_VFS=99"
alias vfs127="mlxconfig -d $pci set SRIOV_EN=1 NUM_OF_VFS=127"
alias vfs63="mlxconfig -d $pci set SRIOV_EN=1 NUM_OF_VFS=63"
alias vfs32="mlxconfig -d $pci set SRIOV_EN=1 NUM_OF_VFS=32"
alias vfs16="mlxconfig -d $pci set SRIOV_EN=1 NUM_OF_VFS=16"
alias vfs2="mlxconfig -d $pci2 set SRIOV_EN=1 NUM_OF_VFS=4"
alias vfq="mlxconfig -d $pci q"
alias vfq2="mlxconfig -d $pci2 q"
alias vfsm="mlxconfig -d $linik_bdf set NUM_VF_MSIX=16"
alias vfsm="mlxconfig -d $pci set NUM_VF_MSIX=30"
alias tune1="ethtool -C $link adaptive-rx off rx-usecs 64 rx-frames 128 tx-usecs 64 tx-frames 32"
alias tune2="ethtool -C $link adaptive-rx on"
alias tune3="ethtool -c $link"
alias lsblk_all='lsblk -o name,label,partlabel,mountpoint,size,uuid,fstype'
ETHTOOL=/images/cmi/ethtool/ethtool
function ethtool-rxvlan-off
{
$ETHTOOL -k $link | grep rx-vlan-offload
$ETHTOOL -K $link rxvlan off
$ETHTOOL -k $link | grep rx-vlan-offload
}
alias eoff=ethtool-rxvlan-off
function ethtool-rxvlan-on
{
$ETHTOOL -k $link | grep rx-vlan-offload
$ETHTOOL -K $link rxvlan on
$ETHTOOL -k $link | grep rx-vlan-offload
}
alias restart-virt='systemctl restart libvirtd.service'
export PATH=/usr/local/bin:/usr/local/sbin/:/usr/bin/:/usr/sbin:/bin/:/sbin:~/bin:/opt/mellanox/iproute2/sbin
# export PATH=$PATH:/images/cmi/dpdk-stable-17.11.2/install
export EDITOR=vim
export TERM=xterm
[[ "$HOSTNAME" == "bc-vnc02" ]] && export TERM=screen
[[ "$HOSTNAME" == "vnc14.mtl.labs.mlnx" ]] && export TERM=screen
unset PROMPT_COMMAND
n_time=20
m_msg=64000
netperf_ip=192.168.1.13
alias np1="netperf -H $netperf_ip -t TCP_STREAM -l $n_time -- m $m_msg -p 12865 &"
alias np3="ip netns exec n1 netperf -H 1.1.1.13 -t TCP_STREAM -l $n_time -- m $m_msg -p 12865 &"
alias np4="ip netns exec n1 netperf -H 1.1.1.13 -t TCP_STREAM -l $n_time -- m $m_msg -p 12866 &"
alias np5="ip netns exec n1 netperf -H 1.1.1.13 -t TCP_STREAM -l $n_time -- m $m_msg -p 12867 &"
alias sshcopy='ssh-copy-id -i ~/.ssh/id_rsa.pub'
# ct + snat with br-int and br-ex and pf is in br-ex without vxlan
# use arp responder to get arp reply
# connection will be aborted
alias r9a="restart-ovs; sudo ~cmi/bin/test_router9-ar.sh; enable-ovs-debug"
# ct + snat with br-int and br-ex and pf is in br-ex without vxlan
# configure ip address on br-ex
alias r9="restart-ovs; sudo ~cmi/bin/test_router9-orig.sh; enable-ovs-debug"
alias r92="restart-ovs; sudo ~cmi/bin/test_router9-test2.sh; enable-ovs-debug"
alias rx="restart-ovs; sudo ~cmi/bin/test_router-vxlan.sh; enable-ovs-debug" # snat + vxlan. vxlan in br-int, pf in br-ex
alias baidu="del-br; sudo ~cmi/bin/test_router-baidu.sh; enable-ovs-debug" # vm2 underlay
alias dnat-no-ct="restart-ovs; sudo ~cmi/bin/test_router-dnat.sh; enable-ovs-debug" # dnat
alias dnat-ct="del-br; sudo ~cmi/bin/test_router-dnat-ct.sh; enable-ovs-debug" # dnat
alias dnat="del-br; sudo ~cmi/bin/test_router-dnat-ct-new.sh; enable-ovs-debug" # dnat
alias dnat-trex="del-br; sudo ~cmi/bin/test_router-dnat-trex.sh; enable-ovs-debug" # dnat
alias rx2="restart-ovs; sudo ~cmi/bin/test_router-vxlan2.sh; enable-ovs-debug"
alias r9t="restart-ovs; sudo ~cmi/bin/test_router9-test.sh; enable-ovs-debug"
alias r8="restart-ovs; sudo ~cmi/bin/test_router8.sh; enable-ovs-debug" # ct + snat with br-int and br-ex and pf is not in br-ex, using iptable with vxlan
alias r7="restart-ovs; bru; sudo ~cmi/bin/test_router7.sh; enable-ovs-debug" # ct + snat with more recircs
alias r6="sudo ~cmi/bin/test_router6.sh" # ct + snat with Yossi's script for VF
alias r5="sudo ~cmi/bin/test_router5.sh" # ct + snat with Yossi's script for PF
alias dnat2="sudo ~cmi/bin/dnat.sh" # dnat only
alias r52="sudo ~cmi/bin/test_router5-2.sh" # ct + snat with Yossi's script for PF, enhanced
alias r4="sudo ~cmi/bin/test_router4.sh" # ct + snat, can't offload
alias r3="sudo ~cmi/bin/test_router3.sh" # ct + snat, can't offload
alias r2="sudo ~cmi/bin/test_router2.sh" # snat, can offload