@@ -775,6 +775,115 @@ for port in 0 1; do
775775 exp1=( 0 0 0 0 )
776776done
777777
778+ cleanup_nsim
779+
780+ # shared port tables
781+ pfx=" table sharing"
782+
783+ echo $NSIM_ID > /sys/bus/netdevsim/new_device
784+ echo 0 > $NSIM_DEV_SYS /del_port
785+
786+ echo 0 > $NSIM_DEV_DFS /udp_ports_open_only
787+ echo 1 > $NSIM_DEV_DFS /udp_ports_sleep
788+ echo 1 > $NSIM_DEV_DFS /udp_ports_shared
789+
790+ old_netdevs=$( ls /sys/class/net)
791+ echo 1 > $NSIM_DEV_SYS /new_port
792+ NSIM_NETDEV=` get_netdev_name old_netdevs`
793+ old_netdevs=$( ls /sys/class/net)
794+ echo 2 > $NSIM_DEV_SYS /new_port
795+ NSIM_NETDEV2=` get_netdev_name old_netdevs`
796+
797+ msg=" VxLAN v4 devices"
798+ exp0=( ` mke 4789 1` 0 0 0 )
799+ exp1=( 0 0 0 0 )
800+ new_vxlan vxlan0 4789 $NSIM_NETDEV
801+ new_vxlan vxlan1 4789 $NSIM_NETDEV2
802+
803+ msg=" VxLAN v4 devices go down"
804+ exp0=( 0 0 0 0 )
805+ ifconfig vxlan1 down
806+ ifconfig vxlan0 down
807+ check_tables
808+
809+ for ifc in vxlan0 vxlan1; do
810+ ifconfig $ifc up
811+ done
812+
813+ msg=" VxLAN v6 device"
814+ exp0=( ` mke 4789 1` ` mke 4790 1` 0 0 )
815+ new_vxlan vxlanC 4790 $NSIM_NETDEV 6
816+
817+ msg=" Geneve device"
818+ exp1=( ` mke 6081 2` 0 0 0 )
819+ new_geneve gnv0 6081
820+
821+ msg=" NIC device goes down"
822+ ifconfig $NSIM_NETDEV down
823+ check_tables
824+
825+ msg=" NIC device goes up again"
826+ ifconfig $NSIM_NETDEV up
827+ check_tables
828+
829+ for i in ` seq 2` ; do
830+ msg=" turn feature off - 1, rep $i "
831+ ethtool -K $NSIM_NETDEV rx-udp_tunnel-port-offload off
832+ check_tables
833+
834+ msg=" turn feature off - 2, rep $i "
835+ exp0=( 0 0 0 0 )
836+ exp1=( 0 0 0 0 )
837+ ethtool -K $NSIM_NETDEV2 rx-udp_tunnel-port-offload off
838+ check_tables
839+
840+ msg=" turn feature on - 1, rep $i "
841+ exp0=( ` mke 4789 1` ` mke 4790 1` 0 0 )
842+ exp1=( ` mke 6081 2` 0 0 0 )
843+ ethtool -K $NSIM_NETDEV rx-udp_tunnel-port-offload on
844+ check_tables
845+
846+ msg=" turn feature on - 2, rep $i "
847+ ethtool -K $NSIM_NETDEV2 rx-udp_tunnel-port-offload on
848+ check_tables
849+ done
850+
851+ msg=" tunnels destroyed 1"
852+ cleanup_tuns
853+ exp0=( 0 0 0 0 )
854+ exp1=( 0 0 0 0 )
855+ check_tables
856+
857+ overflow_table0 " overflow NIC table"
858+
859+ msg=" re-add a port"
860+
861+ echo 2 > $NSIM_DEV_SYS /del_port
862+ echo 2 > $NSIM_DEV_SYS /new_port
863+ check_tables
864+
865+ msg=" replace VxLAN in overflow table"
866+ exp0=( ` mke 10000 1` ` mke 10004 1` ` mke 10002 1` ` mke 10003 1` )
867+ del_dev vxlan1
868+
869+ msg=" vacate VxLAN in overflow table"
870+ exp0=( ` mke 10000 1` ` mke 10004 1` 0 ` mke 10003 1` )
871+ del_dev vxlan2
872+
873+ echo 1 > $NSIM_DEV_DFS /ports/$port /udp_ports_reset
874+ check_tables
875+
876+ msg=" tunnels destroyed 2"
877+ cleanup_tuns
878+ exp0=( 0 0 0 0 )
879+ exp1=( 0 0 0 0 )
880+ check_tables
881+
882+ echo 1 > $NSIM_DEV_SYS /del_port
883+ echo 2 > $NSIM_DEV_SYS /del_port
884+
885+ cleanup_nsim
886+
778887modprobe -r netdevsim
779888
780889if [ $num_errors -eq 0 ]; then
0 commit comments