Re: [ovs-discuss] [dpdk-users] OVS-DPDK - TAP0 - vdev (af_packet) device is linkdown
On Tue, 20 Jun 2017 09:40:47 + "Avi Cohen (A)"wrote: > Hello All, > > I did upgrade to dpdk-17.05 and ovs-2-7.1 and create a vdev - af_packet > device according the config script below > This tap device connects the ovs-dpdk to a name space > The problem is that this tap00 device is linkdown - (never reach RUNNING > state ) - hence no pkt is received transmitted on this interface although > the tap0 creation in ovs is OK, > I'm attaching the config script and output of netstat and ifconfig in the > namespace > Can someone please tell me how to activate the tap0 ? > > Config script : > > > cd ../dpdk-17.05/usertools/ > modprobe uio > insmod ../x86_64-native-linuxapp-gcc/kmod/igb_uio.ko > ifconfig ens3 down > > ./dpdk-devbind.py --bind=igb_uio :00:03.0 ./dpdk-devbind.py --status > > cd - > > pkill -9 ovs > rm -rf /usr/local/var/run/openvswitch > rm -rf /usr/local/etc/openvswitch/ > rm -f /usr/local/etc/openvswitch/conf.db > mkdir -p /usr/local/etc/openvswitch > mkdir -p /usr/local/var/run/openvswitch > > > ./ovsdb/ovsdb-tool create /usr/local/etc/openvswitch/conf.db > ./vswitchd/vswitch.ovsschema ./ovsdb/ovsdb-server > --remote=punix:/usr/local/var/run/openvswitch/db.sock > --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach > ./utilities/ovs-vsctl --no-wait init > > echo 8192 > > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages > echo 8192 > > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages > > mkdir -p /mnt/huge > mkdir -p /mnt/huge_2mb > mount -t hugetlbfs none /mnt/huge_2mb -o pagesize=2MB > > modprobe openvswitch > export DB_SOCK=/usr/local/var/run/openvswitch/db.sock > > ./utilities/ovs-vsctl --no-wait set Open_vSwitch . > other_config:dpdk-init=true ./vswitchd/ovs-vswitchd unix:$DB_SOCK --pidfile > --detach ./utilities/ovs-vsctl set Open_vSwitch . > other_config:pmd-cpu-mask=0x80 > > > > utilities/ovs-vsctl --may-exist add-br br-int \ > -- set Bridge br-int datapath_type=netdev \ > -- br-set-external-id br-int bridge-id br-int \ > -- set bridge br-int fail-mode=standalone > > > > ip tuntap add dev tap0 mode tap > > ovs-vsctl add-port br-int tap0 -- set Interface tap0 type=dpdk \ > options:dpdk-devargs=eth_af_packet0,iface=tap0 > > > > ip netns add red > ip link set tap0 netns red > ip netns exec red ip addr add 1.1.1.20/24 dev tap0 ip netns exec red ip link > set tap0 up > > > > > utilities/ovs-vsctl --may-exist add-port br-int vxlan0 \ > -- set interface vxlan0 type=vxlan options:remote_ip=172.31.100.44 > options:key=1000 > > > > > utilities/ovs-vsctl --may-exist add-br br-phy \ > -- set Bridge br-phy datapath_type=netdev \ > -- br-set-external-id br-phy bridge-id br-phy \ > -- set bridge br-phy fail-mode=standalone \ >other_config:hwaddr=02:d7:d1:26:84:e5 > > > utilities/ovs-vsctl --timeout 10 --may-exist add-port br-phy dpdk0 -- set > Interface dpdk0 type=dpdk options:dpdk-devargs=:00:03.0 > > > > > ip addr add 172.31.100.80/24 dev br-phy > > > > ip link set br-phy up > ip link set br-int up > iptables -F > > > utilities/ovs-appctl ovs/route/show > > > ip netns exec red bash > ifconfig lo up > > # > netstat -v -s -e > Ip: > 7 total packets received > 0 forwarded > 0 incoming packets discarded > 7 incoming packets delivered > 14 requests sent out > Icmp: > 7 ICMP messages received > 0 input ICMP message failed. > ICMP input histogram: > destination unreachable: 7 > 14 ICMP messages sent > 0 ICMP messages failed > ICMP output histogram: > destination unreachable: 7 > echo request: 7 > IcmpMsg: > InType3: 7 > OutType3: 7 > OutType8: 7 > Tcp: > 0 active connections openings > 0 passive connection openings > 0 failed connection attempts > 0 connection resets received > 0 connections established > 0 segments received > 0 segments send out > 0 segments retransmited > 0 bad segments received. > 0 resets sent > Udp: > 0 packets received > 0 packets to unknown port received. > 0 packet receive errors > 0 packets sent > UdpLite: > TcpExt: > 0 packet headers predicted > IpExt: > InOctets: 784 > OutOctets: 1372 > InNoECTPkts: 7 > root@ip-172-31-100-80:/home/ubuntu/openvswitch-2.7.0# ifconfig > loLink encap:Local Loopback > inet addr:127.0.0.1 Mask:255.0.0.0 > inet6 addr: ::1/128 Scope:Host > UP LOOPBACK RUNNING MTU:65536 Metric:1 > RX packets:7 errors:0 dropped:0 overruns:0 frame:0 > TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1 > RX bytes:784 (784.0 B) TX bytes:784 (784.0 B) > > tap0 Link encap:Ethernet HWaddr 1a:ef:3c:87:d7:67 > inet addr:1.1.1.20 Bcast:0.0.0.0
Re: [ovs-discuss] [ovs-dev] rpmbuild failure for ovs_dpdk
Correction: ovs-discuss@openvswitch.org On 6/20/17, 9:01 AM, "ovs-discuss-boun...@openvswitch.org on behalf of Darrell Ball"wrote: Again, send to disc...@openvswitch.org Do you see something like this ? darrell@prmh-nsx-perf-server125:~/ovs/ovs_master$ grep -nr LDFLAGS _gcc/config.status 846:S["OVS_LDFLAGS"]=" -L/usr/src/dpdk-16.11/x86_64-native-linuxapp-gcc/lib" with dpdk-16.07 instead of dpdk-16.11 . . . On 6/20/17, 5:43 AM, "ovs-dev-boun...@openvswitch.org on behalf of 王志克" wrote: Hi All, I try to build rpm for ovs+dpdk, but met below compiling issue. Does someone know how to fix it? I guess it is related to LDFLAGS='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld, but no idea how to fix it. If I follow below guide (non-rpm), everything is OK. https://urldefense.proofpoint.com/v2/url?u=http-3A__docs.openvswitch.org_en_latest_intro_install_dpdk_=DwICAg=uilaK90D4TOVoH58JNXRgQ=BVhFA09CGX7JQ5Ih-uZnsw=U_c6DG0MU2EKiNSi8V100nCZs5fqmWt3JWLXzyMTsCE=3m7uHcguxmbP_bpOW5kMPStCjz2C4mE5DPJSy1wYINY= I use dpdk-16.07 and ovs 2.6 without any change. [root@A01-R06-I187-15 openvswitch-2.6.0]# rpmbuild -bb --without check --with dpdk rhel/openvswitch-fedora.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.PBk26t + umask 022 + cd /root/rpmbuild/BUILD + cd /root/rpmbuild/BUILD + rm -rf openvswitch-2.6.0 + /usr/bin/gzip -dc /root/rpmbuild/SOURCES/openvswitch-2.6.0.tar.gz + /usr/bin/tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd openvswitch-2.6.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.ZxDsjh + umask 022 + cd /root/rpmbuild/BUILD + cd openvswitch-2.6.0 + CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' + export CFLAGS + CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' + export CXXFLAGS + FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I/usr/lib64/gfortran/modules' + export FFLAGS + FCFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I/usr/lib64/gfortran/modules' + export FCFLAGS + LDFLAGS='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' + export LDFLAGS + '[' 1 == 1 ']' + '[' x86_64 == ppc64le ']' ++ find . -name config.guess -o -name config.sub + for i in '$(find . -name config.guess -o -name config.sub)' ++ basename ./build-aux/config.guess + '[' -f /usr/lib/rpm/redhat/config.guess ']' + /usr/bin/rm -f ./build-aux/config.guess ++ basename ./build-aux/config.guess + /usr/bin/cp -fv /usr/lib/rpm/redhat/config.guess ./build-aux/config.guess '/usr/lib/rpm/redhat/config.guess' -> './build-aux/config.guess' + for i in '$(find . -name config.guess -o -name config.sub)' ++ basename ./build-aux/config.sub + '[' -f /usr/lib/rpm/redhat/config.sub ']' + /usr/bin/rm -f ./build-aux/config.sub ++ basename ./build-aux/config.sub + /usr/bin/cp -fv /usr/lib/rpm/redhat/config.sub ./build-aux/config.sub '/usr/lib/rpm/redhat/config.sub' -> './build-aux/config.sub' ++ dirname /usr/share/dpdk/x86_64-default-linuxapp-gcc/.config + ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-libcapng
[ovs-discuss] Match only the upper 3 bits of dscp field
Hi I need to modify the tos field of ipv4 frames. The rule I currently have for this looks something like: ovs-ofctl add-flow br0-wlan0 "table=20 priority=100 dl_type=0x0800 nw_tos=32 actions=mod_nw_tos:224" I only want to match the upper most 3 bits of the DSCP field. This rule as it is has the obvious drawback of the rule only matching when the lower 3 bits are 0. When I try to create a rule with: ovs-ofctl add-flow br0-wlan0 "table=22 priority=0 dl_type=0x0800 nw_tos=160/0xe0 actions=load:5->nw_tos[5..7]" I get the message; ovs-ofctl: 160/0xe0: invalid mask for field nw_tos The match nw_tos=160/0xff works. The current workaround I have for this is: ovs-ofctl add-flow br0 "table=0 priority=0 in_port=2 actions=resubmit(,20),resubmit(,21),output:1" ovs-ofctl add-flow br0 "table=20 priority=0 dl_type=0x0800 actions=move:NXM_OF_IP_TOS[5..7]->NXM_NX_REG0[0..2]" ovs-ofctl add-flow br0 "table=21 priority=0 dl_type=0x0800 reg0=4 actions=load:5->nw_tos[5..7]" Does anyone have a better idea how to do this? BR Matthias ___ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
Re: [ovs-discuss] OVS-DPDK - TAP0 - vdev (af_packet) device is linkdown
Update I see in log file the following error msgs .. libvirtd[1734]: Failed to open file '/sys/class/net/tap0/operstate': No such file or directory libvirtd[1734]: unable to read: /sys/class/net/tap0/operstate: No such file or directory kernel: [ 38.948590] IPv6: ADDRCONF(NETDEV_UP): tap0: link is not ready > -Original Message- > From: Avi Cohen (A) > Sent: Tuesday, 20 June, 2017 12:41 PM > To: 'ovs-discuss@openvswitch.org'; 'us...@dpdk.org' > Subject: OVS-DPDK - TAP0 - vdev (af_packet) device is linkdown > > Hello All, > > I did upgrade to dpdk-17.05 and ovs-2-7.1 and create a vdev - af_packet > device according the config script below This tap device connects the ovs- > dpdk to a name space The problem is that this tap00 device is linkdown - > (never reach RUNNING state ) - hence no pkt is received transmitted on this > interface although the tap0 creation in ovs is OK, I'm attaching the config > script and output of netstat and ifconfig in the namespace Can someone > please tell me how to activate the tap0 ? > > Config script : > > > cd ../dpdk-17.05/usertools/ > modprobe uio > insmod ../x86_64-native-linuxapp-gcc/kmod/igb_uio.ko > ifconfig ens3 down > > ./dpdk-devbind.py --bind=igb_uio :00:03.0 ./dpdk-devbind.py --status > > cd - > > pkill -9 ovs > rm -rf /usr/local/var/run/openvswitch > rm -rf /usr/local/etc/openvswitch/ > rm -f /usr/local/etc/openvswitch/conf.db > mkdir -p /usr/local/etc/openvswitch > mkdir -p /usr/local/var/run/openvswitch > > > ./ovsdb/ovsdb-tool create /usr/local/etc/openvswitch/conf.db > ./vswitchd/vswitch.ovsschema ./ovsdb/ovsdb-server -- > remote=punix:/usr/local/var/run/openvswitch/db.sock -- > remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach > ./utilities/ovs-vsctl --no-wait init > > echo 8192 > /sys/devices/system/node/node0/hugepages/hugepages- > 2048kB/nr_hugepages > echo 8192 > /sys/devices/system/node/node1/hugepages/hugepages- > 2048kB/nr_hugepages > > mkdir -p /mnt/huge > mkdir -p /mnt/huge_2mb > mount -t hugetlbfs none /mnt/huge_2mb -o pagesize=2MB > > modprobe openvswitch > export DB_SOCK=/usr/local/var/run/openvswitch/db.sock > > ./utilities/ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true > ./vswitchd/ovs-vswitchd unix:$DB_SOCK --pidfile --detach ./utilities/ovs-vsctl > set Open_vSwitch . other_config:pmd-cpu-mask=0x80 > > > > utilities/ovs-vsctl --may-exist add-br br-int \ > -- set Bridge br-int datapath_type=netdev \ > -- br-set-external-id br-int bridge-id br-int \ > -- set bridge br-int fail-mode=standalone > > > > ip tuntap add dev tap0 mode tap > > ovs-vsctl add-port br-int tap0 -- set Interface tap0 type=dpdk \ > options:dpdk-devargs=eth_af_packet0,iface=tap0 > > > > ip netns add red > ip link set tap0 netns red > ip netns exec red ip addr add 1.1.1.20/24 dev tap0 ip netns exec red ip link > set > tap0 up > > > > > utilities/ovs-vsctl --may-exist add-port br-int vxlan0 \ > -- set interface vxlan0 type=vxlan options:remote_ip=172.31.100.44 > options:key=1000 > > > > > utilities/ovs-vsctl --may-exist add-br br-phy \ > -- set Bridge br-phy datapath_type=netdev \ > -- br-set-external-id br-phy bridge-id br-phy \ > -- set bridge br-phy fail-mode=standalone \ >other_config:hwaddr=02:d7:d1:26:84:e5 > > > utilities/ovs-vsctl --timeout 10 --may-exist add-port br-phy dpdk0 -- set > Interface dpdk0 type=dpdk options:dpdk-devargs=:00:03.0 > > > > > ip addr add 172.31.100.80/24 dev br-phy > > > > ip link set br-phy up > ip link set br-int up > iptables -F > > > utilities/ovs-appctl ovs/route/show > > > ip netns exec red bash > ifconfig lo up > > # > netstat -v -s -e > Ip: > 7 total packets received > 0 forwarded > 0 incoming packets discarded > 7 incoming packets delivered > 14 requests sent out > Icmp: > 7 ICMP messages received > 0 input ICMP message failed. > ICMP input histogram: > destination unreachable: 7 > 14 ICMP messages sent > 0 ICMP messages failed > ICMP output histogram: > destination unreachable: 7 > echo request: 7 > IcmpMsg: > InType3: 7 > OutType3: 7 > OutType8: 7 > Tcp: > 0 active connections openings > 0 passive connection openings > 0 failed connection attempts > 0 connection resets received > 0 connections established > 0 segments received > 0 segments send out > 0 segments retransmited > 0 bad segments received. > 0 resets sent > Udp: > 0 packets received > 0 packets to unknown port received. > 0 packet receive errors > 0 packets sent > UdpLite: > TcpExt: > 0 packet headers predicted > IpExt: > InOctets: 784 > OutOctets: 1372 > InNoECTPkts: 7 > root@ip-172-31-100-80:/home/ubuntu/openvswitch-2.7.0# ifconfig > loLink encap:Local Loopback > inet addr:127.0.0.1 Mask:255.0.0.0 > inet6
[ovs-discuss] OVS-DPDK - TAP0 - vdev (af_packet) device is linkdown
Hello All, I did upgrade to dpdk-17.05 and ovs-2-7.1 and create a vdev - af_packet device according the config script below This tap device connects the ovs-dpdk to a name space The problem is that this tap00 device is linkdown - (never reach RUNNING state ) - hence no pkt is received transmitted on this interface although the tap0 creation in ovs is OK, I'm attaching the config script and output of netstat and ifconfig in the namespace Can someone please tell me how to activate the tap0 ? Config script : cd ../dpdk-17.05/usertools/ modprobe uio insmod ../x86_64-native-linuxapp-gcc/kmod/igb_uio.ko ifconfig ens3 down ./dpdk-devbind.py --bind=igb_uio :00:03.0 ./dpdk-devbind.py --status cd - pkill -9 ovs rm -rf /usr/local/var/run/openvswitch rm -rf /usr/local/etc/openvswitch/ rm -f /usr/local/etc/openvswitch/conf.db mkdir -p /usr/local/etc/openvswitch mkdir -p /usr/local/var/run/openvswitch ./ovsdb/ovsdb-tool create /usr/local/etc/openvswitch/conf.db ./vswitchd/vswitch.ovsschema ./ovsdb/ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach ./utilities/ovs-vsctl --no-wait init echo 8192 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages echo 8192 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages mkdir -p /mnt/huge mkdir -p /mnt/huge_2mb mount -t hugetlbfs none /mnt/huge_2mb -o pagesize=2MB modprobe openvswitch export DB_SOCK=/usr/local/var/run/openvswitch/db.sock ./utilities/ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true ./vswitchd/ovs-vswitchd unix:$DB_SOCK --pidfile --detach ./utilities/ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x80 utilities/ovs-vsctl --may-exist add-br br-int \ -- set Bridge br-int datapath_type=netdev \ -- br-set-external-id br-int bridge-id br-int \ -- set bridge br-int fail-mode=standalone ip tuntap add dev tap0 mode tap ovs-vsctl add-port br-int tap0 -- set Interface tap0 type=dpdk \ options:dpdk-devargs=eth_af_packet0,iface=tap0 ip netns add red ip link set tap0 netns red ip netns exec red ip addr add 1.1.1.20/24 dev tap0 ip netns exec red ip link set tap0 up utilities/ovs-vsctl --may-exist add-port br-int vxlan0 \ -- set interface vxlan0 type=vxlan options:remote_ip=172.31.100.44 options:key=1000 utilities/ovs-vsctl --may-exist add-br br-phy \ -- set Bridge br-phy datapath_type=netdev \ -- br-set-external-id br-phy bridge-id br-phy \ -- set bridge br-phy fail-mode=standalone \ other_config:hwaddr=02:d7:d1:26:84:e5 utilities/ovs-vsctl --timeout 10 --may-exist add-port br-phy dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=:00:03.0 ip addr add 172.31.100.80/24 dev br-phy ip link set br-phy up ip link set br-int up iptables -F utilities/ovs-appctl ovs/route/show ip netns exec red bash ifconfig lo up # netstat -v -s -e Ip: 7 total packets received 0 forwarded 0 incoming packets discarded 7 incoming packets delivered 14 requests sent out Icmp: 7 ICMP messages received 0 input ICMP message failed. ICMP input histogram: destination unreachable: 7 14 ICMP messages sent 0 ICMP messages failed ICMP output histogram: destination unreachable: 7 echo request: 7 IcmpMsg: InType3: 7 OutType3: 7 OutType8: 7 Tcp: 0 active connections openings 0 passive connection openings 0 failed connection attempts 0 connection resets received 0 connections established 0 segments received 0 segments send out 0 segments retransmited 0 bad segments received. 0 resets sent Udp: 0 packets received 0 packets to unknown port received. 0 packet receive errors 0 packets sent UdpLite: TcpExt: 0 packet headers predicted IpExt: InOctets: 784 OutOctets: 1372 InNoECTPkts: 7 root@ip-172-31-100-80:/home/ubuntu/openvswitch-2.7.0# ifconfig loLink encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:7 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:784 (784.0 B) TX bytes:784 (784.0 B) tap0 Link encap:Ethernet HWaddr 1a:ef:3c:87:d7:67 inet addr:1.1.1.20 Bcast:0.0.0.0 Mask:255.255.255.0 UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Best Regards avi ___ discuss mailing list disc...@openvswitch.org