Re: [ovs-dev] [PATCH v2] rhel: support kmod-openvswitch build against multiple kernels, rhel6
On Wed, Jul 11, 2018 at 4:35 PM, Flavio Leitner wrote: > On Wed, Jul 11, 2018 at 03:30:08PM -0700, Martin Xu wrote: > > This patch only affects rhel6 spec file. > > > > RHEL 7.4 introduced backward incompatible changes in the kernel. As > > a result, prebuilt PRM packages against kernels newer than 693.17.1 > > will cannot be used on systems with older kernels, vice versa. > > > > This patch allows multiple kernel version numbers delimited by > > whitespace to be passed as variable "kversion". kmod-openvswitch RPM > > packages the kernel module .ko files from all specified kernel > > versions. > > > > This patch also includes a script to update the weak-update symlinks > > if the system kernel version is upgraded or downgraded after > > kmod-openvswitch is installed. > > > > Previouly the macro is used to generate spec file > > template to build kmod-openvswitch RPM. This macro is now removed. > > Everything is built in the main package. To maintain consistent naming, > > the rhel6 kmod spec file is renamed to kmod-openvswitch-rhel6.spec to > > match the built package name kmod-openvswitch. > > > > This patch also removes the openvswitch-kmod package. > > This patch does few things at once. It renames the kmod, then do > significant changes at the file and add a new script. > I would suggest to have this split into at least two patches. > The first one renames the file and fix automake/gitignore and > related files as a preparation. > The second one fixes the issue and adds the kmod script. > Thanks for reviewing it. I'll split the patch up. I was troubled by the fact git would just consider it as a brand new file because of the significant changes. > > > Signed-off-by: Martin Xu > > Signed-off-by: Greg Rose > > CC: Ben Pfaff > > CC: Flavio Leitner > > CC: Aaron Conole > > --- > > Documentation/intro/install/rhel.rst | 7 +- > > poc/playbook-centos-builder.yml| 8 +- > > rhel/.gitignore| 1 + > > rhel/automake.mk | 8 +- > > rhel/kmod-openvswitch-rhel6.spec.in| 120 > + > > rhel/openvswitch-kmod-rhel6.spec.in| 103 > -- > > rhel/openvswitch-kmod.files| 3 - > > ...sr_share_openvswitch_scripts_ovs-kmod-manage.sh | 71 > > 8 files changed, 203 insertions(+), 118 deletions(-) > > create mode 100644 rhel/kmod-openvswitch-rhel6.spec.in > > delete mode 100644 rhel/openvswitch-kmod-rhel6.spec.in > > delete mode 100644 rhel/openvswitch-kmod.files > > create mode 100644 rhel/usr_share_openvswitch_ > scripts_ovs-kmod-manage.sh > > > > diff --git a/Documentation/intro/install/rhel.rst > b/Documentation/intro/install/rhel.rst > > index f8b26069f..6f062e894 100644 > > --- a/Documentation/intro/install/rhel.rst > > +++ b/Documentation/intro/install/rhel.rst > > @@ -197,17 +197,16 @@ the unit tests, run:: > > Kernel Module > > ~ > > > > -On RHEL 6, to build the Open vSwitch kernel module, copy > > -rhel/openvswitch-kmod.files into the RPM sources directory and run:: > > +On RHEL 6, to build the Open vSwitch kernel module run:: > > > > -$ rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec > > +$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec > > > > You might have to specify a kernel version and/or variants, e.g.: > > > > $ rpmbuild -bb \ > > -D "kversion 2.6.32-131.6.1.el6.x86_64" \ > > -D "kflavors default debug kdump" \ > > -rhel/openvswitch-kmod-rhel6.spec > > +rhel/kmod-openvswitch-rhel6.spec > > > > This produces an "kmod-openvswitch" RPM for each kernel variant, in this > > example: "kmod-openvswitch", "kmod-openvswitch-debug", and > > diff --git a/poc/playbook-centos-builder.yml > b/poc/playbook-centos-builder.yml > > index 71f104010..e902db75d 100644 > > --- a/poc/playbook-centos-builder.yml > > +++ b/poc/playbook-centos-builder.yml > > @@ -41,13 +41,13 @@ > > chdir: /git/ovs/rhel > > with_items: > >- openvswitch.spec > > - - openvswitch-kmod-rhel6.spec > > + - kmod-openvswitch-rhel6.spec > > > >- name: Install build dependencies specified from spec files > > shell: echo "y" | yum-builddep /tmp/{{item}} > > with_items: > >- openvswitch.spec > > - - openvswitch-kmod-rhel6.spec > > + - kmod-openvswitch-rhel6.spec > > > >- name: Create rpm dev tree > > command: rpmdev-setuptree > > @@ -81,7 +81,7 @@ > >line: "Release: {{ ansible_local.builder.release }}" > > with_items: > >- openvswitch.spec > > - - openvswitch-kmod-rhel6.spec > > + - kmod-openvswitch-rhel6.spec > > > >- name: Build Open vSwitch user space rpms > > command: rpmbuild -bb --without check rhel/openvswitch.spec > > @@ -89,7 +89,7 @@ > > chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" > > > >- name: Build Open vSwitch kmod rpms (only for
Re: [ovs-dev] [PATCH v2] rhel: support kmod-openvswitch build against multiple kernels, rhel6
On Wed, Jul 11, 2018 at 03:30:08PM -0700, Martin Xu wrote: > This patch only affects rhel6 spec file. > > RHEL 7.4 introduced backward incompatible changes in the kernel. As > a result, prebuilt PRM packages against kernels newer than 693.17.1 > will cannot be used on systems with older kernels, vice versa. > > This patch allows multiple kernel version numbers delimited by > whitespace to be passed as variable "kversion". kmod-openvswitch RPM > packages the kernel module .ko files from all specified kernel > versions. > > This patch also includes a script to update the weak-update symlinks > if the system kernel version is upgraded or downgraded after > kmod-openvswitch is installed. > > Previouly the kernel_module_package macro is used to generate spec file > template to build kmod-openvswitch RPM. This macro is now removed. > Everything is built in the main package. To maintain consistent naming, > the rhel6 kmod spec file is renamed to kmod-openvswitch-rhel6.spec to > match the built package name kmod-openvswitch. > > This patch also removes the openvswitch-kmod package. This patch does few things at once. It renames the kmod, then do significant changes at the file and add a new script. I would suggest to have this split into at least two patches. The first one renames the file and fix automake/gitignore and related files as a preparation. The second one fixes the issue and adds the kmod script. > Signed-off-by: Martin Xu > Signed-off-by: Greg Rose > CC: Ben Pfaff > CC: Flavio Leitner > CC: Aaron Conole > --- > Documentation/intro/install/rhel.rst | 7 +- > poc/playbook-centos-builder.yml| 8 +- > rhel/.gitignore| 1 + > rhel/automake.mk | 8 +- > rhel/kmod-openvswitch-rhel6.spec.in| 120 > + > rhel/openvswitch-kmod-rhel6.spec.in| 103 -- > rhel/openvswitch-kmod.files| 3 - > ...sr_share_openvswitch_scripts_ovs-kmod-manage.sh | 71 > 8 files changed, 203 insertions(+), 118 deletions(-) > create mode 100644 rhel/kmod-openvswitch-rhel6.spec.in > delete mode 100644 rhel/openvswitch-kmod-rhel6.spec.in > delete mode 100644 rhel/openvswitch-kmod.files > create mode 100644 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh > > diff --git a/Documentation/intro/install/rhel.rst > b/Documentation/intro/install/rhel.rst > index f8b26069f..6f062e894 100644 > --- a/Documentation/intro/install/rhel.rst > +++ b/Documentation/intro/install/rhel.rst > @@ -197,17 +197,16 @@ the unit tests, run:: > Kernel Module > ~ > > -On RHEL 6, to build the Open vSwitch kernel module, copy > -rhel/openvswitch-kmod.files into the RPM sources directory and run:: > +On RHEL 6, to build the Open vSwitch kernel module run:: > > -$ rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec > +$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec > > You might have to specify a kernel version and/or variants, e.g.: > > $ rpmbuild -bb \ > -D "kversion 2.6.32-131.6.1.el6.x86_64" \ > -D "kflavors default debug kdump" \ > -rhel/openvswitch-kmod-rhel6.spec > +rhel/kmod-openvswitch-rhel6.spec > > This produces an "kmod-openvswitch" RPM for each kernel variant, in this > example: "kmod-openvswitch", "kmod-openvswitch-debug", and > diff --git a/poc/playbook-centos-builder.yml b/poc/playbook-centos-builder.yml > index 71f104010..e902db75d 100644 > --- a/poc/playbook-centos-builder.yml > +++ b/poc/playbook-centos-builder.yml > @@ -41,13 +41,13 @@ > chdir: /git/ovs/rhel > with_items: >- openvswitch.spec > - - openvswitch-kmod-rhel6.spec > + - kmod-openvswitch-rhel6.spec > >- name: Install build dependencies specified from spec files > shell: echo "y" | yum-builddep /tmp/{{item}} > with_items: >- openvswitch.spec > - - openvswitch-kmod-rhel6.spec > + - kmod-openvswitch-rhel6.spec > >- name: Create rpm dev tree > command: rpmdev-setuptree > @@ -81,7 +81,7 @@ >line: "Release: {{ ansible_local.builder.release }}" > with_items: >- openvswitch.spec > - - openvswitch-kmod-rhel6.spec > + - kmod-openvswitch-rhel6.spec > >- name: Build Open vSwitch user space rpms > command: rpmbuild -bb --without check rhel/openvswitch.spec > @@ -89,7 +89,7 @@ > chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" > >- name: Build Open vSwitch kmod rpms (only for currently loaded kernel) > -command: rpmbuild -bb --without check rhel/openvswitch-kmod-rhel6.spec > +command: rpmbuild -bb --without check rhel/kmod-openvswitch-rhel6.spec > args: > chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" > > diff --git a/rhel/.gitignore b/rhel/.gitignore > index e584a1ed0..9b0ce1d38 100644 > --- a/rhel/.gitignore > +++ b/rhel/.gitignore >
Re: [ovs-dev] [PATCH] tests: Add gre test that doesn't requiring Linux gre module
Hi William, Thanks for the test. I will do. Best, Yifeng On Wed, Jul 11, 2018 at 4:19 PM, William Tu wrote: > Thanks for the patch. > > On Tue, Jul 10, 2018 at 12:24 PM, Yifeng Sun > wrote: > > Currently check-kmod's gre test is broken on certain kernel > > versions where ovs's gre module conflits with kernel's gre > > module. But at the same time, present gre test depends on > > Linux gre module to setup gre port. > > > > This patch repairs the gre test by completely removing the > > dependancy of kernel's gre module and emulating a virtual > > Linux gre port that sends out arp and icmp packets. > > > > Suggested-by: William Tu > > Signed-off-by: Yifeng Sun > > --- > > tests/system-common-macros.at | 13 + > > tests/system-traffic.at | 67 ++ > + > > 2 files changed, 80 insertions(+) > > > > diff --git a/tests/system-common-macros.at b/tests/system-common-macros. > at > > index 64bf5ec63ab4..7b841250c383 100644 > > --- a/tests/system-common-macros.at > > +++ b/tests/system-common-macros.at > > @@ -329,3 +329,16 @@ m4_define([OVS_CHECK_IPROUTE_ENCAP], > > # OVS_CHECK_CT_CLEAR() > > m4_define([OVS_CHECK_CT_CLEAR], > > [AT_SKIP_IF([! grep -q "Datapath supports ct_clear action" > ovs-vswitchd.log])]) > > + > > +# GEN_ICMP_DATA([start], [len]) > > +# > > +# Generate space-separated ICMP data that is acceptable to > tests/sendpkt.py. > > +m4_define([GEN_ICMP_DATA], > > +[[ > > + ICMP_DATA="" > > + for (( n=0; n<$2; n++ )); do > > + ICMP_DATA="${ICMP_DATA} $(printf %x $((($1+n) % 256)))" > > + done > > + echo "$ICMP_DATA" > > +]] > > +) > > diff --git a/tests/system-traffic.at b/tests/system-traffic.at > > index 519b234bb16b..37421ed1e78a 100644 > > --- a/tests/system-traffic.at > > +++ b/tests/system-traffic.at > > @@ -339,6 +339,73 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i > 0.3 -w 2 10.1.1.100 | FORMAT_PI > > OVS_TRAFFIC_VSWITCHD_STOP > > AT_CLEANUP > > > > +AT_SETUP([datapath - ping over gre tunnel by simulated packets]) > > +OVS_CHECK_GRE() > > + > > +OVS_TRAFFIC_VSWITCHD_START() > > +AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff: > 00:00:00:01\"]) > > +ADD_BR([br-underlay], [set bridge br-underlay > other-config:hwaddr=\"f2:ff:00:00:00:02\"]) > > + > > +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) > > +AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"]) > > + > > +ADD_NAMESPACES(at_ns0) > > + > > +dnl Set up underlay link from host into the namespace using veth pair. > > +ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24", f2:ff:00:00:00:03) > > +AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"]) > > +AT_CHECK([ip link set dev br-underlay up]) > > + > > +dnl Set up tunnel endpoints on OVS outside the namespace. > > +ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24]) > > + > > +ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & > > maybe you can add a filter here to reduce the packets counts in p0.pcap > below you only egrep ip packet, or gre packet, so you can just > "tcpdump -w p0.pcap proto GRE" > > > > + > > +dnl First, check the underlay. > > +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | > FORMAT_PING], [0], [dnl > > +3 packets transmitted, 3 received, 0% packet loss, time 0ms > > +]) > > + > > +dnl Okay, now we don't actually add the port as below, instead, we > > +dnl emulate it. Suppose its mac address is f2:ff:00:00:00:04. > > +dnl ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], [ > 10.1.1.1/24]) > > + > > +dnl Okay, now send out an arp request from 10.1.1.1 for 10.1.1.100 in > gre. > > +NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 > 02 f2 ff 00 00 00 03 08 00 45 00 00 42 ec 2c 40 00 40 2f f3 bc ac 1f 01 01 > ac 1f 01 64 00 00 65 58 ff ff ff ff ff ff f2 ff 00 00 00 04 08 06 00 01 08 > 00 06 04 00 01 f2 ff 00 00 00 04 0a 01 01 01 00 00 00 00 00 00 0a 01 01 64 > > /dev/null]) > > + > > +sleep 1 > > Is it possible to use OVS_WAIT_UNTIL macro? > > > +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > > 172.31.1.1: GREv0, length 46: ARP, Reply 10.1.1.100 is-at > f2:ff:00:00:00:01 .* length 28" 2>&1 1>/dev/null]) > > + > > +dnl Oaky, now check the overlay by sending out raw icmp packets of > > +dnl different sizes in gre protocol. > > + > > +dnl First, send the packet that emulates > > +dnl `ip netns exec at_ns0 ping 10.1.1.100` > > +NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 > 02 f2 ff 00 00 00 03 08 00 45 00 00 7a ec 8e 40 00 40 2f f3 22 ac 1f 01 01 > ac 1f 01 64 00 00 65 58 f2 ff 00 00 00 01 f2 ff 00 00 00 04 08 00 45 00 00 > 54 54 8f 40 00 40 01 cf b3 0a 01 01 01 0a 01 01 64 08 00 e6 e8 29 27 00 03 > e1 a3 43 5b 00 00 00 00 ff 1a 05 00 00 00 00 00 $(GEN_ICMP_DATA(16, 40)) > > /dev/null]) > > + > > +sleep 1 > > +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > > 172.31.1.1: GREv0, length 102: IP 10.1.1.100
Re: [ovs-dev] [PATCH] tests: Add gre test that doesn't requiring Linux gre module
Thanks for the patch. On Tue, Jul 10, 2018 at 12:24 PM, Yifeng Sun wrote: > Currently check-kmod's gre test is broken on certain kernel > versions where ovs's gre module conflits with kernel's gre > module. But at the same time, present gre test depends on > Linux gre module to setup gre port. > > This patch repairs the gre test by completely removing the > dependancy of kernel's gre module and emulating a virtual > Linux gre port that sends out arp and icmp packets. > > Suggested-by: William Tu > Signed-off-by: Yifeng Sun > --- > tests/system-common-macros.at | 13 + > tests/system-traffic.at | 67 > +++ > 2 files changed, 80 insertions(+) > > diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at > index 64bf5ec63ab4..7b841250c383 100644 > --- a/tests/system-common-macros.at > +++ b/tests/system-common-macros.at > @@ -329,3 +329,16 @@ m4_define([OVS_CHECK_IPROUTE_ENCAP], > # OVS_CHECK_CT_CLEAR() > m4_define([OVS_CHECK_CT_CLEAR], > [AT_SKIP_IF([! grep -q "Datapath supports ct_clear action" > ovs-vswitchd.log])]) > + > +# GEN_ICMP_DATA([start], [len]) > +# > +# Generate space-separated ICMP data that is acceptable to tests/sendpkt.py. > +m4_define([GEN_ICMP_DATA], > +[[ > + ICMP_DATA="" > + for (( n=0; n<$2; n++ )); do > + ICMP_DATA="${ICMP_DATA} $(printf %x $((($1+n) % 256)))" > + done > + echo "$ICMP_DATA" > +]] > +) > diff --git a/tests/system-traffic.at b/tests/system-traffic.at > index 519b234bb16b..37421ed1e78a 100644 > --- a/tests/system-traffic.at > +++ b/tests/system-traffic.at > @@ -339,6 +339,73 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w > 2 10.1.1.100 | FORMAT_PI > OVS_TRAFFIC_VSWITCHD_STOP > AT_CLEANUP > > +AT_SETUP([datapath - ping over gre tunnel by simulated packets]) > +OVS_CHECK_GRE() > + > +OVS_TRAFFIC_VSWITCHD_START() > +AT_CHECK([ovs-vsctl -- set bridge br0 > other-config:hwaddr=\"f2:ff:00:00:00:01\"]) > +ADD_BR([br-underlay], [set bridge br-underlay > other-config:hwaddr=\"f2:ff:00:00:00:02\"]) > + > +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) > +AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"]) > + > +ADD_NAMESPACES(at_ns0) > + > +dnl Set up underlay link from host into the namespace using veth pair. > +ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24", f2:ff:00:00:00:03) > +AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"]) > +AT_CHECK([ip link set dev br-underlay up]) > + > +dnl Set up tunnel endpoints on OVS outside the namespace. > +ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24]) > + > +ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & maybe you can add a filter here to reduce the packets counts in p0.pcap below you only egrep ip packet, or gre packet, so you can just "tcpdump -w p0.pcap proto GRE" > + > +dnl First, check the underlay. > +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | > FORMAT_PING], [0], [dnl > +3 packets transmitted, 3 received, 0% packet loss, time 0ms > +]) > + > +dnl Okay, now we don't actually add the port as below, instead, we > +dnl emulate it. Suppose its mac address is f2:ff:00:00:00:04. > +dnl ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], > [10.1.1.1/24]) > + > +dnl Okay, now send out an arp request from 10.1.1.1 for 10.1.1.100 in gre. > +NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 > ff 00 00 00 03 08 00 45 00 00 42 ec 2c 40 00 40 2f f3 bc ac 1f 01 01 ac 1f 01 > 64 00 00 65 58 ff ff ff ff ff ff f2 ff 00 00 00 04 08 06 00 01 08 00 06 04 00 > 01 f2 ff 00 00 00 04 0a 01 01 01 00 00 00 00 00 00 0a 01 01 64 > /dev/null]) > + > +sleep 1 Is it possible to use OVS_WAIT_UNTIL macro? > +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > 172.31.1.1: > GREv0, length 46: ARP, Reply 10.1.1.100 is-at f2:ff:00:00:00:01 .* length 28" > 2>&1 1>/dev/null]) > + > +dnl Oaky, now check the overlay by sending out raw icmp packets of > +dnl different sizes in gre protocol. > + > +dnl First, send the packet that emulates > +dnl `ip netns exec at_ns0 ping 10.1.1.100` > +NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 > ff 00 00 00 03 08 00 45 00 00 7a ec 8e 40 00 40 2f f3 22 ac 1f 01 01 ac 1f 01 > 64 00 00 65 58 f2 ff 00 00 00 01 f2 ff 00 00 00 04 08 00 45 00 00 54 54 8f 40 > 00 40 01 cf b3 0a 01 01 01 0a 01 01 64 08 00 e6 e8 29 27 00 03 e1 a3 43 5b 00 > 00 00 00 ff 1a 05 00 00 00 00 00 $(GEN_ICMP_DATA(16, 40)) > /dev/null]) > + > +sleep 1 > +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > 172.31.1.1: > GREv0, length 102: IP 10.1.1.100 > 10.1.1.1: ICMP echo reply, .* length 64$" > 2>&1 1>/dev/null]) > + > +dnl Second, send the packet that emulates > +dnl `ip netns exec at_ns0 ping -s 1600 10.1.1.100` > +NS_CHECK_EXEC([at_ns0], [$PYTHON $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 > ff 00 00 00 03 08 00 45 00 05 ca 9a 7b 40 00 40 2f 3f e6 ac
Re: [ovs-dev] [ovs-dev, v2] rhel: support kmod-openvswitch build against multiple kernels, rhel6
Bleep bloop. Greetings Martin Xu, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: ERROR: Too many signoffs; are you missing Co-authored-by lines? WARNING: Line is 116 characters long (recommended limit is 79) #428 FILE: rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh:21: IFS=. read installed_major installed_minor installed_micro installed_arch installed_build <<<"${current_kernel##*-}" WARNING: Line is 169 characters long (recommended limit is 79) #429 FILE: rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh:22: # echo installed_major=$installed_major installed_minor=$installed_minor installed_micro=$installed_micro installed_arch=$installed_arch installed_build=$installed_build Lines checked: 482, Warnings: 2, Errors: 1 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 05/14] datapath-windows: Cleanup Gre.c
On 07/09/2018 06:40 AM, Alin Gabriel Serdean wrote: Do not assign an initial value to ` status`, it will be assigned later on. Signed-off-by: Alin Gabriel Serdean --- datapath-windows/ovsext/Gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Gre.c b/datapath-windows/ovsext/Gre.c index afdd5abe3..c95d089e4 100644 --- a/datapath-windows/ovsext/Gre.c +++ b/datapath-windows/ovsext/Gre.c @@ -318,7 +318,7 @@ OvsDecapGre(POVS_SWITCH_CONTEXT switchContext, UINT32 headRoom = 0; UINT32 maxGreLen; PUINT8 bufferStart; -NDIS_STATUS status = NDIS_STATUS_SUCCESS; +NDIS_STATUS status; PCHAR tempBuf = NULL; OVS_PACKET_HDR_INFO layers; Do you mind merging the patches that make a common change as this into a single patch? I don't see a benefit to keep these separate. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 03/14] datapath-windows: Cleanup Conntrack.c
On 07/09/2018 06:40 AM, Alin Gabriel Serdean wrote: Do not assign an initial value for the variable `entry`, it will be reassigned later on. Signed-off-by: Alin Gabriel Serdean --- datapath-windows/ovsext/Conntrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c index dd1660218..0fa35fed7 100644 --- a/datapath-windows/ovsext/Conntrack.c +++ b/datapath-windows/ovsext/Conntrack.c @@ -841,7 +841,7 @@ OvsCtExecute_(OvsForwardingContext *fwdCtx, NDIS_STATUS status = NDIS_STATUS_SUCCESS; BOOLEAN triggerUpdateEvent = FALSE; BOOLEAN entryCreated = FALSE; -POVS_CT_ENTRY entry = NULL; +POVS_CT_ENTRY entry; PNET_BUFFER_LIST curNbl = fwdCtx->curNbl; OvsConntrackKeyLookupCtx ctx = { 0 }; LOCK_STATE_EX lockStateTable; I think its better to initialize the variable to NULL because if someone were to change the way 'entry' is currently getting initialized your assumption would not hold true. What do you think about leaving this as is? Is this being flagged by cppcheck? ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 02/14] datapath-windows: Cleanup BufferMgmt.c
On 07/09/2018 06:40 AM, Alin Gabriel Serdean wrote: Assign variables directly instead of reassigning them after. Signed-off-by: Alin Gabriel Serdean --- datapath-windows/ovsext/BufferMgmt.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c index 448cd7652..0f1c705d2 100644 --- a/datapath-windows/ovsext/BufferMgmt.c +++ b/datapath-windows/ovsext/BufferMgmt.c @@ -1163,12 +1163,9 @@ FixFragmentHeader(PNET_BUFFER nb, UINT16 fragmentSize, BOOLEAN lastPacket, UINT16 offset) { EthHdr *dstEth = NULL; -PMDL mdl = NULL; -PUINT8 bufferStart = NULL; +PMDL mdl = NET_BUFFER_FIRST_MDL(nb); +PUINT8 bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl); -mdl = NET_BUFFER_FIRST_MDL(nb); - -bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl); if (!bufferStart) { return NDIS_STATUS_RESOURCES; } @@ -1221,12 +1218,9 @@ FixSegmentHeader(PNET_BUFFER nb, UINT16 segmentSize, UINT32 seqNumber, { EthHdr *dstEth = NULL; TCPHdr *dstTCP = NULL; -PMDL mdl = NULL; -PUINT8 bufferStart = NULL; - -mdl = NET_BUFFER_FIRST_MDL(nb); +PMDL mdl = NET_BUFFER_FIRST_MDL(nb); +PUINT8 bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl); -bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl); if (!bufferStart) { return NDIS_STATUS_RESOURCES; } Acked-by: Shashank Ram ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 01/14] datapath-windows: Cleanup Actions.c
On 07/09/2018 06:40 AM, Alin Gabriel Serdean wrote: Assign variables directly instead of reassigning them after. Also purge unused variable `PNL_ATTR queueAttr`. Signed-off-by: Alin Gabriel Serdean --- datapath-windows/ovsext/Actions.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index 6922f0593..860d0abfa 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -152,11 +152,10 @@ OvsInitForwardingCtx(OvsForwardingContext *ovsFwdCtx, static __inline VOID OvsDoFragmentNbl(OvsForwardingContext *ovsFwdCtx, UINT16 mru) { -PNET_BUFFER_LIST fragNbl = NULL; -fragNbl = OvsFragmentNBL(ovsFwdCtx->switchContext, - ovsFwdCtx->curNbl, - &(ovsFwdCtx->layers), - mru, 0, TRUE); +PNET_BUFFER_LIST fragNbl = OvsFragmentNBL(ovsFwdCtx->switchContext, + ovsFwdCtx->curNbl, + &(ovsFwdCtx->layers), + mru, 0, TRUE); if (fragNbl != NULL) { OvsCompleteNBL(ovsFwdCtx->switchContext, ovsFwdCtx->curNbl, TRUE); @@ -688,11 +687,11 @@ OvsTunnelPortTx(OvsForwardingContext *ovsFwdCtx) OvsCompleteNBLForwardingCtx(ovsFwdCtx, L"Complete after cloning NBL for encapsulation"); -status = OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, - newNbl, srcVportNo, 0, - NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), - ovsFwdCtx->completionList, - >layers, FALSE); +OvsInitForwardingCtx(ovsFwdCtx, ovsFwdCtx->switchContext, + newNbl, srcVportNo, 0, + NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(newNbl), + ovsFwdCtx->completionList, + >layers, FALSE); ovsFwdCtx->curNbl = newNbl; /* Update the forwarding detail for the new NBL */ ovsFwdCtx->fwdDetail->SourcePortId = srcPortId; @@ -1815,7 +1814,6 @@ OvsOutputUserspaceAction(OvsForwardingContext *ovsFwdCtx, { NTSTATUS status = NDIS_STATUS_SUCCESS; PNL_ATTR userdataAttr; -PNL_ATTR queueAttr; POVS_PACKET_QUEUE_ELEM elem; POVS_PACKET_HDR_INFO layers = >layers; BOOLEAN isRecv = FALSE; @@ -1830,7 +1828,6 @@ OvsOutputUserspaceAction(OvsForwardingContext *ovsFwdCtx, } } -queueAttr = NlAttrFindNested(attr, OVS_USERSPACE_ATTR_PID); userdataAttr = NlAttrFindNested(attr, OVS_USERSPACE_ATTR_USERDATA); elem = OvsCreateQueueNlPacket(NlAttrData(userdataAttr), @@ -2361,13 +2358,12 @@ OvsDoRecirc(POVS_SWITCH_CONTEXT switchContext, OvsDeferredActionsLevelDec(); } else { -POVS_VPORT_ENTRY vport = NULL; +POVS_VPORT_ENTRY vport = OvsFindVportByPortNo(switchContext, srcPortNo); LIST_ENTRY missedPackets; UINT32 num = 0; Nit: Might be good to define uninitialized variables first, then the initialized ones. ovsFwdCtx.switchContext->datapath.misses++; InitializeListHead(); -vport = OvsFindVportByPortNo(switchContext, srcPortNo); if (vport == NULL || vport->ovsState != OVS_STATE_CONNECTED) { OvsCompleteNBLForwardingCtx(, L"OVS-Dropped due to port removal"); Acked-by: Shashank Ram ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v2] rhel: support kmod-openvswitch build against multiple kernels, rhel6
This patch only affects rhel6 spec file. RHEL 7.4 introduced backward incompatible changes in the kernel. As a result, prebuilt PRM packages against kernels newer than 693.17.1 will cannot be used on systems with older kernels, vice versa. This patch allows multiple kernel version numbers delimited by whitespace to be passed as variable "kversion". kmod-openvswitch RPM packages the kernel module .ko files from all specified kernel versions. This patch also includes a script to update the weak-update symlinks if the system kernel version is upgraded or downgraded after kmod-openvswitch is installed. Previouly the kernel_module_package macro is used to generate spec file template to build kmod-openvswitch RPM. This macro is now removed. Everything is built in the main package. To maintain consistent naming, the rhel6 kmod spec file is renamed to kmod-openvswitch-rhel6.spec to match the built package name kmod-openvswitch. This patch also removes the openvswitch-kmod package. Signed-off-by: Martin Xu Signed-off-by: Greg Rose CC: Ben Pfaff CC: Flavio Leitner CC: Aaron Conole --- Documentation/intro/install/rhel.rst | 7 +- poc/playbook-centos-builder.yml| 8 +- rhel/.gitignore| 1 + rhel/automake.mk | 8 +- rhel/kmod-openvswitch-rhel6.spec.in| 120 + rhel/openvswitch-kmod-rhel6.spec.in| 103 -- rhel/openvswitch-kmod.files| 3 - ...sr_share_openvswitch_scripts_ovs-kmod-manage.sh | 71 8 files changed, 203 insertions(+), 118 deletions(-) create mode 100644 rhel/kmod-openvswitch-rhel6.spec.in delete mode 100644 rhel/openvswitch-kmod-rhel6.spec.in delete mode 100644 rhel/openvswitch-kmod.files create mode 100644 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh diff --git a/Documentation/intro/install/rhel.rst b/Documentation/intro/install/rhel.rst index f8b26069f..6f062e894 100644 --- a/Documentation/intro/install/rhel.rst +++ b/Documentation/intro/install/rhel.rst @@ -197,17 +197,16 @@ the unit tests, run:: Kernel Module ~ -On RHEL 6, to build the Open vSwitch kernel module, copy -rhel/openvswitch-kmod.files into the RPM sources directory and run:: +On RHEL 6, to build the Open vSwitch kernel module run:: -$ rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec +$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec You might have to specify a kernel version and/or variants, e.g.: $ rpmbuild -bb \ -D "kversion 2.6.32-131.6.1.el6.x86_64" \ -D "kflavors default debug kdump" \ -rhel/openvswitch-kmod-rhel6.spec +rhel/kmod-openvswitch-rhel6.spec This produces an "kmod-openvswitch" RPM for each kernel variant, in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and diff --git a/poc/playbook-centos-builder.yml b/poc/playbook-centos-builder.yml index 71f104010..e902db75d 100644 --- a/poc/playbook-centos-builder.yml +++ b/poc/playbook-centos-builder.yml @@ -41,13 +41,13 @@ chdir: /git/ovs/rhel with_items: - openvswitch.spec - - openvswitch-kmod-rhel6.spec + - kmod-openvswitch-rhel6.spec - name: Install build dependencies specified from spec files shell: echo "y" | yum-builddep /tmp/{{item}} with_items: - openvswitch.spec - - openvswitch-kmod-rhel6.spec + - kmod-openvswitch-rhel6.spec - name: Create rpm dev tree command: rpmdev-setuptree @@ -81,7 +81,7 @@ line: "Release: {{ ansible_local.builder.release }}" with_items: - openvswitch.spec - - openvswitch-kmod-rhel6.spec + - kmod-openvswitch-rhel6.spec - name: Build Open vSwitch user space rpms command: rpmbuild -bb --without check rhel/openvswitch.spec @@ -89,7 +89,7 @@ chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" - name: Build Open vSwitch kmod rpms (only for currently loaded kernel) -command: rpmbuild -bb --without check rhel/openvswitch-kmod-rhel6.spec +command: rpmbuild -bb --without check rhel/kmod-openvswitch-rhel6.spec args: chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" diff --git a/rhel/.gitignore b/rhel/.gitignore index e584a1ed0..9b0ce1d38 100644 --- a/rhel/.gitignore +++ b/rhel/.gitignore @@ -1,6 +1,7 @@ openvswitch-dkms.spec openvswitch-kmod-rhel5.spec openvswitch-kmod-rhel6.spec +kmod-openvswitch-rhel6.spec openvswitch-kmod-fedora.spec openvswitch.spec openvswitch-fedora.spec diff --git a/rhel/automake.mk b/rhel/automake.mk index 137ff4a39..7b6c78fd7 100644 --- a/rhel/automake.mk +++ b/rhel/automake.mk @@ -15,9 +15,8 @@ EXTRA_DIST += \ rhel/etc_sysconfig_network-scripts_ifup-ovs \ rhel/openvswitch-dkms.spec \ rhel/openvswitch-dkms.spec.in \ - rhel/openvswitch-kmod-rhel6.spec \ - rhel/openvswitch-kmod-rhel6.spec.in \ - rhel/openvswitch-kmod.files
Re: [ovs-dev] [PATCH] tests: Add gre test that doesn't requiring Linux gre module
Hi Darrell, Thanks for the test. It shouldn't be that slow. For the same 'nsh -forward' test, it is pretty fast on my test machine. ## -- ## ## openvswitch 2.9.90 test suite. ## ## -- ## 111: nsh - forward ok ## - ## ## Test results. ## ## - ## 1 test was successful. make[1]: Leaving directory '/home/yfs/disk2/ovs' real0m14.501s user0m7.121s sys 0m1.873s What testing environment are you using? Best, Yifeng On Tue, Jul 10, 2018 at 7:08 PM, Darrell Ball wrote: > Thanks for the patch Yifeng > > I gave the patch a spin. > > Few datapoints: > > 1/ The new test fails for both userspace and kernel; at different points > in the test, lines 377 and 395 > respectively; I later tried increasing the sleep time to 5 seconds, > but it did not seem to help. > > 2/ The test runs pretty slow for an arp/ICMP test. > It takes about 35 seconds for the test to fail at line 377 and 140 > seconds to fail at line 395. > > > ## openvswitch 2.9.90 test suite. ## > ## -- ## > 12: datapath - ping over gre tunnel by simulated packets FAILED ( > system-traffic.at:395) > > ## - ## > ## Test results. ## > ## - ## > > ERROR: 1 test was run, > 1 failed unexpectedly. > ## -- ## > ## system-kmod-testsuite.log was created. ## > ## -- ## > > Please send `tests/system-kmod-testsuite.log' and all information you > think might help: > >To: >Subject: [openvswitch 2.9.90] system-kmod-testsuite: 12 failed > > You may investigate any problem if you feel able to do so, in which > case the test suite provides a good starting point. Its output may > be found below `tests/system-kmod-testsuite.dir'. > > make[1]: *** [check-kernel] Error 1 > make[1]: Leaving directory `/home/dball/openvswitch/ovs/_gcc' > make: *** [check-kmod] Error 2 > make: Leaving directory `/home/dball/openvswitch/ovs/_gcc' > > real 2m17.951s > user 0m7.528s > sys 0m0.944s > > > In the same environment, test 1 takes about 5 seconds to complete > > ## -- ## > ## openvswitch 2.9.90 test suite. ## > ## -- ## > 1: datapath - ping between two ports ok > > ## - ## > ## Test results. ## > ## - ## > > 1 test was successful. > make: Leaving directory `/home/dball/openvswitch/ovs/_gcc' > > real 0m4.937s > user 0m1.440s > sys 0m0.304s > > > 3/ I noticed the 4 other sendpkt tests, which are simple crafted packet > injection tests, also run slow - 1.5 to 4 minutes per test > for a successful run. > > ## -- ## > ## openvswitch 2.9.90 test suite. ## > ## -- ## > 111: nsh - forward ok > > ## - ## > ## Test results. ## > ## - ## > > 1 test was successful. > make: Leaving directory `/home/dball/openvswitch/ovs/_gcc' > > real 4m10.855s > user 0m1.664s > sys 0m0.304s > > > Darrell > > On Tue, Jul 10, 2018 at 12:24 PM, Yifeng Sun > wrote: > >> Currently check-kmod's gre test is broken on certain kernel >> versions where ovs's gre module conflits with kernel's gre >> module. But at the same time, present gre test depends on >> Linux gre module to setup gre port. >> >> This patch repairs the gre test by completely removing the >> dependancy of kernel's gre module and emulating a virtual >> Linux gre port that sends out arp and icmp packets. >> >> Suggested-by: William Tu >> Signed-off-by: Yifeng Sun >> --- >> tests/system-common-macros.at | 13 + >> tests/system-traffic.at | 67 ++ >> + >> 2 files changed, 80 insertions(+) >> >> diff --git a/tests/system-common-macros.at b/tests/system-common-macros.a >> t >> index 64bf5ec63ab4..7b841250c383 100644 >> --- a/tests/system-common-macros.at >> +++ b/tests/system-common-macros.at >> @@ -329,3 +329,16 @@ m4_define([OVS_CHECK_IPROUTE_ENCAP], >> # OVS_CHECK_CT_CLEAR() >> m4_define([OVS_CHECK_CT_CLEAR], >> [AT_SKIP_IF([! grep -q "Datapath supports ct_clear action" >> ovs-vswitchd.log])]) >> + >> +# GEN_ICMP_DATA([start], [len]) >> +# >> +# Generate space-separated ICMP data that is acceptable to >> tests/sendpkt.py. >> +m4_define([GEN_ICMP_DATA], >> +[[ >> + ICMP_DATA="" >> + for (( n=0; n<$2; n++ )); do >> + ICMP_DATA="${ICMP_DATA} $(printf %x $((($1+n) % 256)))" >> + done >> + echo "$ICMP_DATA" >> +]] >> +) >> diff --git a/tests/system-traffic.at b/tests/system-traffic.at >> index 519b234bb16b..37421ed1e78a 100644 >> --- a/tests/system-traffic.at >> +++ b/tests/system-traffic.at >> @@ -339,6 +339,73 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 >> -w 2 10.1.1.100 | FORMAT_PI >> OVS_TRAFFIC_VSWITCHD_STOP >> AT_CLEANUP >> >> +AT_SETUP([datapath - ping over gre
Re: [ovs-dev] [PATCH] configure: Disable -Wnull-pointer-arithmetic Clang warning.
Thanks. Reviewed-by: Yifeng Sun On Mon, Jul 9, 2018 at 2:37 PM, Ben Pfaff wrote: > OVS trips over this warning all over the place, so it's not worth leaving > on. > > Signed-off-by: Ben Pfaff > --- > configure.ac | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/configure.ac b/configure.ac > index af570b32012d..c89c607c7124 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -171,6 +171,7 @@ OVS_ENABLE_OPTION([-Wshift-negative-value]) > OVS_ENABLE_OPTION([-Wduplicated-cond]) > OVS_ENABLE_OPTION([-Qunused-arguments]) > OVS_ENABLE_OPTION([-Wshadow]) > +OVS_ENABLE_OPTION([-Wno-null-pointer-arithmetic]) > OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED]) > OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], > [HAVE_WNO_UNUSED_PARAMETER]) > OVS_ENABLE_WERROR > -- > 2.16.1 > > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 2/2] ovs-ofctl: New helper command "parse-packet".
Thanks. Tested-by: Yifeng Sun Reviewed-by: Yifeng Sun On Mon, Jul 9, 2018 at 1:04 PM, Ben Pfaff wrote: > This was useful for testing the previous patch. > > Signed-off-by: Ben Pfaff > --- > utilities/ovs-ofctl.c | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c > index 0cd0fcb63e4b..ee08178d8fff 100644 > --- a/utilities/ovs-ofctl.c > +++ b/utilities/ovs-ofctl.c > @@ -4802,6 +4802,24 @@ ofctl_compose_packet(struct ovs_cmdl_context *ctx) > } > } > > +/* "parse-packet" reads an Ethernet packet from stdin and prints it out > its > + * extracted flow fields. */ > +static void > +ofctl_parse_packet(struct ovs_cmdl_context *ctx OVS_UNUSED) > +{ > +char packet[65535]; > +ssize_t size = read(STDIN_FILENO, packet, sizeof packet); > +if (size < 0) { > +ovs_fatal(errno, "failed to read packet from stdin"); > +} > + > +/* Make a copy of the packet in allocated memory to better allow > Valgrind > + * and Address Sanitizer to catch out-of-range access. */ > +void *packet_copy = xmemdup(packet, size); > +ofp_print_packet(stdout, packet_copy, size, 0); > +free(packet_copy); > +} > + > static const struct ovs_cmdl_command all_commands[] = { > { "show", "switch", >1, 1, ofctl_show, OVS_RO }, > @@ -4936,6 +4954,7 @@ static const struct ovs_cmdl_command all_commands[] > = { > { "encode-hello", NULL, 1, 1, ofctl_encode_hello, OVS_RW }, > { "parse-key-value", NULL, 1, INT_MAX, ofctl_parse_key_value, OVS_RW > }, > { "compose-packet", NULL, 1, 2, ofctl_compose_packet, OVS_RO }, > +{ "parse-packet", NULL, 0, 0, ofctl_parse_packet, OVS_RO }, > > { NULL, NULL, 0, 0, NULL, OVS_RO }, > }; > -- > 2.16.1 > > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 1/2] ovs python: ovs.stream.open_block() returns success even if the remote is unreachable
On Wed, Jul 11, 2018 at 10:26 PM Ben Pfaff wrote: > On Wed, Jul 11, 2018 at 12:37:28PM +0530, Numan Siddique wrote: > > On Wed, Jul 11, 2018 at 2:08 AM Ben Pfaff wrote: > > > > > On Wed, Jul 11, 2018 at 12:56:39AM +0530, nusid...@redhat.com wrote: > > > > From: Numan Siddique > > > > > > > > The python function ovs.socket_util.check_connection_completion() > uses > > > select() > > > > (provided by python) to monitor the socket file descriptor. The > select() > > > > returns 1 when the file descriptor becomes ready. For error cases > like - > > > > 111 (Connection refused) and 113 (No route to host) (POLLERR), > > > ovs.poller._SelectSelect.poll() > > > > expects the exceptfds list to be set by select(). But that is not the > > > case. > > > > As per the select() man page, writefds list will be set for POLLERR. > > > > Please see "Correspondence between select() and poll() notifications" > > > section of select(2) > > > > man page. > > > > > > > > Because of this behavior, > ovs.socket_util.check_connection_completion() > > > returns success > > > > even if the remote is unreachable or not listening on the port. > > > > > > > > This patch fixes this issue by adding a wrapper function - > > > check_connection_completion_status() > > > > which calls sock.connect_ex() to get the status of the connection if > > > > ovs.socket_util.check_connection_completion() returns success. > > > > > > > > The test cases added fails without the fix in this patch. > > > > > > > > Signed-off-by: Numan Siddique > > > > > > Can we just code check_connection_completion() like we do in C, by > > > directly using select() on Windows and poll() everywhere else? The > > > approach in this patch seems a little indirect to me. > > > > > > > > Thanks for the review. As per the comments here - > > https://github.com/openvswitch/ovs/blob/master/python/ovs/poller.py#L51 > > * > > # eventlet/gevent doesn't support select.poll. If select.poll is used, > > # python interpreter is blocked as a whole instead of switching from the > > # current thread that is about to block to other runnable thread. > > # So emulate select.poll by select.select because using python means that > > # performance isn't so important. > > *** > > > > we cannot use poll() in python. I tried with this patch to test it out - > > https://paste.fedoraproject.org/paste/YUhgVte-BOjgid-ojmHZJw > > All the ovs python idl tests pass. But it doesn't work with openstack > > networking-ovn. The whole neutron-server process just blocks. > > > > I don't see any other way for python. Once select() returns we have to > use > > some mechanism to get the error code. > > Does calling sock.connect_ex() bother you ? > > I don't mean to change what poller.py does. I mean to implement > ovs.socket_util.check_connection_completion in terms of select.poll and > select.select directly. The comment in python/ovs/poller.py should not > be relevant because the use of select.poll in > check_connection_completion would never block (it would use a timeout of > 0). > > Hi Ben, For python applications which use eventlet, select.poll/epoll is not available. 'select ' python module is monkey patched and poll and few other functions are deleted. https://github.com/eventlet/eventlet/blob/master/NEWS#L155 https://github.com/eventlet/eventlet/blob/master/eventlet/green/select.py#L9 https://github.com/eventlet/eventlet/blob/master/eventlet/patcher.py#L305 Thanks Numan Thanks, > > Ben. > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 15 of 15] tests: Add test for oneline-formatted output for ovn-nbctl.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 14 of 15] tests: Add test for sync command to ovn-nbctl test suite.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 13 of 15] tests: Add test for ovn-nbctl dry run mode.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 12 of 15] ovn-nbctl: Initial support for daemon mode.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: WARNING: Line is 82 characters long (recommended limit is 79) #80 FILE: ovn/utilities/ovn-nbctl.8.xml:1023: http://www.w3.org/2003/XInclude"/> Lines checked: 409, Warnings: 1, Errors: 0 build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list
Re: [ovs-dev] [ovs-dev, 11 of 15] ovn-nbctl: Extract helper for printing oneline output.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 10 of 15] ovn-nbctl: Introduce a poll_timer based wait timeout.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 09 of 15] ovn-nbctl: Propagate errors from prerequisites runner.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 08 of 15] ovn-nbctl: Propagate errors from the main loop.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 07 of 15] ovn-nbctl: Propagate the error from do_nbctl().
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 06 of 15] ovn-nbctl: Signal need to try again via an output param.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 05 of 15] ovn-nbctl: Pull up releasing IDL from do_nbctl().
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 04 of 15] ovn-nbctl: Pull up destroying commands from do_nbctl().
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev,03 of 15] ovn-nbctl: Extract the main loop.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 02 of 15] ovsdb-idl: Allow monitoring columns that are already monitored.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, 01 of 15] table: Allow default style to be used in an assignment.
Bleep bloop. Greetings Jakub Sitnicki, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: depbase=`echo utilities/ovs-dpctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-dpctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-dpctl.o utilities/ovs-dpctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-ofctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-ofctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-ofctl.o utilities/ovs-ofctl.c &&\ mv -f $depbase.Tpo $depbase.Po /bin/sh ./libtool --tag=CC --mode=link gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/libofproto.la lib/libopenvswitch.la -lpthread -lrt -lm -lunbound libtool: link: gcc -std=gnu99 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -o utilities/ovs-ofctl utilities/ovs-ofctl.o ofproto/.libs/libofproto.a /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/lib/.libs/libsflow.a lib/.libs/libopenvswitch.a -lssl -lcrypto -lcap-ng -lpthread -lrt -lm -lunbound depbase=`echo utilities/ovs-vsctl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ gcc -std=gnu99 -DHAVE_CONFIG_H -I.-I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow-Werror -MT utilities/ovs-vsctl.o -MD -MP -MF $depbase.Tpo -c -o utilities/ovs-vsctl.o utilities/ovs-vsctl.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from utilities/ovs-vsctl.c:49:0: ./lib/table.h:86:13: error: initializer element is not constant (struct table_style) { TF_LIST, CF_STRING, true, JSSF_SORT, 0 } ^ utilities/ovs-vsctl.c:85:41: note: in expansion of macro ‘TABLE_STYLE_DEFAULT’ static struct table_style table_style = TABLE_STYLE_DEFAULT; ^ make[2]: *** [utilities/ovs-vsctl.o] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] bot suggestion
Ben Pfaff writes: > The bot couldn't apply this patch presumably because it tried to apply > it against master. Maybe the bot should notice version numbers in [] in > subject lines and try against that branch. Good call. I'm at a conference at the moment, but will try to get that integrated this week. I expect there will be branch-2.10 and earlier. > Thanks, > > Ben. > > On Wed, Jul 11, 2018 at 11:59:24AM -0400, 0-day Robot wrote: >> Bleep bloop. Greetings Darrell Ball, I am a robot and I have tried >> out your patch. >> Thanks for your contribution. >> >> I encountered some error that I wasn't expecting. See the details below. >> >> >> git-am: >> Failed to merge in the changes. >> Patch failed at 0001 conntrack: Fix conn_update_state_alg use after free. >> The copy of the patch that failed is found in: >> >> /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch >> When you have resolved this problem, run "git am --resolved". >> If you prefer to skip this patch, run "git am --skip" instead. >> To restore the original branch and stop patching, run "git am --abort". >> >> >> Please check this out. If you feel there has been an error, please >> email acon...@bytheb.org >> >> Thanks, >> 0-day Robot >> ___ >> dev mailing list >> d...@openvswitch.org >> https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] rhel: support kmod-openvswitch build against multiple kernels, rhel6
Adding Ben. On Tue, Jul 10, 2018 at 3:54 PM Gregory Rose wrote: > On 7/10/2018 3:42 PM, Martin Xu wrote: > > This patch only affects rhel6 spec file. > > > > RHEL 7.4 introduced backward incompatible changes in the kernel. As > > a result, prebuilt PRM packages against kernels newer than 693.17.1 > > will cannot be used on systems with older kernels, vice versa. > > > > This patch allows multiple kernel version numbers delimited by > > whitespace to be passed as variable "kversion". kmod-openvswitch RPM > > packages the kernel module .ko files from all specified kernel > > versions. > > > > This patch also includes a script to update the weak-update symlinks > > if the system kernel version is upgraded or downgraded after > > kmod-openvswitch is installed. > > > > Previouly the kernel_module_package macro is used to generate spec file > > template to build kmod-openvswitch RPM. This macro is now removed. > > Everything is built in the main package. To maintain consistent naming, > > the rhel6 kmod spec file is renamed to kmod-openvswitch-rhel6.spec to > > match the built package name kmod-openvswitch. > > > > This patch also removes the openvswitch-kmod package. > > Oops, no signed off by line. > > I'm adding Aaron and Flavio so the Red Hat guys can give it a look. You > can wait for their review > comments and then spin up a Rev 2 with the fixed signed off by line. > > Thanks for the patch! > > - Greg > > > > > --- > > Documentation/intro/install/rhel.rst | 7 +- > > poc/playbook-centos-builder.yml| 8 +- > > rhel/.gitignore| 1 + > > rhel/automake.mk | 8 +- > > rhel/kmod-openvswitch-rhel6.spec.in| 120 > > + > > rhel/openvswitch-kmod-rhel6.spec.in| 103 > -- > > rhel/openvswitch-kmod.files| 3 - > > ...sr_share_openvswitch_scripts_ovs-kmod-manage.sh | 71 > > 8 files changed, 203 insertions(+), 118 deletions(-) > > create mode 100644 rhel/kmod-openvswitch-rhel6.spec.in > > delete mode 100644 rhel/openvswitch-kmod-rhel6.spec.in > > delete mode 100644 rhel/openvswitch-kmod.files > > create mode 100644 > rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh > > > > diff --git a/Documentation/intro/install/rhel.rst > > b/Documentation/intro/install/rhel.rst > > index f8b2606..6f062e8 100644 > > --- a/Documentation/intro/install/rhel.rst > > +++ b/Documentation/intro/install/rhel.rst > > @@ -197,17 +197,16 @@ the unit tests, run:: > > Kernel Module > > ~ > > > > -On RHEL 6, to build the Open vSwitch kernel module, copy > > -rhel/openvswitch-kmod.files into the RPM sources directory and run:: > > +On RHEL 6, to build the Open vSwitch kernel module run:: > > > > -$ rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec > > +$ rpmbuild -bb rhel/kmod-openvswitch-rhel6.spec > > > > You might have to specify a kernel version and/or variants, e.g.: > > > > $ rpmbuild -bb \ > > -D "kversion 2.6.32-131.6.1.el6.x86_64" \ > > -D "kflavors default debug kdump" \ > > -rhel/openvswitch-kmod-rhel6.spec > > +rhel/kmod-openvswitch-rhel6.spec > > > > This produces an "kmod-openvswitch" RPM for each kernel variant, in > this > > example: "kmod-openvswitch", "kmod-openvswitch-debug", and > > diff --git a/poc/playbook-centos-builder.yml > b/poc/playbook-centos-builder. > > yml > > index 71f1040..e902db7 100644 > > --- a/poc/playbook-centos-builder.yml > > +++ b/poc/playbook-centos-builder.yml > > @@ -41,13 +41,13 @@ > > chdir: /git/ovs/rhel > > with_items: > > - openvswitch.spec > > - - openvswitch-kmod-rhel6.spec > > + - kmod-openvswitch-rhel6.spec > > > > - name: Install build dependencies specified from spec files > > shell: echo "y" | yum-builddep /tmp/{{item}} > > with_items: > > - openvswitch.spec > > - - openvswitch-kmod-rhel6.spec > > + - kmod-openvswitch-rhel6.spec > > > > - name: Create rpm dev tree > > command: rpmdev-setuptree > > @@ -81,7 +81,7 @@ > > line: "Release: {{ ansible_local.builder.release }}" > > with_items: > > - openvswitch.spec > > - - openvswitch-kmod-rhel6.spec > > + - kmod-openvswitch-rhel6.spec > > > > - name: Build Open vSwitch user space rpms > > command: rpmbuild -bb --without check rhel/openvswitch.spec > > @@ -89,7 +89,7 @@ > > chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" > > > > - name: Build Open vSwitch kmod rpms (only for currently loaded > kernel) > > -command: rpmbuild -bb --without check > rhel/openvswitch-kmod-rhel6.spec > > +command: rpmbuild -bb --without check > rhel/kmod-openvswitch-rhel6.spec > > args: > > chdir: "{{SOURCE}}/openvswitch-{{version.stdout}}" > > > > diff --git a/rhel/.gitignore b/rhel/.gitignore > >
[ovs-dev] [PATCH 15/15] tests: Add test for oneline-formatted output for ovn-nbctl.
Signed-off-by: Jakub Sitnicki --- tests/ovn-nbctl.at | 21 + 1 file changed, 21 insertions(+) diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 89daf631a..60b4d0c9c 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -1403,3 +1403,24 @@ AT_CHECK([ovn-nbctl ls-list | uuidfilt], [0], [dnl OVN_NBCTL_TEST_STOP AT_CLEANUP + +dnl - + +AT_SETUP([ovn-nbctl - oneline output]) +OVN_NBCTL_TEST_START + +AT_CHECK([ovn-nbctl ls-add ls0 -- ls-add ls1]) + +# Expect one line for one command. +AT_CHECK([ovn-nbctl --oneline ls-list | uuidfilt], [0], [dnl +<0> (ls0)\n<1> (ls1) +]) + +# Expect lines for two commands. +AT_CHECK([ovn-nbctl --oneline ls-list -- ls-list | uuidfilt], [0], [dnl +<0> (ls0)\n<1> (ls1) +<0> (ls0)\n<1> (ls1) +]) + +OVN_NBCTL_TEST_STOP +AT_CLEANUP -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 14/15] tests: Add test for sync command to ovn-nbctl test suite.
Signed-off-by: Jakub Sitnicki --- tests/ovn.at | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tests/ovn.at b/tests/ovn.at index d1a8967dd..adb99db77 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -10541,3 +10541,22 @@ OVN_CHECK_PACKETS([hv2/vif2-tx.pcap], [vif2.expected]) OVN_CLEANUP([hv1], [hv2]) AT_CLEANUP + +AT_SETUP([ovn -- sync]) +ovn_start + +AT_CHECK([ovn-nbctl get NB_Global . nb_cfg], [0], [dnl +0 +]) + +AT_CHECK([ovn-nbctl --wait=sb sync]) +AT_CHECK([ovn-nbctl get NB_Global . sb_cfg], [0], [dnl +1 +]) + +AT_CHECK([ovn-nbctl --wait=hv sync]) +AT_CHECK([ovn-nbctl get NB_Global . hv_cfg], [0], [dnl +2 +]) + +AT_CLEANUP -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 13/15] tests: Add test for ovn-nbctl dry run mode.
Signed-off-by: Jakub Sitnicki --- tests/ovn-nbctl.at | 21 + 1 file changed, 21 insertions(+) diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 73a61a4be..89daf631a 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -1382,3 +1382,24 @@ inactivity_probe: 3 OVN_NBCTL_TEST_STOP AT_CLEANUP + +dnl - + +AT_SETUP([ovn-nbctl - dry run mode]) +OVN_NBCTL_TEST_START + +# Check that dry run has no permanent effect. +AT_CHECK([ovn-nbctl --dry-run ls-add ls0 -- ls-list | uuidfilt], [0], [dnl +<0> (ls0) +]) +AT_CHECK([ovn-nbctl ls-list | uuidfilt], [0], [dnl +]) + +# Check that dry-run mode is not sticky. +AT_CHECK([ovn-nbctl ls-add ls0]) +AT_CHECK([ovn-nbctl ls-list | uuidfilt], [0], [dnl +<0> (ls0) +]) + +OVN_NBCTL_TEST_STOP +AT_CLEANUP -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 12/15] ovn-nbctl: Initial support for daemon mode.
Make ovn-nbctl act as a unixctl server if we were asked to detach. This turns ovn-nbctl into a long-lived process that acts a proxy for interacting with NB DB. The main difference to regular mode of ovn-nbctl is that in the daemon mode, a local copy of database contents has to be obtained only once. Just two unixctl commands are supported 'run' and 'exit'. The former can be used to run any ovn-nbctl command or a batch of them as so: ovs-appctl -t ovn-nbctl run [OPTIONS] COMMAND [-- [OPTIONS] COMMAND] ... Running commands that have not yet been converted to not use ctl_fatal() will result in death of the daemon process. However, --monitor option can be used to keep the daemon running. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.8.xml | 40 ovn/utilities/ovn-nbctl.c | 213 -- 2 files changed, 227 insertions(+), 26 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml index abba4ecdb..2cd2fab30 100644 --- a/ovn/utilities/ovn-nbctl.8.xml +++ b/ovn/utilities/ovn-nbctl.8.xml @@ -913,6 +913,43 @@ +Daemon Mode + + + If ovn-nbctl is invoked with the --detach + option (see Daemon Options, below), it runs in the + background as a daemon and accepts commands from ovs-appctl + (or another JSON-RPC client) indefinitely. The currently supported + commands are described below. + + + + + + + + +run [options] command +[arg...] [-- [options] +command [arg...] ...] + + +Instructs the daemon process to run one or more ovn-nbctl +commands described above and reply with the results of running these +commands. Accepts the --no-wait, --wait, +--timeout, --dry-run, --oneline, +and the options described under Table Formatting Options +in addition to the the command-specific options. + + + exit + Causes ovn-nbctl to gracefully terminate. + + + + Daemon mode is considered experimental. + + Options @@ -982,6 +1019,9 @@ +Daemon Options +http://www.w3.org/2003/XInclude"/> + Logging options http://www.w3.org/2003/XInclude"/> diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 3dd24d193..fc42f817e 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -20,6 +20,7 @@ #include #include "command-line.h" +#include "daemon.h" #include "db-ctl-base.h" #include "dirs.h" #include "fatal-signal.h" @@ -38,6 +39,7 @@ #include "table.h" #include "timeval.h" #include "timer.h" +#include "unixctl.h" #include "util.h" #include "openvswitch/vlog.h" @@ -80,6 +82,13 @@ OVS_NO_RETURN static void nbctl_exit(int status); /* --leader-only, --no-leader-only: Only accept the leader in a cluster. */ static int leader_only = true; +/* --unixctl-path: Path to use for unixctl server, for "monitor" and "snoop" + commands. */ +static char *unixctl_path; + +static unixctl_cb_func server_cmd_exit; +static unixctl_cb_func server_cmd_run; + static void nbctl_cmd_init(void); OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[], struct shash *local_options); @@ -98,15 +107,13 @@ static char * OVS_WARN_UNUSED_RESULT main_loop(const char *args, size_t n_commands, struct ovsdb_idl *idl, const struct timer *); +static void server_loop(struct ovsdb_idl *idl); int main(int argc, char *argv[]) { struct ovsdb_idl *idl; -struct ctl_command *commands; struct shash local_options; -size_t n_commands; -char *error; set_program_name(argv[0]); fatal_ignore_sigpipe(); @@ -119,38 +126,55 @@ main(int argc, char *argv[]) char *args = process_escape_args(argv); shash_init(_options); parse_options(argc, argv, _options); -commands = ctl_parse_commands(argc - optind, argv + optind, _options, - _commands); -VLOG(ctl_might_write_to_db(commands, n_commands) ? VLL_INFO : VLL_DBG, - "Called as %s", args); - -if (timeout) { -time_alarm(timeout); -} +argc -= optind; +argv += optind; /* Initialize IDL. */ idl = the_idl = ovsdb_idl_create(db, _idl_class, true, false); ovsdb_idl_set_leader_only(idl, leader_only); -error = run_prerequisites(commands, n_commands, idl); -if (error) { -ctl_fatal("%s", error); -} -error = main_loop(args, commands, n_commands, idl, NULL); -if (error) { -ctl_fatal("%s", error); +if (get_detach()) { +if (argc != 0) { +ctl_fatal("non-option arguments not supported with --detach " + "(use --help for help)"); +} +server_loop(idl); +} else { +struct ctl_command
[ovs-dev] [PATCH 11/15] ovn-nbctl: Extract helper for printing oneline output.
This will allow us to direct oneline-formatted output to other sinks than stdout if needed. Preparatory work for daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 53 ++- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 7f83abc40..3dd24d193 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -4162,6 +4162,39 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands, return NULL; } +static void +oneline_format(struct ds *lines, struct ds *s) +{ +size_t j; + +ds_chomp(lines, '\n'); +for (j = 0; j < lines->length; j++) { +int ch = lines->string[j]; +switch (ch) { +case '\n': +ds_put_cstr(s, "\\n"); +break; + +case '\\': +ds_put_cstr(s, ""); +break; + +default: +ds_put_char(s, ch); +} +} +ds_put_char(s, '\n'); +} + +static void +oneline_print(struct ds *lines) +{ +struct ds s = DS_EMPTY_INITIALIZER; +oneline_format(lines, ); +fputs(ds_cstr(), stdout); +ds_destroy(); +} + static char * do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, struct ovsdb_idl *idl, const struct timer *wait_timeout, bool *retry) @@ -4297,25 +4330,7 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, if (c->table) { table_print(c->table, _style); } else if (oneline) { -size_t j; - -ds_chomp(ds, '\n'); -for (j = 0; j < ds->length; j++) { -int ch = ds->string[j]; -switch (ch) { -case '\n': -fputs("\\n", stdout); -break; - -case '\\': -fputs("", stdout); -break; - -default: -putchar(ch); -} -} -putchar('\n'); +oneline_print(ds); } else { fputs(ds_cstr(ds), stdout); } -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 10/15] ovn-nbctl: Introduce a poll_timer based wait timeout.
Extend the main loop and the command runner so that the caller can specify a timeout for poll_block(). This will allow us to break out of the main loop when waiting on IDL, like in the blocked '--wait=sb/hv sync' case. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 154e7799a..7f83abc40 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -37,6 +37,7 @@ #include "svec.h" #include "table.h" #include "timeval.h" +#include "timer.h" #include "util.h" #include "openvswitch/vlog.h" @@ -87,13 +88,16 @@ static char * OVS_WARN_UNUSED_RESULT run_prerequisites(struct ctl_command[], struct ovsdb_idl *); static char * OVS_WARN_UNUSED_RESULT do_nbctl(const char *args, struct ctl_command *, size_t n, - struct ovsdb_idl *, bool *retry); + struct ovsdb_idl *, + const struct timer *, + bool *retry); static const struct nbrec_dhcp_options *dhcp_options_get( struct ctl_context *ctx, const char *id, bool must_exist); static char * OVS_WARN_UNUSED_RESULT main_loop(const char *args, struct ctl_command *commands, size_t n_commands, - struct ovsdb_idl *idl); + struct ovsdb_idl *idl, + const struct timer *); int main(int argc, char *argv[]) @@ -132,7 +136,7 @@ main(int argc, char *argv[]) ctl_fatal("%s", error); } -error = main_loop(args, commands, n_commands, idl); +error = main_loop(args, commands, n_commands, idl, NULL); if (error) { ctl_fatal("%s", error); } @@ -153,7 +157,7 @@ main(int argc, char *argv[]) static char * main_loop(const char *args, struct ctl_command *commands, size_t n_commands, - struct ovsdb_idl *idl) + struct ovsdb_idl *idl, const struct timer *wait_timeout) { unsigned int seqno; @@ -177,7 +181,8 @@ main_loop(const char *args, struct ctl_command *commands, size_t n_commands, seqno = ovsdb_idl_get_seqno(idl); bool retry; -char *error = do_nbctl(args, commands, n_commands, idl, ); +char *error = do_nbctl(args, commands, n_commands, idl, + wait_timeout, ); if (error) { return error; } @@ -4159,7 +4164,7 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands, static char * do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, - struct ovsdb_idl *idl, bool *retry) + struct ovsdb_idl *idl, const struct timer *wait_timeout, bool *retry) { struct ovsdb_idl_txn *txn; enum ovsdb_idl_txn_status status; @@ -4286,8 +4291,6 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, OVS_NOT_REACHED(); } -ovsdb_symbol_table_destroy(symtab); - for (c = commands; c < [n_commands]; c++) { struct ds *ds = >output; @@ -4331,11 +4334,19 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, } } ovsdb_idl_wait(idl); +if (wait_timeout) { +timer_wait(wait_timeout); +} poll_block(); +if (wait_timeout && timer_expired(wait_timeout)) { +error = xstrdup("timeout expired"); +goto out_error; +} } done: ; } +ovsdb_symbol_table_destroy(symtab); ovsdb_idl_txn_destroy(txn); *retry = false; -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 08/15] ovn-nbctl: Propagate errors from the main loop.
Let the caller handle the errors instead of reporting it and terminating. Prepare for reusing the main loop in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 6e136e1d0..747aa63b6 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -89,8 +89,10 @@ static char * OVS_WARN_UNUSED_RESULT do_nbctl(const char *args, struct ovsdb_idl *, bool *retry); static const struct nbrec_dhcp_options *dhcp_options_get( struct ctl_context *ctx, const char *id, bool must_exist); -static void main_loop(const char *args, struct ctl_command *commands, - size_t n_commands, struct ovsdb_idl *idl); +static char * OVS_WARN_UNUSED_RESULT main_loop(const char *args, + struct ctl_command *commands, + size_t n_commands, + struct ovsdb_idl *idl); int main(int argc, char *argv[]) @@ -125,7 +127,10 @@ main(int argc, char *argv[]) ovsdb_idl_set_leader_only(idl, leader_only); run_prerequisites(commands, n_commands, idl); -main_loop(args, commands, n_commands, idl); +char *error = main_loop(args, commands, n_commands, idl); +if (error) { +ctl_fatal("%s", error); +} ovsdb_idl_destroy(idl); idl = the_idl = NULL; @@ -141,7 +146,7 @@ main(int argc, char *argv[]) exit(EXIT_SUCCESS); } -static void +static char * main_loop(const char *args, struct ctl_command *commands, size_t n_commands, struct ovsdb_idl *idl) { @@ -169,10 +174,10 @@ main_loop(const char *args, struct ctl_command *commands, size_t n_commands, bool retry; char *error = do_nbctl(args, commands, n_commands, idl, ); if (error) { -ctl_fatal("%s", error); +return error; } if (!retry) { -return; +return NULL; } } @@ -181,6 +186,8 @@ main_loop(const char *args, struct ctl_command *commands, size_t n_commands, poll_block(); } } + +return NULL; } static void -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 09/15] ovn-nbctl: Propagate errors from prerequisites runner.
Instead of terminating the process, return the error to the caller. This will allow us to reuse the prerequisites runner in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 747aa63b6..154e7799a 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -82,8 +82,9 @@ static int leader_only = true; static void nbctl_cmd_init(void); OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[], struct shash *local_options); -static void run_prerequisites(struct ctl_command[], size_t n_commands, - struct ovsdb_idl *); +static char * OVS_WARN_UNUSED_RESULT run_prerequisites(struct ctl_command[], + size_t n_commands, + struct ovsdb_idl *); static char * OVS_WARN_UNUSED_RESULT do_nbctl(const char *args, struct ctl_command *, size_t n, struct ovsdb_idl *, bool *retry); @@ -101,6 +102,7 @@ main(int argc, char *argv[]) struct ctl_command *commands; struct shash local_options; size_t n_commands; +char *error; set_program_name(argv[0]); fatal_ignore_sigpipe(); @@ -125,9 +127,12 @@ main(int argc, char *argv[]) /* Initialize IDL. */ idl = the_idl = ovsdb_idl_create(db, _idl_class, true, false); ovsdb_idl_set_leader_only(idl, leader_only); -run_prerequisites(commands, n_commands, idl); +error = run_prerequisites(commands, n_commands, idl); +if (error) { +ctl_fatal("%s", error); +} -char *error = main_loop(args, commands, n_commands, idl); +error = main_loop(args, commands, n_commands, idl); if (error) { ctl_fatal("%s", error); } @@ -4117,7 +4122,7 @@ static const struct ctl_table_class tables[NBREC_N_TABLES] = { [NBREC_TABLE_ACL].row_ids[0] = {_acl_col_name, NULL, NULL}, }; -static void +static char * run_prerequisites(struct ctl_command *commands, size_t n_commands, struct ovsdb_idl *idl) { @@ -4138,7 +4143,9 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands, ctl_context_init(, c, idl, NULL, NULL, NULL); (c->syntax->prerequisites)(); if (ctx.error) { -ctl_fatal("%s", ctx.error); +char *error = xstrdup(ctx.error); +ctl_context_done(, c); +return error; } ctl_context_done(, c); @@ -4146,6 +4153,8 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands, ovs_assert(!c->table); } } + +return NULL; } static char * -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 07/15] ovn-nbctl: Propagate the error from do_nbctl().
Instead of terminating the process, return the error to the caller. This will allow us to reuse the main loop in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 46 -- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 360b25a89..6e136e1d0 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -84,8 +84,9 @@ OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[], struct shash *local_options); static void run_prerequisites(struct ctl_command[], size_t n_commands, struct ovsdb_idl *); -static void do_nbctl(const char *args, struct ctl_command *, size_t n, - struct ovsdb_idl *, bool *retry); +static char * OVS_WARN_UNUSED_RESULT do_nbctl(const char *args, + struct ctl_command *, size_t n, + struct ovsdb_idl *, bool *retry); static const struct nbrec_dhcp_options *dhcp_options_get( struct ctl_context *ctx, const char *id, bool must_exist); static void main_loop(const char *args, struct ctl_command *commands, @@ -166,7 +167,10 @@ main_loop(const char *args, struct ctl_command *commands, size_t n_commands, seqno = ovsdb_idl_get_seqno(idl); bool retry; -do_nbctl(args, commands, n_commands, idl, ); +char *error = do_nbctl(args, commands, n_commands, idl, ); +if (error) { +ctl_fatal("%s", error); +} if (!retry) { return; } @@ -4137,7 +4141,7 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands, } } -static void +static char * do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, struct ovsdb_idl *idl, bool *retry) { @@ -4148,6 +4152,7 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, struct ctl_command *c; struct shash_node *node; int64_t next_cfg = 0; +char *error = NULL; ovs_assert(retry); @@ -4181,7 +4186,9 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, (c->syntax->run)(); } if (ctx.error) { -ctl_fatal("%s", ctx.error); +error = xstrdup(ctx.error); +ctl_context_done(, c); +goto out_error; } ctl_context_done_command(, c); @@ -4195,9 +4202,10 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, SHASH_FOR_EACH (node, >sh) { struct ovsdb_symbol *symbol = node->data; if (!symbol->created) { -ctl_fatal("row id \"%s\" is referenced but never created (e.g. " - "with \"-- --id=%s create ...\")", - node->name, node->name); +error = xasprintf("row id \"%s\" is referenced but never created " + "(e.g. with \"-- --id=%s create ...\")", + node->name, node->name); +goto out_error; } if (!symbol->strong_ref) { if (!symbol->weak_ref) { @@ -4222,7 +4230,9 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, ctl_context_init(, c, idl, txn, symtab, NULL); (c->syntax->postprocess)(); if (ctx.error) { -ctl_fatal("%s", ctx.error); +error = xstrdup(ctx.error); +ctl_context_done(, c); +goto out_error; } ctl_context_done(, c); } @@ -4236,7 +4246,8 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, case TXN_ABORTED: /* Should not happen--we never call ovsdb_idl_txn_abort(). */ -ctl_fatal("transaction aborted"); +error = xstrdup("transaction aborted"); +goto out_error; case TXN_UNCHANGED: case TXN_SUCCESS: @@ -4246,11 +4257,14 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, goto try_again; case TXN_ERROR: -ctl_fatal("transaction error: %s", ovsdb_idl_txn_get_error(txn)); +error = xasprintf("transaction error: %s", + ovsdb_idl_txn_get_error(txn)); +goto out_error; case TXN_NOT_LOCKED: /* Should not happen--we never call ovsdb_idl_set_lock(). */ -ctl_fatal("database not locked"); +error = xstrdup("database not locked"); +goto out_error; default: OVS_NOT_REACHED(); @@ -4309,11 +4323,14 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, ovsdb_idl_txn_destroy(txn); *retry = false; -return; +return NULL; try_again: /* Our
[ovs-dev] [PATCH 06/15] ovn-nbctl: Signal need to try again via an output param.
Introduce an output parameter for the flag that signals need to retry running the command. This leaves the return value for error reporting. Preparatory work for reusing the main loop in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index a700695fe..360b25a89 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -84,8 +84,8 @@ OVS_NO_RETURN static void usage(void); static void parse_options(int argc, char *argv[], struct shash *local_options); static void run_prerequisites(struct ctl_command[], size_t n_commands, struct ovsdb_idl *); -static bool do_nbctl(const char *args, struct ctl_command *, size_t n, - struct ovsdb_idl *); +static void do_nbctl(const char *args, struct ctl_command *, size_t n, + struct ovsdb_idl *, bool *retry); static const struct nbrec_dhcp_options *dhcp_options_get( struct ctl_context *ctx, const char *id, bool must_exist); static void main_loop(const char *args, struct ctl_command *commands, @@ -164,7 +164,10 @@ main_loop(const char *args, struct ctl_command *commands, size_t n_commands, if (seqno != ovsdb_idl_get_seqno(idl)) { seqno = ovsdb_idl_get_seqno(idl); -if (do_nbctl(args, commands, n_commands, idl)) { + +bool retry; +do_nbctl(args, commands, n_commands, idl, ); +if (!retry) { return; } } @@ -4134,9 +4137,9 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands, } } -static bool +static void do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, - struct ovsdb_idl *idl) + struct ovsdb_idl *idl, bool *retry) { struct ovsdb_idl_txn *txn; enum ovsdb_idl_txn_status status; @@ -4146,6 +4149,8 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, struct shash_node *node; int64_t next_cfg = 0; +ovs_assert(retry); + txn = the_idl_txn = ovsdb_idl_txn_create(idl); if (dry_run) { ovsdb_idl_txn_set_dry_run(txn); @@ -4303,7 +4308,8 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, ovsdb_idl_txn_destroy(txn); -return true; +*retry = false; +return; try_again: /* Our transaction needs to be rerun, or a prerequisite was not met. Free @@ -4318,7 +4324,7 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, table_destroy(c->table); free(c->table); } -return false; +*retry = true; } /* Frees the current transaction and the underlying IDL and then calls -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 05/15] ovn-nbctl: Pull up releasing IDL from do_nbctl().
Destroy IDL resources in the routine where we allocated them. Preparatory work for reusing the main loop in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 51527741b..a700695fe 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -126,6 +126,9 @@ main(int argc, char *argv[]) main_loop(args, commands, n_commands, idl); +ovsdb_idl_destroy(idl); +idl = the_idl = NULL; + for (struct ctl_command *c = commands; c < [n_commands]; c++) { ds_destroy(>output); table_destroy(c->table); @@ -4299,7 +4302,6 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, } ovsdb_idl_txn_destroy(txn); -ovsdb_idl_destroy(idl); return true; -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 03/15] ovn-nbctl: Extract the main loop.
Split out a routine for the main ovn-nbctl loop. Preparatory work for introducing daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index 47df19b23..a027553b7 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -88,6 +88,8 @@ static bool do_nbctl(const char *args, struct ctl_command *, size_t n, struct ovsdb_idl *); static const struct nbrec_dhcp_options *dhcp_options_get( struct ctl_context *ctx, const char *id, bool must_exist); +static void main_loop(const char *args, struct ctl_command *commands, + size_t n_commands, struct ovsdb_idl *idl); int main(int argc, char *argv[]) @@ -95,7 +97,6 @@ main(int argc, char *argv[]) struct ovsdb_idl *idl; struct ctl_command *commands; struct shash local_options; -unsigned int seqno; size_t n_commands; set_program_name(argv[0]); @@ -123,6 +124,18 @@ main(int argc, char *argv[]) ovsdb_idl_set_leader_only(idl, leader_only); run_prerequisites(commands, n_commands, idl); +main_loop(args, commands, n_commands, idl); + +free(args); +exit(EXIT_SUCCESS); +} + +static void +main_loop(const char *args, struct ctl_command *commands, size_t n_commands, + struct ovsdb_idl *idl) +{ +unsigned int seqno; + /* Execute the commands. * * 'seqno' is the database sequence number for which we last tried to @@ -136,14 +149,13 @@ main(int argc, char *argv[]) if (!ovsdb_idl_is_alive(idl)) { int retval = ovsdb_idl_get_last_error(idl); ctl_fatal("%s: database connection failed (%s)", -db, ovs_retval_to_string(retval)); + db, ovs_retval_to_string(retval)); } if (seqno != ovsdb_idl_get_seqno(idl)) { seqno = ovsdb_idl_get_seqno(idl); if (do_nbctl(args, commands, n_commands, idl)) { -free(args); -exit(EXIT_SUCCESS); +return; } } -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 04/15] ovn-nbctl: Pull up destroying commands from do_nbctl().
Destroy commands in the same routine where they were allocated. Preparatory work for reusing the main loop in daemon mode. Signed-off-by: Jakub Sitnicki --- ovn/utilities/ovn-nbctl.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index a027553b7..51527741b 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -126,6 +126,13 @@ main(int argc, char *argv[]) main_loop(args, commands, n_commands, idl); +for (struct ctl_command *c = commands; c < [n_commands]; c++) { +ds_destroy(>output); +table_destroy(c->table); +free(c->table); +shash_destroy_free_data(>options); +} +free(commands); free(args); exit(EXIT_SUCCESS); } @@ -4271,13 +4278,7 @@ do_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, } else { fputs(ds_cstr(ds), stdout); } -ds_destroy(>output); -table_destroy(c->table); -free(c->table); - -shash_destroy_free_data(>options); } -free(commands); if (wait_type != NBCTL_WAIT_NONE && status != TXN_UNCHANGED) { ovsdb_idl_enable_reconnect(idl); -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 02/15] ovsdb-idl: Allow monitoring columns that are already monitored.
If IDL was created with monitoring and alerts turned on by default for all columns, then there is no harm in allowing the API users to ask again for monitoring and alerts to be enabled for any given column. This allows us to run prerequisites handlers for db-ctl and ovn-nbctl commands once the IDL has already ran once. Signed-off-by: Jakub Sitnicki --- lib/ovsdb-idl.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 9ab5d6723..ae0a55c3a 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -1116,6 +1116,20 @@ ovsdb_idl_db_get_mode(struct ovsdb_idl_db *db, return >modes[column - table->class_->columns]; } +static void +ovsdb_idl_db_set_mode(struct ovsdb_idl_db *db, + const struct ovsdb_idl_column *column, + unsigned char mode) +{ +const struct ovsdb_idl_table *table = ovsdb_idl_table_from_column(db, + column); +size_t column_idx = column - table->class_->columns; + +if (table->modes[column_idx] != mode) { +*ovsdb_idl_db_get_mode(db, column) = mode; +} +} + static void add_ref_table(struct ovsdb_idl_db *db, const struct ovsdb_base_type *base) { @@ -1136,7 +1150,7 @@ static void ovsdb_idl_db_add_column(struct ovsdb_idl_db *db, const struct ovsdb_idl_column *column) { -*ovsdb_idl_db_get_mode(db, column) = OVSDB_IDL_MONITOR | OVSDB_IDL_ALERT; +ovsdb_idl_db_set_mode(db, column, OVSDB_IDL_MONITOR | OVSDB_IDL_ALERT); add_ref_table(db, >type.key); add_ref_table(db, >type.value); } -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 00/15] Daemon mode for ovn-nbctl
This series extends ovn-nbctl tool with support for the daemon mode, where ovn-nbctl acts a long-lived process that accepts commands over a UNIX socket. The daemon can be started the same way as any other OVS/OVN server: ovn-nbctl --detach --pidfile --log-file While commands can be issued to it using the 'ovs-appctl' tool: ovs-appctl -t ovn-nbctl run [OPTIONS] COMMAND [-- [OPTIONS] COMMAND] ... (Although the goal is to control the daemon using the ovn-nbctl program itself.) The motivation and the main benefit from the daemon mode is that the contents of NB database have to be obtained only once, when the first command is ran. On big databases (1000's of logical ports) this results in a speed up per command in the range of 100's of milliseconds. The changes are functional to the point that all test cases in the ovn-nbctl test suite (tests/ovn-nbctl.at) and OVN test suite (tests/ovn.at) pass when running ovn-nbctl as a daemon [1]. However, I'm still thinking how to nicely integrate the daemon mode with the test suite so that the existing tests can be run using either the normal or the daemon mode. Any ideas? Also, not all places that call ctl_fatal() have been converted yet to propagate the error to the caller. As a result hitting an unconverted an error path will cause the daemon process to die. This can be worked around with the --monitor option. Daemon mode should be considered experimental. Changes RFC -> v1: - Rebase onto master @ 61b1c7acb9a2 ("netdev-bsd: Fix crash on FreeBSD."). - Add support for commands that use tabular output ('find' and 'list') thanks to recent work in table module by Ben Pfaff. This includes support for options that control table formatting. - Run prerequisites routines. In the end this is needed to support the 'sync' command, which itself is more like an option than command (has to get processed before the commands run). This is also the reason for minor changes in the IDL. - Add support for --dry-run, --wait / --no-wait, --timeout, and --oneline options. Timeout handling is different than in the normal mode - we only time out in poll_block(). Still, it serves the purpose avoiding an infinite 'sync'. - Add tests for ovn-nbctl 'sync' command, dry-run mode, and oneline-formatted output. - Extend the ovn-nbctl man-page with description of daemon mode. - Remove extraneous return at the end of a void function. Pointed out by Ben Pfaff. - Drop WIP patch for integration with tests from the series until a right approach can be found. Integration with tests that was used during development is available at: https://github.com/jsitnicki/ovs/commits/wip-nbctl-daemon-2018-07-11 - Minor style cleanups. Thanks, Jakub [1] Except test "2563: ovn -- IPv6 ND Router Solicitation responder" which seems broken in master @ 61b1c7acb9a2 ("netdev-bsd: Fix crash on FreeBSD."). Jakub Sitnicki (15): table: Allow default style to be used in an assignment. ovsdb-idl: Allow monitoring columns that are already monitored. ovn-nbctl: Extract the main loop. ovn-nbctl: Pull up destroying commands from do_nbctl(). ovn-nbctl: Pull up releasing IDL from do_nbctl(). ovn-nbctl: Signal need to try again via an output param. ovn-nbctl: Propagate the error from do_nbctl(). ovn-nbctl: Propagate errors from the main loop. ovn-nbctl: Propagate errors from prerequisites runner. ovn-nbctl: Introduce a poll_timer based wait timeout. ovn-nbctl: Extract helper for printing oneline output. ovn-nbctl: Initial support for daemon mode. tests: Add test for ovn-nbctl dry run mode. tests: Add test for sync command to ovn-nbctl test suite. tests: Add test for oneline-formatted output for ovn-nbctl. lib/ovsdb-idl.c | 16 +- lib/table.h | 3 +- ovn/utilities/ovn-nbctl.8.xml | 40 + ovn/utilities/ovn-nbctl.c | 368 ++ tests/ovn-nbctl.at| 42 + tests/ovn.at | 19 +++ 6 files changed, 423 insertions(+), 65 deletions(-) -- 2.14.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v5 1/2] dpif-netdev: Add SMC cache after EMC cache
> Acked-by: Billy O'Mahony > Thanks to all for the work on this. I've applied this to dpdk_merge branch, it will be part of this week's pull request. I rolled patch 2 of the series into the same commit as I don't think it makes sense to have a broken unit test for the 1st commit. Thanks Ian > > -Original Message- > > From: Wang, Yipeng1 > > Sent: Tuesday, July 10, 2018 11:14 AM > > To: d...@openvswitch.org; jan.scheur...@ericsson.com; O Mahony, Billy > > > > Cc: Wang, Yipeng1 ; Stokes, Ian > > ; b...@ovn.org > > Subject: [PATCH v5 1/2] dpif-netdev: Add SMC cache after EMC cache > > > > This patch adds a signature match cache (SMC) after exact match cache > (EMC). > > The difference between SMC and EMC is SMC only stores a signature of a > > flow thus it is much more memory efficient. With same memory space, > > EMC can store 8k flows while SMC can store 1M flows. It is generally > > beneficial to turn on SMC but turn off EMC when traffic flow count is > much larger than EMC size. > > > > SMC cache will map a signature to an dp_netdev_flow index in > > flow_table. Thus, we add two new APIs in cmap for lookup key by index > and lookup index by key. > > > > For now, SMC is an experimental feature that it is turned off by > > default. One can turn it on using ovsdb options. > > > > Signed-off-by: Yipeng Wang > > Co-authored-by: Jan Scheurich > > Signed-off-by: Jan Scheurich > > --- > > Documentation/topics/dpdk/bridge.rst | 15 ++ > > NEWS | 2 + > > lib/cmap.c | 74 > > lib/cmap.h | 11 ++ > > lib/dpif-netdev-perf.h | 1 + > > lib/dpif-netdev.c| 329 > +++ > > tests/pmd.at | 1 + > > vswitchd/vswitch.xml | 13 ++ > > 8 files changed, 409 insertions(+), 37 deletions(-) > > > > diff --git a/Documentation/topics/dpdk/bridge.rst > > b/Documentation/topics/dpdk/bridge.rst > > index 63f8a62..df74c02 100644 > > --- a/Documentation/topics/dpdk/bridge.rst > > +++ b/Documentation/topics/dpdk/bridge.rst > > @@ -102,3 +102,18 @@ For certain traffic profiles with many parallel > > flows, it's recommended to set ``N`` to '0' to achieve higher > forwarding performance. > > > > For more information on the EMC refer to :doc:`/intro/install/dpdk` . > > + > > + > > +SMC cache (experimental) > > +- > > + > > +SMC cache or signature match cache is a new cache level after EMC > cache. > > +The difference between SMC and EMC is SMC only stores a signature of > > +a flow thus it is much more memory efficient. With same memory space, > > +EMC can store 8k flows while SMC can store 1M flows. When traffic > > +flow count is much larger than EMC size, it is generally beneficial > > +to turn off EMC and turn on SMC. It is currently turned off by > > +default and an > > experimental feature. > > + > > +To turn on SMC:: > > + > > +$ ovs-vsctl --no-wait set Open_vSwitch . > > + other_config:smc-enable=true > > diff --git a/NEWS b/NEWS > > index 92e9b92..f30a1e0 100644 > > --- a/NEWS > > +++ b/NEWS > > @@ -44,6 +44,8 @@ Post-v2.9.0 > > ovs-appctl dpif-netdev/pmd-perf-show > > * Supervision of PMD performance metrics and logging of suspicious > > iterations > > + * Add signature match cache (SMC) as experimental feature. When > > + turned > > on, > > + it improves throughput when traffic has many more flows than EMC > size. > > - ERSPAN: > > * Implemented ERSPAN protocol (draft-foschiano-erspan-00.txt) for > > both kernel datapath and userspace datapath. > > diff --git a/lib/cmap.c b/lib/cmap.c > > index 07719a8..cb9cd32 100644 > > --- a/lib/cmap.c > > +++ b/lib/cmap.c > > @@ -373,6 +373,80 @@ cmap_find(const struct cmap *cmap, uint32_t hash) > > hash); > > } > > > > +/* Find a node by the index of the entry of cmap. Index N means the > > +N/CMAP_K > > + * bucket and N%CMAP_K entry in that bucket. > > + * Notice that it is not protected by the optimistic lock > > +(versioning) because > > + * it does not compare the hashes. Currently it is only used by the > > +datapath > > + * SMC cache. > > + * > > + * Return node for the entry of index or NULL if the index beyond > > +boundary */ const struct cmap_node * cmap_find_by_index(const struct > > +cmap *cmap, uint32_t index) { > > +const struct cmap_impl *impl = cmap_get_impl(cmap); > > + > > +uint32_t b = index / CMAP_K; > > +uint32_t e = index % CMAP_K; > > + > > +if (b > impl->mask) { > > +return NULL; > > +} > > + > > +const struct cmap_bucket *bucket = >buckets[b]; > > + > > +return cmap_node_next(>nodes[e]); > > +} > > + > > +/* Find the index of certain hash value. Currently only used by the > > +datapath > > + * SMC cache. > > + * > > + * Return the index of the entry if found, or UINT32_MAX if not found. > > +The > > + *
Re: [ovs-dev] [PATCH] ofproto: Return error codes for Rule insertions"
>Hi Ben/All, >If possible, Kindly hold reviewing this patch for now. Expecting an approval from my Org. Sorry for the inconvenience >caused and thanks for the support. >Will get back and intimate for the review as soon as possible after the approval (expecting it to take not more than a week). >And thanks again for understanding. >>OK. Hi Ben/All, The patch changes are available for review. Thanks a lot for the continued support. Kindly review the patch and let me know your views. Hi Ben, In response to your query, as I had previously suggested, we could have Hardware implementations with ofproto and netdev providers. Only static checks could be possible in Rule-construct phase. The Rule-insert API call could potentially fail due to any of dynamic HW failures, runtime errors and so on. And incase of Hybrid mode implementations(coexistence of normal and Openflow Switch functioning), the possibility of rule-insertion failures could be higher. Kindly let me know your views. Thanks, Aravind Prasad S On Tue, Jul 10, 2018 at 10:02 PM Ben Pfaff wrote: > OK. > > On Tue, Jul 10, 2018 at 02:58:47PM +0530, Aravind Prasad wrote: > > Hi Ben/All, > > > > If possible, Kindly hold reviewing this patch for now. Expecting an > > approval from my Org. Sorry for the inconvenience caused and thanks for > the > > support. > > > > Will get back and intimate for the review as soon as possible after the > > approval (expecting it to take not more than a week). And thanks again > for > > understanding. > > > > Thanks, > > Aravind Prasad S > > > > On Tue, Jul 10, 2018 at 7:06 AM Aravind Prasad > wrote: > > > > > > > > Currently, rule_insert() API doesnot have return value. There are some > > > possible > > > > scenarios where rule insertions can fail at run-time even though the > > > static > > > > checks during rule_construct() had passed previously. > > > > Some possible scenarios for failure of rule insertions: > > > > **) Rule insertions can fail dynamically in Hybrid mode (both > Openflow > > > and > > > > Normal switch functioning coexist) where the CAM space could get > suddenly > > > > filled up by Normal switch functioning and Openflow gets devoid of > > > > available space. > > > > **) Some deployments could have separate independent layers for HW > rule > > > > insertions and application layer to interact with OVS. HW layer > > > > could face any dynamic issue during rule handling which application > could > > > > not have predicted/captured in rule-construction phase. > > > > Rule-insert errors for bundles are not handled in this pull-request. > > > > Will be handled in upcoming pull request. > > > > > > >> I don't think that ofproto-dpif can ever see such a failure. Are > you > > > >> planning to submit an ofproto provider that exercises this behavior? > > > > > > Hi Ben, > > > > > > These type of errors are possible in actual Hardware implementations. > > > It is possible that ofproto and netdev providers could be implemented > > > for a actual HW. > > > Usually, in such cases, in the rule construct phase, all the static > > > checks like verifying the qualifiers and actions could be done and the > > > other related verifications. > > > But during the rule insert phase, it is possible that the rule > insertion > > > may get failed in HW (runtime errors, HW errors and so on). > > > Hence, we need a way to rollback for rule-insert phase also. > > > Kindly let me know your views. > > > > > > Thanks, > > > Aravind Prasad S > > > > > > > > > On Tue, Jul 10, 2018 at 3:45 AM Ben Pfaff wrote: > > > > > >> On Mon, Jul 09, 2018 at 01:02:08PM +0530, Aravind Prasad S wrote: > > >> > Currently, rule_insert() API doesnot have return value. There are > some > > >> possible > > >> > scenarios where rule insertions can fail at run-time even though the > > >> static > > >> > checks during rule_construct() had passed previously. > > >> > Some possible scenarios for failure of rule insertions: > > >> > **) Rule insertions can fail dynamically in Hybrid mode (both > Openflow > > >> and > > >> > Normal switch functioning coexist) where the CAM space could get > > >> suddenly > > >> > filled up by Normal switch functioning and Openflow gets devoid of > > >> > available space. > > >> > **) Some deployments could have separate independent layers for HW > rule > > >> > insertions and application layer to interact with OVS. HW layer > > >> > could face any dynamic issue during rule handling which application > > >> could > > >> > not have predicted/captured in rule-construction phase. > > >> > Rule-insert errors for bundles are not handled in this pull-request. > > >> > Will be handled in upcoming pull request. > > >> > > > >> > Signed-off-by: Aravind Prasad S > > >> > > >> I don't think that ofproto-dpif can ever see such a failure. Are you > > >> planning to submit an ofproto provider that exercises this behavior? > > >> > > >> Thanks, > > >> > > >> Ben. > > >> > > > > ___ dev mailing
Re: [ovs-dev] Multiqueue in vhost using OVS-DPDK
On Wed, Jul 11, 2018 at 11:32 AM Ian Stokes wrote: > On 7/11/2018 7:23 PM, Ian Stokes wrote: > > On 7/11/2018 7:02 PM, Ravi Kerur wrote: > >> Hello OVS-DPDK team, > >> > >> I am using OVS 2.9.90 for my vhost-virtio testing and had some > >> questions on > >> vhost multiqueue support, it doesn't seem to be working correctly. > Kindly > >> let me know if multiqueue is supported? I am using following link as a > >> reference. > >> > >> > https://software.intel.com/en-us/articles/configure-vhost-user-multiqueue-for-ovs-with-dpdk > >> > >> > > > > Hi Ravi, that document was wrote for OVS 2.5 and DPDK 2.2. There have > > been a number of changes since then. I'll need to update it. > > > > I would suggest following the ovs docs > > > > > http://docs.openvswitch.org/en/latest/topics/dpdk/vhost-user/#adding-vhost-user-ports-to-the-guest-qemu > > > > > > specifically the section for multi queue as it describes the options > > required. > > > >> ovs-vswitchd --version > >> ovs-vswitchd (Open vSwitch) 2.9.90 > >> DPDK 17.11.2 > >> ovs-vsctl get Open_vSwitch . dpdk_version > >> "DPDK 17.11.2" > >> ovs-vsctl get Open_vSwitch . dpdk_initialized > >> true > >> > >> ovs-vsctl set Interface vhost-user-0 options:n_rxq=2 > >> ovs-vsctl set Interface vhost-user-0 options:n_txq=2 > >> ovs-vsctl set Interface vhost-user-1 options:n_rxq=2 > >> ovs-vsctl set Interface vhost-user-1 options:n_txq=2 > > > > You do not need to set the number of rxqs for vhost devices now in OVS > > DPDK. This is set automatically when you launch a guest vm. > > > > Txqs are autmatically set by ovs dpdk also (it's the numbers of PMDs in > > the core mask +1) so no need to set it here. > > > > You only need to set the number of rxqs if you were using multiple ports > > on a physical dpdk port. > > Apologies, I meant multiple queues on a physical dpdk port. > Thank you Ian. Let me go through the document and get back to you if I have any questions. > > Ian > > > > Ian > >> > >> I see following messages in openvswitch logs > >> 2018-07-11T17:13:54.644Z|00210|netdev|WARN|vhost-user-1: arguments > >> provided > >> to device that is not configurable > >> 2018-07-11T17:13:57.514Z|00211|netdev|WARN|vhost-user-0: arguments > >> provided > >> to device that is not configurable > >> 2018-07-11T17:13:57.514Z|00212|netdev|WARN|vhost-user-1: arguments > >> provided > >> to device that is not configurable > >> 2018-07-11T17:13:57.516Z|00213|netdev|WARN|vhost-user-0: arguments > >> provided > >> to device that is not configurable > >> 2018-07-11T17:13:57.516Z|00214|netdev|WARN|vhost-user-1: arguments > >> provided > >> to device that is not configurable > >> 2018-07-11T17:13:57.517Z|00215|netdev|WARN|vhost-user-0: arguments > >> provided > >> to device that is not configurable > >> 2018-07-11T17:13:57.517Z|00216|netdev|WARN|vhost-user-1: arguments > >> provided > >> to device that is not configurable > >> ... > >> > >> ovs-appctl dpctl/show > >> netdev@ovs-netdev: > >>lookups: hit:89395441 missed:216 lost:0 > >>flows: 0 > >>port 0: ovs-netdev (tap) > >>port 1: br0 (tap) > >>*port 2: vhost-user-0 (dpdkvhostuser: configured_rx_queues=1, > >> configured_tx_queues=1, mtu=9000, requested_rx_queues=1, > >> requested_tx_queues=1)* > >>port 3: dpdk-eth0 (dpdk: configured_rx_queues=2, > >> configured_rxq_descriptors=1024, configured_tx_queues=5, > >> configured_txq_descriptors=1024, lsc_interrupt_mode=false, mtu=9000, > >> requested_rx_queues=2, requested_rxq_descriptors=1024, > >> requested_tx_queues=5, requested_txq_descriptors=1024, > >> rx_csum_offload=false) > >>*port 4: vhost-user-1 (dpdkvhostuser: configured_rx_queues=1, > >> configured_tx_queues=1, mtu=9000, requested_rx_queues=1, > >> requested_tx_queues=1)* > >>port 5: dpdk-eth1 (dpdk: configured_rx_queues=2, > >> configured_rxq_descriptors=1024, configured_tx_queues=5, > >> configured_txq_descriptors=1024, lsc_interrupt_mode=false, mtu=9000, > >> requested_rx_queues=2, requested_rxq_descriptors=1024, > >> requested_tx_queues=5, requested_txq_descriptors=1024, > >> rx_csum_offload=false) > >>port 6: br1 (tap) > >> > >> Thanks. > >> ___ > >> dev mailing list > >> d...@openvswitch.org > >> https://mail.openvswitch.org/mailman/listinfo/ovs-dev > >> > > > > ___ > > dev mailing list > > d...@openvswitch.org > > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] Multiqueue in vhost using OVS-DPDK
On 7/11/2018 7:23 PM, Ian Stokes wrote: On 7/11/2018 7:02 PM, Ravi Kerur wrote: Hello OVS-DPDK team, I am using OVS 2.9.90 for my vhost-virtio testing and had some questions on vhost multiqueue support, it doesn't seem to be working correctly. Kindly let me know if multiqueue is supported? I am using following link as a reference. https://software.intel.com/en-us/articles/configure-vhost-user-multiqueue-for-ovs-with-dpdk Hi Ravi, that document was wrote for OVS 2.5 and DPDK 2.2. There have been a number of changes since then. I'll need to update it. I would suggest following the ovs docs http://docs.openvswitch.org/en/latest/topics/dpdk/vhost-user/#adding-vhost-user-ports-to-the-guest-qemu specifically the section for multi queue as it describes the options required. ovs-vswitchd --version ovs-vswitchd (Open vSwitch) 2.9.90 DPDK 17.11.2 ovs-vsctl get Open_vSwitch . dpdk_version "DPDK 17.11.2" ovs-vsctl get Open_vSwitch . dpdk_initialized true ovs-vsctl set Interface vhost-user-0 options:n_rxq=2 ovs-vsctl set Interface vhost-user-0 options:n_txq=2 ovs-vsctl set Interface vhost-user-1 options:n_rxq=2 ovs-vsctl set Interface vhost-user-1 options:n_txq=2 You do not need to set the number of rxqs for vhost devices now in OVS DPDK. This is set automatically when you launch a guest vm. Txqs are autmatically set by ovs dpdk also (it's the numbers of PMDs in the core mask +1) so no need to set it here. You only need to set the number of rxqs if you were using multiple ports on a physical dpdk port. Apologies, I meant multiple queues on a physical dpdk port. Ian Ian I see following messages in openvswitch logs 2018-07-11T17:13:54.644Z|00210|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable 2018-07-11T17:13:57.514Z|00211|netdev|WARN|vhost-user-0: arguments provided to device that is not configurable 2018-07-11T17:13:57.514Z|00212|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable 2018-07-11T17:13:57.516Z|00213|netdev|WARN|vhost-user-0: arguments provided to device that is not configurable 2018-07-11T17:13:57.516Z|00214|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable 2018-07-11T17:13:57.517Z|00215|netdev|WARN|vhost-user-0: arguments provided to device that is not configurable 2018-07-11T17:13:57.517Z|00216|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable ... ovs-appctl dpctl/show netdev@ovs-netdev: Â Â lookups: hit:89395441 missed:216 lost:0 Â Â flows: 0 Â Â port 0: ovs-netdev (tap) Â Â port 1: br0 (tap) Â Â *port 2: vhost-user-0 (dpdkvhostuser: configured_rx_queues=1, configured_tx_queues=1, mtu=9000, requested_rx_queues=1, requested_tx_queues=1)* Â Â port 3: dpdk-eth0 (dpdk: configured_rx_queues=2, configured_rxq_descriptors=1024, configured_tx_queues=5, configured_txq_descriptors=1024, lsc_interrupt_mode=false, mtu=9000, requested_rx_queues=2, requested_rxq_descriptors=1024, requested_tx_queues=5, requested_txq_descriptors=1024, rx_csum_offload=false) Â Â *port 4: vhost-user-1 (dpdkvhostuser: configured_rx_queues=1, configured_tx_queues=1, mtu=9000, requested_rx_queues=1, requested_tx_queues=1)* Â Â port 5: dpdk-eth1 (dpdk: configured_rx_queues=2, configured_rxq_descriptors=1024, configured_tx_queues=5, configured_txq_descriptors=1024, lsc_interrupt_mode=false, mtu=9000, requested_rx_queues=2, requested_rxq_descriptors=1024, requested_tx_queues=5, requested_txq_descriptors=1024, rx_csum_offload=false) Â Â port 6: br1 (tap) Thanks. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] Multiqueue in vhost using OVS-DPDK
On 7/11/2018 7:02 PM, Ravi Kerur wrote: Hello OVS-DPDK team, I am using OVS 2.9.90 for my vhost-virtio testing and had some questions on vhost multiqueue support, it doesn't seem to be working correctly. Kindly let me know if multiqueue is supported? I am using following link as a reference. https://software.intel.com/en-us/articles/configure-vhost-user-multiqueue-for-ovs-with-dpdk Hi Ravi, that document was wrote for OVS 2.5 and DPDK 2.2. There have been a number of changes since then. I'll need to update it. I would suggest following the ovs docs http://docs.openvswitch.org/en/latest/topics/dpdk/vhost-user/#adding-vhost-user-ports-to-the-guest-qemu specifically the section for multi queue as it describes the options required. ovs-vswitchd --version ovs-vswitchd (Open vSwitch) 2.9.90 DPDK 17.11.2 ovs-vsctl get Open_vSwitch . dpdk_version "DPDK 17.11.2" ovs-vsctl get Open_vSwitch . dpdk_initialized true ovs-vsctl set Interface vhost-user-0 options:n_rxq=2 ovs-vsctl set Interface vhost-user-0 options:n_txq=2 ovs-vsctl set Interface vhost-user-1 options:n_rxq=2 ovs-vsctl set Interface vhost-user-1 options:n_txq=2 You do not need to set the number of rxqs for vhost devices now in OVS DPDK. This is set automatically when you launch a guest vm. Txqs are autmatically set by ovs dpdk also (it's the numbers of PMDs in the core mask +1) so no need to set it here. You only need to set the number of rxqs if you were using multiple ports on a physical dpdk port. Ian I see following messages in openvswitch logs 2018-07-11T17:13:54.644Z|00210|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable 2018-07-11T17:13:57.514Z|00211|netdev|WARN|vhost-user-0: arguments provided to device that is not configurable 2018-07-11T17:13:57.514Z|00212|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable 2018-07-11T17:13:57.516Z|00213|netdev|WARN|vhost-user-0: arguments provided to device that is not configurable 2018-07-11T17:13:57.516Z|00214|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable 2018-07-11T17:13:57.517Z|00215|netdev|WARN|vhost-user-0: arguments provided to device that is not configurable 2018-07-11T17:13:57.517Z|00216|netdev|WARN|vhost-user-1: arguments provided to device that is not configurable ... ovs-appctl dpctl/show netdev@ovs-netdev: lookups: hit:89395441 missed:216 lost:0 flows: 0 port 0: ovs-netdev (tap) port 1: br0 (tap) *port 2: vhost-user-0 (dpdkvhostuser: configured_rx_queues=1, configured_tx_queues=1, mtu=9000, requested_rx_queues=1, requested_tx_queues=1)* port 3: dpdk-eth0 (dpdk: configured_rx_queues=2, configured_rxq_descriptors=1024, configured_tx_queues=5, configured_txq_descriptors=1024, lsc_interrupt_mode=false, mtu=9000, requested_rx_queues=2, requested_rxq_descriptors=1024, requested_tx_queues=5, requested_txq_descriptors=1024, rx_csum_offload=false) *port 4: vhost-user-1 (dpdkvhostuser: configured_rx_queues=1, configured_tx_queues=1, mtu=9000, requested_rx_queues=1, requested_tx_queues=1)* port 5: dpdk-eth1 (dpdk: configured_rx_queues=2, configured_rxq_descriptors=1024, configured_tx_queues=5, configured_txq_descriptors=1024, lsc_interrupt_mode=false, mtu=9000, requested_rx_queues=2, requested_rxq_descriptors=1024, requested_tx_queues=5, requested_txq_descriptors=1024, rx_csum_offload=false) port 6: br1 (tap) Thanks. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 14/14] dpdk-tests: End-to-end tests for multi-seg mbufs.
The following tests are added to the DPDK testsuite to add some coverage for the multi-segment mbufs: - Check that multi-segment mbufs are disabled by default; - Check that providing `other_config:dpdk-multi-seg-mbufs=true` indeed enables mbufs; - Using a DPDK port, send a random packet out and check that `ofctl dump-flows` shows the correct amount of packets and bytes sent. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- tests/system-dpdk.at | 65 1 file changed, 65 insertions(+) diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index 3d21b01..af8de8c 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -71,3 +71,68 @@ OVS_VSWITCHD_STOP("/does not exist. The Open vSwitch kernel module is probably n ") AT_CLEANUP dnl -- + +AT_SETUP([Jumbo frames - Multi-segment disabled by default]) +OVS_DPDK_START() + +AT_CHECK([grep "multi-segment mbufs enabled" ovs-vswitchd.log], [1], []) +OVS_VSWITCHD_STOP("/Global register is changed during/d +/EAL: No free hugepages reported in hugepages-1048576kB/d +") +AT_CLEANUP + +AT_SETUP([Jumbo frames - Multi-segment enabled]) +OVS_DPDK_START([dpdk-multi-seg-mbufs=true]) +AT_CHECK([grep "multi-segment mbufs enabled" ovs-vswitchd.log], [], [stdout]) +OVS_VSWITCHD_STOP("/Global register is changed during/d +/EAL: No free hugepages reported in hugepages-1048576kB/d +") +AT_CLEANUP + +AT_SETUP([Jumbo frames - Multi-segment mbufs Tx]) +OVS_DPDK_PRE_CHECK() +OVS_DPDK_START([per-port-memory=true dpdk-multi-seg-mbufs=true]) + +dnl Add userspace bridge and attach it to OVS +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 dpdk0 \ +-- set Interface dpdk0 type=dpdk options:dpdk-devargs=$(cat PCI_ADDR) \ +-- set Interface dpdk0 mtu_request=9000], [], [stdout], [stderr]) + +AT_CHECK([ovs-vsctl show], [], [stdout]) + +dnl Add flows to send packets out from the 'dpdk0' port +AT_CHECK([ +ovs-ofctl del-flows br10 +ovs-ofctl add-flow br10 in_port=LOCAL,actions=output:dpdk0 +], [], [stdout]) + +AT_CHECK([ovs-ofctl dump-flows br10], [], [stdout]) + +dnl Send packet out, of the 'dpdk0' port +AT_CHECK([ +ARP_HEADER="09000B0009000A000806000108000604000100010A\ +0100020A02" +dnl Build a random hex string to append to the ARP_HEADER +RANDOM_BODY=$(printf '0102030405%.0s' {1..1750}) +dnl 8792B ARP packet +RANDOM_ARP="$ARP_HEADER$RANDOM_BODY" + +ovs-ofctl packet-out br10 "packet=$RANDOM_ARP,action=resubmit:LOCAL" +], [], [stdout]) + +AT_CHECK([ovs-ofctl dump-flows br10], [0], [stdout]) + +dnl Confirm the single packet as been sent with correct size +AT_CHECK([ovs-ofctl dump-flows br10 | ofctl_strip | grep in_port], [0], [dnl + n_packets=1, n_bytes=8792, in_port=LOCAL actions=output:1 +]) + +dnl Clean up +OVS_VSWITCHD_STOP("/does not exist. The Open vSwitch kernel module is probably not loaded./d +/Failed to enable flow control/d +/failed to connect to \/tmp\/dpdkvhostclient0: No such file or directory/d +/Global register is changed during/d +/EAL: No free hugepages reported in hugepages-1048576kB/d +") +AT_CLEANUP -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 12/14] dpdk-tests: Add uni-tests for multi-seg mbufs.
In order to create a minimal environment that allows the tests to get mbufs from an existing mempool, the following approach is taken: - EAL is initialised (by using the main dpdk_init()) and a (very) small mempool is instantiated (mimicking the logic in dpdk_mp_create()). This mempool instance is global and used by all the tests; - Packets are then allocated from the instantiated mempool, and tested on, by running some operations on them and manipulating data. The tests introduced focus on testing DPDK dp_packets (where source=DPBUF_DPDK), linked with a single or multiple mbufs, across several operations, such as: - dp_packet_put(); - dp_packet_shift(); - dp_packet_reserve(); - dp_packet_push_uninit(); - dp_packet_clear(); - And as a consequence of some of these, dp_packet_put_uninit() and dp_packet_resize__(). Finally, this has also been integrated with the new DPDK testsuite. Thus, when running `$sudo make check-dpdk` one will also be running these tests. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- tests/automake.mk | 10 +- tests/dpdk-packet-mbufs.at | 7 + tests/system-dpdk-testsuite.at | 1 + tests/test-dpdk-mbufs.c| 518 + 4 files changed, 535 insertions(+), 1 deletion(-) create mode 100644 tests/dpdk-packet-mbufs.at create mode 100644 tests/test-dpdk-mbufs.c diff --git a/tests/automake.mk b/tests/automake.mk index 8224e5a..b3941d0 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -134,7 +134,8 @@ SYSTEM_DPDK_TESTSUITE_AT = \ tests/system-common-macros.at \ tests/system-dpdk-macros.at \ tests/system-dpdk-testsuite.at \ - tests/system-dpdk.at + tests/system-dpdk.at \ + tests/dpdk-packet-mbufs.at check_SCRIPTS += tests/atlocal @@ -391,6 +392,10 @@ tests_ovstest_SOURCES = \ tests/test-vconn.c \ tests/test-aa.c \ tests/test-stopwatch.c +if DPDK_NETDEV +tests_ovstest_SOURCES = \ + tests/test-dpdk-mbufs.c +endif if !WIN32 tests_ovstest_SOURCES += \ @@ -403,6 +408,9 @@ tests_ovstest_SOURCES += \ endif tests_ovstest_LDADD = lib/libopenvswitch.la ovn/lib/libovn.la +if DPDK_NETDEV +tests_ovstest_LDFLAGS = $(AM_LDFLAGS) $(DPDK_vswitchd_LDFLAGS) +endif noinst_PROGRAMS += tests/test-strtok_r tests_test_strtok_r_SOURCES = tests/test-strtok_r.c diff --git a/tests/dpdk-packet-mbufs.at b/tests/dpdk-packet-mbufs.at new file mode 100644 index 000..f28e4fc --- /dev/null +++ b/tests/dpdk-packet-mbufs.at @@ -0,0 +1,7 @@ +AT_BANNER([OVS-DPDK dp_packet unit tests]) + +AT_SETUP([OVS-DPDK dp_packet - mbufs allocation]) +AT_KEYWORDS([dp_packet, multi-seg, mbufs]) +AT_CHECK(ovstest test-dpdk-packet, [], [ignore], [ignore]) + +AT_CLEANUP diff --git a/tests/system-dpdk-testsuite.at b/tests/system-dpdk-testsuite.at index 382f09e..f5edf58 100644 --- a/tests/system-dpdk-testsuite.at +++ b/tests/system-dpdk-testsuite.at @@ -23,3 +23,4 @@ m4_include([tests/system-common-macros.at]) m4_include([tests/system-dpdk-macros.at]) m4_include([tests/system-dpdk.at]) +m4_include([tests/dpdk-packet-mbufs.at]) diff --git a/tests/test-dpdk-mbufs.c b/tests/test-dpdk-mbufs.c new file mode 100644 index 000..1c77038 --- /dev/null +++ b/tests/test-dpdk-mbufs.c @@ -0,0 +1,518 @@ +/* + * Copyright (c) 2018 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "dp-packet.h" +#include "ovstest.h" +#include "dpdk.h" +#include "smap.h" + +#define N_MBUFS 1024 +#define MBUF_DATA_LEN 2048 + +int num_tests = 0; + +/* Global var to hold a mempool instance, "test-mp", used in all of the tests + * below. This instance is instantiated in dpdk_setup_eal_with_mp(). */ +static struct rte_mempool *mp; + +/* Test data used to fill the packets with data. Note that this isn't a string + * that repsents a valid packet, by any means. The pattern is generated in set_ + * testing_pattern_str() and the sole purpose is to verify the data remains the + * same after inserting and operating on multi-segment mbufs. */ +static char *test_str; + +/* Asserts a dp_packet that holds a single mbuf, where: + * - nb_segs must be 1; + * - pkt_len must be equal to data_len which in turn must equal the provided + * 'pkt_len'; + * - data_off must start at the provided 'data_ofs'; + * - next must be NULL. */ +static void +assert_single_mbuf(struct dp_packet
[ovs-dev] [PATCH v5 13/14] dpdk-tests: Accept other configs in OVS_DPDK_START
As it stands, OVS_DPDK_START() won't allow other configs to be set before starting the ovs-vswitchd daemon. This is a problem since some configs, such as the "dpdk-multi-seg-mbufs=true" for enabling the multi-segment mbufs, need to be set prior to start OvS. To support other options, OVS_DPDK_START() has been modified to accept extra configs in the form "$config_name=$config_value". It then uses ovs-vsctl to set the configs. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- tests/system-dpdk-macros.at | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at index 0762ee0..7c65834 100644 --- a/tests/system-dpdk-macros.at +++ b/tests/system-dpdk-macros.at @@ -21,7 +21,7 @@ m4_define([OVS_DPDK_PRE_CHECK], ]) -# OVS_DPDK_START() +# OVS_DPDK_START([other-conf-args]) # # Create an empty database and start ovsdb-server. Add special configuration # dpdk-init to enable DPDK functionality. Start ovs-vswitchd connected to that @@ -48,6 +48,10 @@ m4_define([OVS_DPDK_START], AT_CHECK([lscpu], [], [stdout]) AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "1024,"}; print "1024"}' > SOCKET_MEM]) AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem="$(cat SOCKET_MEM)"]) + dnl Iterate through $other-conf-args list and include them + m4_foreach_w(opt, $1, [ + AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:opt]) + ]) dnl Start ovs-vswitchd. AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --log-file -vvconn -vofproto_dpif -vunixctl], [0], [stdout], [stderr]) -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 11/14] netdev-dpdk: support multi-segment jumbo frames
From: Mark Kavanagh Currently, jumbo frame support for OvS-DPDK is implemented by increasing the size of mbufs within a mempool, such that each mbuf within the pool is large enough to contain an entire jumbo frame of a user-defined size. Typically, for each user-defined MTU, 'requested_mtu', a new mempool is created, containing mbufs of size ~requested_mtu. With the multi-segment approach, a port uses a single mempool, (containing standard/default-sized mbufs of ~2k bytes), irrespective of the user-requested MTU value. To accommodate jumbo frames, mbufs are chained together, where each mbuf in the chain stores a portion of the jumbo frame. Each mbuf in the chain is termed a segment, hence the name. == Enabling multi-segment mbufs == Multi-segment and single-segment mbufs are mutually exclusive, and the user must decide on which approach to adopt on init. The introduction of a new OVSDB field, 'dpdk-multi-seg-mbufs', facilitates this. This is a global boolean value, which determines how jumbo frames are represented across all DPDK ports. In the absence of a user-supplied value, 'dpdk-multi-seg-mbufs' defaults to false, i.e. multi-segment mbufs must be explicitly enabled / single-segment mbufs remain the default. Setting the field is identical to setting existing DPDK-specific OVSDB fields: ovs-vsctl set Open_vSwitch . other_config:dpdk-init=true ovs-vsctl set Open_vSwitch . other_config:dpdk-lcore-mask=0x10 ovs-vsctl set Open_vSwitch . other_config:dpdk-socket-mem=4096,0 ==> ovs-vsctl set Open_vSwitch . other_config:dpdk-multi-seg-mbufs=true Co-authored-by: Tiago Lam Signed-off-by: Mark Kavanagh Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- Documentation/topics/dpdk/jumbo-frames.rst | 52 +++ Documentation/topics/dpdk/memory.rst | 36 NEWS | 1 + lib/dpdk.c | 8 lib/netdev-dpdk.c | 66 ++ lib/netdev-dpdk.h | 2 + vswitchd/vswitch.xml | 22 ++ 7 files changed, 179 insertions(+), 8 deletions(-) diff --git a/Documentation/topics/dpdk/jumbo-frames.rst b/Documentation/topics/dpdk/jumbo-frames.rst index 00360b4..89ce8de 100644 --- a/Documentation/topics/dpdk/jumbo-frames.rst +++ b/Documentation/topics/dpdk/jumbo-frames.rst @@ -71,3 +71,55 @@ Jumbo frame support has been validated against 9728B frames, which is the largest frame size supported by Fortville NIC using the DPDK i40e driver, but larger frames and other DPDK NIC drivers may be supported. These cases are common for use cases involving East-West traffic only. + +--- +Multi-segment mbufs +--- + +Instead of increasing the size of mbufs within a mempool, such that each mbuf +within the pool is large enough to contain an entire jumbo frame of a +user-defined size, mbufs can be chained together instead. In this approach each +mbuf in the chain stores a portion of the jumbo frame, by default ~2K bytes, +irrespective of the user-requested MTU value. Since each mbuf in the chain is +termed a segment, this approach is named "multi-segment mbufs". + +This approach may bring more flexibility in use cases where the maximum packet +length may be hard to guess. For example, in cases where packets originate from +sources marked for oflload (such as TSO), each packet may be larger than the +MTU, and as such, when forwarding it to a DPDK port a single mbuf may not be +enough to hold all of the packet's data. + +Multi-segment and single-segment mbufs are mutually exclusive, and the user +must decide on which approach to adopt on initialisation. If multi-segment +mbufs is to be enabled, it can be done so with the following command:: + +$ ovs-vsctl set Open_vSwitch . other_config:dpdk-multi-seg-mbufs=true + +Single-segment mbufs still remain the default when using OvS-DPDK, and the +above option `dpdk-multi-seg-mbufs` must be explicitly set to `true` if +multi-segment mbufs are to be used. + +~ +Performance notes +~ + +When using multi-segment mbufs some PMDs may not support vectorized Tx +functions, due to its non-contiguous nature. As a result this can hit +performance for smaller packet sizes. For example, on a setup sending 64B +packets at line rate, a decrease of ~20% has been observed. The performance +impact stops being noticeable for larger packet sizes, although the exact size +will between PMDs, and depending on the architecture one's using. + +Tests performed with the i40e PMD driver only showed this limitation for 64B +packets, and the same rate was observed when comparing multi-segment mbufs and +single-segment mbuf for 128B packets. In other words, the 20% drop in +performance was not observed for packets >= 128B during this test case. + +Because of this, multi-segment mbufs is not advised to be used with smaller +packet sizes,
[ovs-dev] [PATCH v5 10/14] netdev-dpdk: copy large packet to multi-seg. mbufs
From: Mark Kavanagh Currently, packets are only copied to a single segment in the function dpdk_do_tx_copy(). This could be an issue in the case of jumbo frames, particularly when multi-segment mbufs are involved. This patch calculates the number of segments needed by a packet and copies the data to each segment. A new function, dpdk_buf_alloc(), has also been introduced as a wrapper around the nonpmd_mp_mutex to serialise allocations from a non-pmd context. Co-authored-by: Michael Qiu Co-authored-by: Tiago Lam Signed-off-by: Mark Kavanagh Signed-off-by: Michael Qiu Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/netdev-dpdk.c | 84 +-- 1 file changed, 75 insertions(+), 9 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 50de1a2..f05ad36 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -552,6 +552,27 @@ dpdk_rte_mzalloc(size_t sz) return rte_zmalloc(OVS_VPORT_DPDK, sz, OVS_CACHE_LINE_SIZE); } +static struct rte_mbuf * +dpdk_buf_alloc(struct rte_mempool *mp) +{ +struct rte_mbuf *mbuf = NULL; + +/* If non-pmd we need to lock on nonpmd_mp_mutex mutex */ +if (!dpdk_thread_is_pmd()) { +ovs_mutex_lock(_mp_mutex); + +mbuf = rte_pktmbuf_alloc(mp); + +ovs_mutex_unlock(_mp_mutex); + +return mbuf; +} + +mbuf = rte_pktmbuf_alloc(mp); + +return mbuf; +} + void free_dpdk_buf(struct dp_packet *packet) { @@ -2320,6 +2341,49 @@ out: } } +static int +dpdk_copy_dp_packet_to_mbuf(struct dp_packet *packet, struct rte_mbuf **head, +struct rte_mempool *mp) +{ +struct rte_mbuf *mbuf, *fmbuf; +uint32_t size = dp_packet_size(packet); +uint16_t max_data_len; +uint32_t nb_segs = 0; + +/* Allocate first mbuf to know the size of data available */ +fmbuf = mbuf = *head = dpdk_buf_alloc(mp); +if (OVS_UNLIKELY(!mbuf)) { +return ENOMEM; +} + +/* All new allocated mbuf's max data len is the same */ +max_data_len = mbuf->buf_len - mbuf->data_off; + +/* Calculate # of output mbufs. */ +nb_segs = size / max_data_len; +if (size % max_data_len) { +nb_segs = nb_segs + 1; +} + +/* Allocate additional mbufs, less the one alredy allocated above */ +for (int i = 1; i < nb_segs; i++) { +mbuf->next = dpdk_buf_alloc(mp); +if (!mbuf->next) { +free_dpdk_buf(CONTAINER_OF(fmbuf, struct dp_packet, mbuf)); +fmbuf = NULL; +return ENOMEM; +} +mbuf = mbuf->next; +} + +fmbuf->nb_segs = nb_segs; +fmbuf->pkt_len = size; + +dp_packet_mbuf_write(fmbuf, 0, size, dp_packet_data(packet)); + +return 0; +} + /* Tx function. Transmit packets indefinitely */ static void dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) @@ -2336,6 +2400,7 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) struct rte_mbuf *pkts[PKT_ARRAY_SIZE]; uint32_t cnt = batch_cnt; uint32_t dropped = 0; +uint32_t i; if (dev->type != DPDK_DEV_VHOST) { /* Check if QoS has been configured for this netdev. */ @@ -2346,28 +2411,29 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) uint32_t txcnt = 0; -for (uint32_t i = 0; i < cnt; i++) { +for (i = 0; i < cnt; i++) { struct dp_packet *packet = batch->packets[i]; uint32_t size = dp_packet_size(packet); +int err = 0; if (OVS_UNLIKELY(size > dev->max_packet_len)) { VLOG_WARN_RL(, "Too big size %u max_packet_len %d", size, dev->max_packet_len); - dropped++; continue; } -pkts[txcnt] = rte_pktmbuf_alloc(dev->dpdk_mp->mp); -if (OVS_UNLIKELY(!pkts[txcnt])) { +err = dpdk_copy_dp_packet_to_mbuf(packet, [txcnt], + dev->dpdk_mp->mp); +if (err != 0) { +if (err == ENOMEM) { +VLOG_ERR_RL(, "Failed to alloc mbufs! %u packets dropped", +cnt - i); +} + dropped += cnt - i; break; } - -/* We have to do a copy for now */ -memcpy(rte_pktmbuf_mtod(pkts[txcnt], void *), - dp_packet_data(packet), size); -dp_packet_set_size((struct dp_packet *)pkts[txcnt], size); dp_packet_copy_mbuf_flags((struct dp_packet *)pkts[txcnt], packet); txcnt++; -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 09/14] dp-packet: copy data from multi-seg. DPDK mbuf
From: Michael Qiu When doing packet clone, if packet source is from DPDK driver, multi-segment must be considered, and copy the segment's data one by one. Also, lots of DPDK mbuf's info is missed during a copy, like packet type, ol_flags, etc. That information is very important for DPDK to do packets processing. Co-authored-by: Mark Kavanagh Co-authored-by: Tiago Lam Signed-off-by: Michael Qiu Signed-off-by: Mark Kavanagh Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.c | 71 ++- lib/dp-packet.h | 3 +++ lib/netdev-dpdk.c | 1 + 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 87af459..ae060e2 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -48,6 +48,23 @@ dp_packet_use__(struct dp_packet *b, void *base, size_t allocated, dp_packet_set_size(b, 0); } +#ifdef DPDK_NETDEV +void +dp_packet_copy_mbuf_flags(struct dp_packet *dst, const struct dp_packet *src) +{ +ovs_assert(dst != NULL && src != NULL); +struct rte_mbuf *buf_dst = &(dst->mbuf); +struct rte_mbuf buf_src = src->mbuf; + +buf_dst->nb_segs = buf_src.nb_segs; +buf_dst->ol_flags = buf_src.ol_flags; +buf_dst->packet_type = buf_src.packet_type; +buf_dst->tx_offload = buf_src.tx_offload; +} +#else +#define dp_packet_copy_mbuf_flags(arg1, arg2) +#endif + /* Initializes 'b' as an empty dp_packet that contains the 'allocated' bytes of * memory starting at 'base'. 'base' should be the first byte of a region * obtained from malloc(). It will be freed (with free()) if 'b' is resized or @@ -158,6 +175,44 @@ dp_packet_clone(const struct dp_packet *buffer) return dp_packet_clone_with_headroom(buffer, 0); } +#ifdef DPDK_NETDEV +struct dp_packet * +dp_packet_clone_with_headroom(const struct dp_packet *b, size_t headroom) { +struct dp_packet *new_buffer; +uint32_t pkt_len = dp_packet_size(b); + +/* copy multi-seg data */ +if (b->source == DPBUF_DPDK && b->mbuf.nb_segs > 1) { +void *dst = NULL; +struct rte_mbuf *mbuf = CONST_CAST(struct rte_mbuf *, >mbuf); + +new_buffer = dp_packet_new_with_headroom(pkt_len, headroom); +dst = dp_packet_data(new_buffer); +dp_packet_set_size(new_buffer, pkt_len); + +if (!rte_pktmbuf_read(mbuf, 0, pkt_len, dst)) { +return NULL; +} +} else { +new_buffer = dp_packet_clone_data_with_headroom(dp_packet_data(b), +dp_packet_size(b), +headroom); +} + +/* Copy the following fields into the returned buffer: l2_pad_size, + * l2_5_ofs, l3_ofs, l4_ofs, cutlen, packet_type and md. */ +memcpy(_buffer->l2_pad_size, >l2_pad_size, + sizeof(struct dp_packet) - + offsetof(struct dp_packet, l2_pad_size)); + +dp_packet_copy_mbuf_flags(new_buffer, b); +if (dp_packet_rss_valid(new_buffer)) { +new_buffer->mbuf.hash.rss = b->mbuf.hash.rss; +} + +return new_buffer; +} +#else /* Creates and returns a new dp_packet whose data are copied from 'buffer'. * The returned dp_packet will additionally have 'headroom' bytes of * headroom. */ @@ -165,32 +220,25 @@ struct dp_packet * dp_packet_clone_with_headroom(const struct dp_packet *buffer, size_t headroom) { struct dp_packet *new_buffer; +uint32_t pkt_len = dp_packet_size(buffer); new_buffer = dp_packet_clone_data_with_headroom(dp_packet_data(buffer), - dp_packet_size(buffer), - headroom); + pkt_len, headroom); + /* Copy the following fields into the returned buffer: l2_pad_size, * l2_5_ofs, l3_ofs, l4_ofs, cutlen, packet_type and md. */ memcpy(_buffer->l2_pad_size, >l2_pad_size, sizeof(struct dp_packet) - offsetof(struct dp_packet, l2_pad_size)); -#ifdef DPDK_NETDEV -new_buffer->mbuf.ol_flags = buffer->mbuf.ol_flags; -#else new_buffer->rss_hash_valid = buffer->rss_hash_valid; -#endif - if (dp_packet_rss_valid(new_buffer)) { -#ifdef DPDK_NETDEV -new_buffer->mbuf.hash.rss = buffer->mbuf.hash.rss; -#else new_buffer->rss_hash = buffer->rss_hash; -#endif } return new_buffer; } +#endif /* Creates and returns a new dp_packet that initially contains a copy of the * 'size' bytes of data starting at 'data' with no headroom or tailroom. */ @@ -374,6 +422,7 @@ dp_packet_mbuf_write(struct rte_mbuf *mbuf, int16_t ofs, uint32_t len, len -= len_copy; ofs = 0; +mbuf->data_len = len_copy; mbuf = mbuf->next; } } diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 6ca4e98..d087cb3 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -124,6 +124,9 @@ void
[ovs-dev] [PATCH v5 08/14] dp-packet: Handle multi-seg mbufs in resize__().
When enabled with DPDK OvS relies on mbufs allocated by mempools to receive and output data on DPDK ports. Until now, each OvS dp_packet has had only one mbuf associated, which is allocated with the maximum possible size, taking the MTU into account. This approach, however, doesn't allow us to increase the allocated size in an mbuf, if needed, since an mbuf is allocated and initialised upon mempool creation. Thus, in the current implementatin this is dealt with by calling OVS_NOT_REACHED() and terminating OvS. To avoid this, and allow the (already) allocated space to be better used, dp_packet_resize__() now tries to use the available room, both the tailroom and the headroom, to make enough space for the new data. Since this happens for packets of source DPBUF_DPDK, the single-segment mbuf case mentioned above is also covered by this new aproach in resize__(). Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.c | 48 ++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index d6e19eb..87af459 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -237,9 +237,51 @@ dp_packet_resize__(struct dp_packet *b, size_t new_headroom, size_t new_tailroom new_allocated = new_headroom + dp_packet_size(b) + new_tailroom; switch (b->source) { +/* When resizing mbufs, both a single mbuf and multi-segment mbufs (where + * data is not contigously held in memory), both the headroom and the + * tailroom available will be used to make more space for where data needs + * to be inserted. I.e if there's not enough headroom, data may be shifted + * right if there's enough tailroom. + * However, this is not bulletproof and in some cases the space available + * won't be enough - in those cases, an error should be returned and the + * packet dropped. */ case DPBUF_DPDK: -OVS_NOT_REACHED(); +{ +size_t miss_len; + +if (new_headroom == dp_packet_headroom(b)) { +/* This is a tailroom adjustment. Since there's no tailroom space + * left, try and shift data towards the head to free up tail space, + * if there's enough headroom */ + +miss_len = new_tailroom - dp_packet_tailroom(b); + +if (miss_len <= new_headroom) { +dp_packet_shift(b, -miss_len); +} else { +/* XXX: Handle error case and report error to caller */ +OVS_NOT_REACHED(); +} +} else { +/* Otherwise, this is a headroom adjustment. Try to shift data + * towards the tail to free up head space, if there's enough + * tailroom */ + +miss_len = new_headroom - dp_packet_headroom(b); + +if (miss_len <= new_tailroom) { +dp_packet_shift(b, miss_len); +} else { +/* XXX: Handle error case and report error to caller */ +OVS_NOT_REACHED(); +} +} + +new_base = dp_packet_base(b); + +break; +} case DPBUF_MALLOC: if (new_headroom == dp_packet_headroom(b)) { new_base = xrealloc(dp_packet_base(b), new_allocated); @@ -263,7 +305,9 @@ dp_packet_resize__(struct dp_packet *b, size_t new_headroom, size_t new_tailroom OVS_NOT_REACHED(); } -dp_packet_set_allocated(b, new_allocated); +if (b->source != DPBUF_DPDK) { +dp_packet_set_allocated(b, new_allocated); +} dp_packet_set_base(b, new_base); new_data = (char *) new_base + new_headroom; -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 07/14] dp-packet: Handle multi-seg mubfs in shift() func.
In its current implementation dp_packet_shift() is also unaware of multi-seg mbufs (that holds data in memory non-contiguously) and assumes that data exists contiguously in memory, memmove'ing data to perform the shift. To add support for multi-seg mbuds a new set of functions was introduced, dp_packet_mbuf_shift() and dp_packet_mbuf_write(). These functions are used by dp_packet_shift(), when handling multi-seg mbufs, to shift and write data within a chain of mbufs. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.c | 97 + lib/dp-packet.h | 10 ++ 2 files changed, 107 insertions(+) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 2aaeaae..d6e19eb 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -294,6 +294,97 @@ dp_packet_prealloc_headroom(struct dp_packet *b, size_t size) } } +#ifdef DPDK_NETDEV +/* Write len data bytes in a mbuf at specified offset. + * + * 'mbuf', pointer to the destination mbuf where 'ofs' is, and the mbuf where + * the data will first be written. + * 'ofs', the offset within the provided 'mbuf' where 'data' is to be written. + * 'len', the size of the to be written 'data'. + * 'data', pointer to the to be written bytes. + * + * XXX: This function is the counterpart of the `rte_pktmbuf_read()` function + * available with DPDK, in the rte_mbuf.h */ +void +dp_packet_mbuf_write(struct rte_mbuf *mbuf, int16_t ofs, uint32_t len, + const void *data) +{ +char *dst_addr; +uint16_t data_len; +int len_copy; +while (mbuf) { +if (len == 0) { +break; +} + +dst_addr = rte_pktmbuf_mtod_offset(mbuf, char *, ofs); +data_len = MBUF_BUF_END(mbuf->buf_addr, mbuf->buf_len) - dst_addr; + +len_copy = MIN(len, data_len); +/* We don't know if 'data' is the result of a rte_pktmbuf_read() call, + * in which case we may end up writing to the same region of memory we + * are reading from and overlapping. Hence the use of memmove() here */ +memmove(dst_addr, data, len_copy); + +data = ((char *) data) + len_copy; +len -= len_copy; +ofs = 0; + +mbuf = mbuf->next; +} +} + +static void +dp_packet_mbuf_shift_(struct rte_mbuf *dbuf, int16_t dst_ofs, + const struct rte_mbuf *sbuf, uint16_t src_ofs, int len) +{ +char rd[len]; +const char *wd = rte_pktmbuf_read(sbuf, src_ofs, len, rd); + +ovs_assert(wd); + +dp_packet_mbuf_write(dbuf, dst_ofs, len, wd); +} + +/* Similarly to dp_packet_shift(), shifts the data within the mbufs of a + * dp_packet of DPBUF_DPDK source by 'delta' bytes. + * Caller must make sure of the following conditions: + * - When shifting left, delta can't be bigger than the data_len available in + * the last mbuf; + * - When shifting right, delta can't be bigger than the space available in the + * first mbuf (buf_len - data_off). + * Both these conditions guarantee that a shift operation doesn't fall outside + * the bounds of the existing mbufs, so that the first and last mbufs (when + * using multi-segment mbufs), remain the same. */ +static void +dp_packet_mbuf_shift(struct dp_packet *b, int delta) +{ +uint16_t src_ofs; +int16_t dst_ofs; + +struct rte_mbuf *mbuf = CONST_CAST(struct rte_mbuf *, >mbuf); +struct rte_mbuf *tmbuf = rte_pktmbuf_lastseg(mbuf); + +if (delta < 0) { +ovs_assert(-delta <= tmbuf->data_len); +} else { +ovs_assert(delta < (mbuf->buf_len - mbuf->data_off)); +} + +/* Set the destination and source offsets to copy to */ +dst_ofs = delta; +src_ofs = 0; + +/* Shift data from src mbuf and offset to dst mbuf and offset */ +dp_packet_mbuf_shift_(mbuf, dst_ofs, mbuf, src_ofs, + rte_pktmbuf_pkt_len(mbuf)); + +/* Update mbufs' properties, and if using multi-segment mbufs, first and + * last mbuf's data_len also needs to be adjusted */ +mbuf->data_off = mbuf->data_off + dst_ofs; +} +#endif + /* Shifts all of the data within the allocated space in 'b' by 'delta' bytes. * For example, a 'delta' of 1 would cause each byte of data to move one byte * forward (from address 'p' to 'p+1'), and a 'delta' of -1 would cause each @@ -306,6 +397,12 @@ dp_packet_shift(struct dp_packet *b, int delta) : true); if (delta != 0) { +#ifdef DPDK_NETDEV +if (b->source == DPBUF_DPDK) { +dp_packet_mbuf_shift(b, delta); +return; +} +#endif char *dst = (char *) dp_packet_data(b) + delta; memmove(dst, dp_packet_data(b), dp_packet_size(b)); dp_packet_set_data(b, dst); diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 14e2551..6ca4e98 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -80,6 +80,11 @@ struct dp_packet { }; }; +#ifdef DPDK_NETDEV +#define MBUF_BUF_END(BUF_ADDR, BUF_LEN) \ +(char *) (((char *) BUF_ADDR)
[ovs-dev] [PATCH v5 06/14] dp-packet: Handle multi-seg mbufs in helper funcs.
Most helper functions in dp-packet assume that the data held by a dp_packet is contiguous, and perform operations such as pointer arithmetic under that assumption. However, with the introduction of multi-segment mbufs, where data is non-contiguous, such assumptions are no longer possible. Some examples of Such helper functions are dp_packet_tail(), dp_packet_tailroom(), dp_packet_end(), dp_packet_get_allocated() and dp_packet_at(). Thus, instead of assuming contiguous data in dp_packet, they now iterate over the (non-contiguous) data in mbufs to perform their calculations. Finally, dp_packet_use__() has also been modified to perform the initialisation of the packet (and setting the source) before continuing to set its size and data length, which now depends on the type of packet. Co-authored-by: Mark Kavanagh Signed-off-by: Mark Kavanagh Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.c | 4 +- lib/dp-packet.h | 114 +--- 2 files changed, 111 insertions(+), 7 deletions(-) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 782e7c2..2aaeaae 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -41,11 +41,11 @@ static void dp_packet_use__(struct dp_packet *b, void *base, size_t allocated, enum dp_packet_source source) { +dp_packet_init__(b, allocated, source); + dp_packet_set_base(b, base); dp_packet_set_data(b, base); dp_packet_set_size(b, 0); - -dp_packet_init__(b, allocated, source); } /* Initializes 'b' as an empty dp_packet that contains the 'allocated' bytes of diff --git a/lib/dp-packet.h b/lib/dp-packet.h index d2803af..14e2551 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -185,9 +185,25 @@ dp_packet_delete(struct dp_packet *b) static inline void * dp_packet_at(const struct dp_packet *b, size_t offset, size_t size) { -return offset + size <= dp_packet_size(b) - ? (char *) dp_packet_data(b) + offset - : NULL; +if (offset + size > dp_packet_size(b)) { +return NULL; +} + +#ifdef DPDK_NETDEV +if (b->source == DPBUF_DPDK) { +struct rte_mbuf *buf = CONST_CAST(struct rte_mbuf *, >mbuf); + +while (buf && offset > buf->data_len) { +offset -= buf->data_len; + +buf = buf->next; +} + +return buf ? rte_pktmbuf_mtod_offset(buf, char *, offset) : NULL; +} +#endif + +return (char *) dp_packet_data(b) + offset; } /* Returns a pointer to byte 'offset' in 'b', which must contain at least @@ -196,13 +212,23 @@ static inline void * dp_packet_at_assert(const struct dp_packet *b, size_t offset, size_t size) { ovs_assert(offset + size <= dp_packet_size(b)); -return ((char *) dp_packet_data(b)) + offset; +return dp_packet_at(b, offset, size); } /* Returns a pointer to byte following the last byte of data in use in 'b'. */ static inline void * dp_packet_tail(const struct dp_packet *b) { +#ifdef DPDK_NETDEV +if (b->source == DPBUF_DPDK) { +struct rte_mbuf *buf = CONST_CAST(struct rte_mbuf *, >mbuf); +/* Find last segment where data ends, meaning the tail of the chained + * mbufs must be there */ +buf = rte_pktmbuf_lastseg(buf); + +return rte_pktmbuf_mtod_offset(buf, void *, buf->data_len); +} +#endif return (char *) dp_packet_data(b) + dp_packet_size(b); } @@ -211,6 +237,15 @@ dp_packet_tail(const struct dp_packet *b) static inline void * dp_packet_end(const struct dp_packet *b) { +#ifdef DPDK_NETDEV +if (b->source == DPBUF_DPDK) { +struct rte_mbuf *buf = CONST_CAST(struct rte_mbuf *, &(b->mbuf)); + +buf = rte_pktmbuf_lastseg(buf); + +return (char *) buf->buf_addr + buf->buf_len; +} +#endif return (char *) dp_packet_base(b) + dp_packet_get_allocated(b); } @@ -236,6 +271,15 @@ dp_packet_tailroom(const struct dp_packet *b) static inline void dp_packet_clear(struct dp_packet *b) { +#ifdef DPDK_NETDEV +if (b->source == DPBUF_DPDK) { +/* sets pkt_len and data_len to zero and frees unused mbufs */ +dp_packet_set_size(b, 0); +rte_pktmbuf_reset(>mbuf); + +return; +} +#endif dp_packet_set_data(b, dp_packet_base(b)); dp_packet_set_size(b, 0); } @@ -252,12 +296,33 @@ dp_packet_pull(struct dp_packet *b, size_t size) return data; } +#ifdef DPDK_NETDEV +/* Similar to dp_packet_try_pull() but doesn't actually pull any data, only + * checks if it could and returns true or false accordingly. + * + * Valid for dp_packets carrying mbufs only. */ +static inline bool +dp_packet_mbuf_may_pull(const struct dp_packet *b, size_t size) { +if (size > b->mbuf.data_len) { +return false; +} + +return true; +} +#endif + /* If 'b' has at least 'size' bytes of data, removes that many bytes from the * head end of 'b' and returns the first byte removed. Otherwise, returns a * null pointer without modifying
[ovs-dev] [PATCH v5 05/14] dp-packet: Fix data_len handling multi-seg mbufs.
When a dp_packet is from a DPDK source, and it contains multi-segment mbufs, the data_len is not equal to the packet size, pkt_len. Instead, the data_len of each mbuf in the chain should be considered while distributing the new (provided) size. To account for the above dp_packet_set_size() has been changed so that, in the multi-segment mbufs case, only the data_len on the last mbuf of the chain and the total size of the packet, pkt_len, are changed. The data_len on the intermediate mbufs preceeding the last mbuf is not changed by dp_packet_set_size(). Furthermore, in some cases dp_packet_set_size() may be used to set a smaller size than the current packet size, thus effectively trimming the end of the packet. In the multi-segment mbufs case this may lead to lingering mbufs that may need freeing. __dp_packet_set_data() now also updates an mbufs' data_len after setting the data offset. This is so that both fields are always in sync for each mbuf in a chain. Co-authored-by: Michael Qiu Co-authored-by: Mark Kavanagh Co-authored-by: Przemyslaw Lal Co-authored-by: Marcin Ksiadz Co-authored-by: Yuanhan Liu Signed-off-by: Michael Qiu Signed-off-by: Mark Kavanagh Signed-off-by: Przemyslaw Lal Signed-off-by: Marcin Ksiadz Signed-off-by: Yuanhan Liu Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.h | 76 - 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 6376039..d2803af 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -429,17 +429,49 @@ dp_packet_size(const struct dp_packet *b) static inline void dp_packet_set_size(struct dp_packet *b, uint32_t v) { -/* netdev-dpdk does not currently support segmentation; consequently, for - * all intents and purposes, 'data_len' (16 bit) and 'pkt_len' (32 bit) may - * be used interchangably. - * - * On the datapath, it is expected that the size of packets - * (and thus 'v') will always be <= UINT16_MAX; this means that there is no - * loss of accuracy in assigning 'v' to 'data_len'. - */ -b->mbuf.data_len = (uint16_t)v; /* Current seg length. */ -b->mbuf.pkt_len = v; /* Total length of all segments linked to - * this segment. */ +if (b->source == DPBUF_DPDK) { +struct rte_mbuf *mbuf = >mbuf; +uint16_t new_len = v; +uint16_t data_len; +uint16_t nb_segs = 0; +uint16_t pkt_len = 0; + +/* Trim 'v' length bytes from the end of the chained buffers, freeing + any buffers that may be left floating */ +while (mbuf) { +data_len = MIN(new_len, mbuf->data_len); +mbuf->data_len = data_len; + +if (new_len - data_len <= 0) { +/* Free the rest of chained mbufs */ +free_dpdk_buf(CONTAINER_OF(mbuf->next, struct dp_packet, + mbuf)); +mbuf->next = NULL; +} else if (!mbuf->next) { +/* Don't assign more than what we have available */ +mbuf->data_len = MIN(new_len, + mbuf->buf_len - mbuf->data_off); +} + +new_len -= data_len; +nb_segs += 1; +pkt_len += mbuf->data_len; +mbuf = mbuf->next; +} + +/* pkt_len != v would effectively mean that pkt_len < than 'v' (as + * being bigger is logically impossible). Being < than 'v' would mean + * the 'v' provided was bigger than the available room, which is the + * responsibility of the caller to make sure there is enough room */ +ovs_assert(pkt_len == v); + +b->mbuf.nb_segs = nb_segs; +b->mbuf.pkt_len = pkt_len; +} else { +b->mbuf.data_len = v; +/* Total length of all segments linked to this segment. */ +b->mbuf.pkt_len = v; +} } static inline uint16_t @@ -451,7 +483,27 @@ __packet_data(const struct dp_packet *b) static inline void __packet_set_data(struct dp_packet *b, uint16_t v) { -b->mbuf.data_off = v; +if (b->source == DPBUF_DPDK) { +/* Moving data_off away from the first mbuf in the chain is not a + * possibility using DPBUF_DPDK dp_packets */ +ovs_assert(v == UINT16_MAX || v <= b->mbuf.buf_len); + +uint16_t prev_ofs = b->mbuf.data_off; +b->mbuf.data_off = v; +int16_t ofs_diff = prev_ofs - b->mbuf.data_off; + +/* When dealing with DPDK mbufs, keep data_off and data_len in sync. + * Thus, update data_len if the length changes with the move of + * data_off. However, if data_len is 0, there's no data to move and + * data_len should remain 0. */ + +if (b->mbuf.data_len != 0) { +b->mbuf.data_len = MIN(b->mbuf.data_len + ofs_diff, + b->mbuf.buf_len -
[ovs-dev] [PATCH v5 04/14] netdev-dpdk: Serialise non-pmds mbufs' alloc/free.
A new mutex, 'nonpmd_mp_mutex', has been introduced to serialise allocation and free operations by non-pmd threads on a given mempool. free_dpdk_buf() has been modified to make use of the introduced mutex. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/netdev-dpdk.c | 35 --- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 15d5479..bf68850 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -322,6 +322,16 @@ static struct ovs_mutex dpdk_mp_mutex OVS_ACQ_AFTER(dpdk_mutex) static struct ovs_list dpdk_mp_list OVS_GUARDED_BY(dpdk_mp_mutex) = OVS_LIST_INITIALIZER(_mp_list); +/* This mutex must be used by non pmd threads when allocating or freeing + * mbufs through mempools, when outside of the `non_pmd_mutex` mutex, in struct + * dp_netdev. + * The reason, as pointed out in the "Known Issues" section in DPDK's EAL docs, + * is that the implementation on which mempool is based off is non-preemptable. + * Since non-pmds may end up not being pinned this could lead to the preemption + * between non-pmds performing operations on the same mempool, which could lead + * to memory corruption. */ +static struct ovs_mutex nonpmd_mp_mutex = OVS_MUTEX_INITIALIZER; + struct dpdk_mp { struct rte_mempool *mp; int mtu; @@ -492,6 +502,8 @@ struct netdev_rxq_dpdk { dpdk_port_t port_id; }; +static bool dpdk_thread_is_pmd(void); + static void netdev_dpdk_destruct(struct netdev *netdev); static void netdev_dpdk_vhost_destruct(struct netdev *netdev); @@ -525,6 +537,12 @@ dpdk_buf_size(int mtu) NETDEV_DPDK_MBUF_ALIGN); } +static bool +dpdk_thread_is_pmd(void) +{ + return rte_lcore_id() != NON_PMD_CORE_ID; +} + /* Allocates an area of 'sz' bytes from DPDK. The memory is zero'ed. * * Unlike xmalloc(), this function can return NULL on failure. */ @@ -535,11 +553,22 @@ dpdk_rte_mzalloc(size_t sz) } void -free_dpdk_buf(struct dp_packet *p) +free_dpdk_buf(struct dp_packet *packet) { -struct rte_mbuf *pkt = (struct rte_mbuf *) p; +/* If non-pmd we need to lock on nonpmd_mp_mutex mutex */ +if (!dpdk_thread_is_pmd()) { +ovs_mutex_lock(_mp_mutex); + +rte_pktmbuf_free(>mbuf); -rte_pktmbuf_free(pkt); +ovs_mutex_unlock(_mp_mutex); + +return; +} + +rte_pktmbuf_free(>mbuf); + +return; } static void -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 02/14] dp-packet: Init specific mbuf fields.
From: Mark Kavanagh dp_packets are created using xmalloc(); in the case of OvS-DPDK, it's possible the the resultant mbuf portion of the dp_packet contains random data. For some mbuf fields, specifically those related to multi-segment mbufs and/or offload features, random values may cause unexpected behaviour, should the dp_packet's contents be later copied to a DPDK mbuf. It is critical therefore, that these fields should be initialized to 0. This patch ensures that the following mbuf fields are initialized to appropriate values on creation of a new dp_packet: - ol_flags=0 - nb_segs=1 - tx_offload=0 - packet_type=0 - next=NULL Adapted from an idea by Michael Qiu : https://patchwork.ozlabs.org/patch/777570/ Co-authored-by: Tiago Lam Signed-off-by: Mark Kavanagh Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/dp-packet.h b/lib/dp-packet.h index ba91e58..b948fe1 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -625,14 +625,15 @@ dp_packet_mbuf_rss_flag_reset(struct dp_packet *p OVS_UNUSED) } /* This initialization is needed for packets that do not come - * from DPDK interfaces, when vswitchd is built with --with-dpdk. - * The DPDK rte library will still otherwise manage the mbuf. - * We only need to initialize the mbuf ol_flags. */ + * from DPDK interfaces, when vswitchd is built with --with-dpdk. */ static inline void dp_packet_mbuf_init(struct dp_packet *p OVS_UNUSED) { #ifdef DPDK_NETDEV -p->mbuf.ol_flags = 0; +struct rte_mbuf *mbuf = &(p->mbuf); +mbuf->ol_flags = mbuf->tx_offload = mbuf->packet_type = 0; +mbuf->nb_segs = 1; +mbuf->next = NULL; #endif } -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 03/14] dp-packet: Fix allocated size on DPDK init.
When enabled with DPDK OvS deals with two types of packets, the ones coming from the mempool and the ones locally created by OvS - which are copied to mempool mbufs before output. In the latter, the space is allocated from the system, while in the former the mbufs are allocated from a mempool, which takes care of initialising them appropriately. In the current implementation, during mempool's initialisation of mbufs, dp_packet_set_allocated() is called from dp_packet_init_dpdk() without considering that the allocated space, in the case of multi-segment mbufs, might be greater than a single mbuf. Furthermore, given that dp_packet_init_dpdk() is on the code path that's called upon mempool's initialisation, a call to dp_packet_set_allocated() is redundant, since mempool takes care of initialising it. To fix this, dp_packet_set_allocated() is no longer called after initialisation of a mempool, only in dp_packet_init__(), which is still called by OvS when initialising locally created packets. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/dp-packet.c | 3 +-- lib/dp-packet.h | 2 +- lib/netdev-dpdk.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 443c225..782e7c2 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -99,9 +99,8 @@ dp_packet_use_const(struct dp_packet *b, const void *data, size_t size) * buffer. Here, non-transient ovs dp-packet fields are initialized for * packets that are part of a DPDK memory pool. */ void -dp_packet_init_dpdk(struct dp_packet *b, size_t allocated) +dp_packet_init_dpdk(struct dp_packet *b) { -dp_packet_set_allocated(b, allocated); b->source = DPBUF_DPDK; } diff --git a/lib/dp-packet.h b/lib/dp-packet.h index b948fe1..6376039 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -114,7 +114,7 @@ void dp_packet_use(struct dp_packet *, void *, size_t); void dp_packet_use_stub(struct dp_packet *, void *, size_t); void dp_packet_use_const(struct dp_packet *, const void *, size_t); -void dp_packet_init_dpdk(struct dp_packet *, size_t allocated); +void dp_packet_init_dpdk(struct dp_packet *); void dp_packet_init(struct dp_packet *, size_t); void dp_packet_uninit(struct dp_packet *); diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 949b87b..15d5479 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -550,7 +550,7 @@ ovs_rte_pktmbuf_init(struct rte_mempool *mp OVS_UNUSED, { struct rte_mbuf *pkt = _p; -dp_packet_init_dpdk((struct dp_packet *) pkt, pkt->buf_len); +dp_packet_init_dpdk((struct dp_packet *) pkt); } static int -- 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH v5 01/14] netdev-dpdk: fix mbuf sizing
From: Mark Kavanagh There are numerous factors that must be considered when calculating the size of an mbuf: - the data portion of the mbuf must be sized in accordance With Rx buffer alignment (typically 1024B). So, for example, in order to successfully receive and capture a 1500B packet, mbufs with a data portion of size 2048B must be used. - in OvS, the elements that comprise an mbuf are: * the dp packet, which includes a struct rte mbuf (704B) * RTE_PKTMBUF_HEADROOM (128B) * packet data (aligned to 1k, as previously described) * RTE_PKTMBUF_TAILROOM (typically 0) Some PMDs require that the total mbuf size (i.e. the total sum of all of the above-listed components' lengths) is cache-aligned. To satisfy this requirement, it may be necessary to round up the total mbuf size with respect to cacheline size. In doing so, it's possible that the dp_packet's data portion is inadvertently increased in size, such that it no longer adheres to Rx buffer alignment. Consequently, the following property of the mbuf no longer holds true: mbuf.data_len == mbuf.buf_len - mbuf.data_off This creates a problem in the case of multi-segment mbufs, where that assumption is assumed to be true for all but the final segment in an mbuf chain. Resolve this issue by adjusting the size of the mbuf's private data portion, as opposed to the packet data portion when aligning mbuf size to cachelines. Fixes: 4be4d22 ("netdev-dpdk: clean up mbuf initialization") Fixes: 31b88c9 ("netdev-dpdk: round up mbuf_size to cache_line_size") CC: Santosh Shukla Signed-off-by: Mark Kavanagh Acked-by: Santosh Shukla Acked-by: Eelco Chaudron --- lib/netdev-dpdk.c | 56 +-- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index bb4d60f..949b87b 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -88,10 +88,6 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); #define MTU_TO_MAX_FRAME_LEN(mtu) ((mtu) + ETHER_HDR_MAX_LEN) #define FRAME_LEN_TO_MTU(frame_len) ((frame_len)\ - ETHER_HDR_LEN - ETHER_CRC_LEN) -#define MBUF_SIZE(mtu) ROUND_UP((MTU_TO_MAX_FRAME_LEN(mtu) \ - + sizeof(struct dp_packet) \ - + RTE_PKTMBUF_HEADROOM), \ - RTE_CACHE_LINE_SIZE) #define NETDEV_DPDK_MBUF_ALIGN 1024 #define NETDEV_DPDK_MAX_PKT_LEN 9728 @@ -637,7 +633,11 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) char mp_name[RTE_MEMPOOL_NAMESIZE]; const char *netdev_name = netdev_get_name(>up); int socket_id = dev->requested_socket_id; -uint32_t n_mbufs; +uint32_t n_mbufs = 0; +uint32_t mbuf_size = 0; +uint32_t aligned_mbuf_size = 0; +uint32_t mbuf_priv_data_len = 0; +uint32_t pkt_size = 0; uint32_t hash = hash_string(netdev_name, 0); struct dpdk_mp *dmp = NULL; int ret; @@ -650,6 +650,9 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) dmp->mtu = mtu; dmp->refcount = 1; +/* Get the size of each mbuf, based on the MTU */ +mbuf_size = dpdk_buf_size(dev->requested_mtu); + n_mbufs = dpdk_calculate_mbufs(dev, mtu, per_port_mp); do { @@ -661,8 +664,8 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) * so this is not an issue for tasks such as debugging. */ ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, - "ovs%08x%02d%05d%07u", - hash, socket_id, mtu, n_mbufs); + "ovs%08x%02d%05d%07u", +hash, socket_id, mtu, n_mbufs); if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) { VLOG_DBG("snprintf returned %d. " "Failed to generate a mempool name for \"%s\". " @@ -671,17 +674,34 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) break; } -VLOG_DBG("Port %s: Requesting a mempool of %u mbufs " - "on socket %d for %d Rx and %d Tx queues.", - netdev_name, n_mbufs, socket_id, - dev->requested_n_rxq, dev->requested_n_txq); - -dmp->mp = rte_pktmbuf_pool_create(mp_name, n_mbufs, - MP_CACHE_SZ, - sizeof (struct dp_packet) - - sizeof (struct rte_mbuf), - MBUF_SIZE(mtu) - - sizeof(struct dp_packet), +VLOG_DBG("Port %s: Requesting a mempool of %u mbufs of size %u " + "on socket %d for %d Rx and %d Tx queues, " + "cache line size of %u", + netdev_name, n_mbufs,
[ovs-dev] [PATCH v5 00/14] Support multi-segment mbufs
Overview This patchset introduces support for multi-segment mbufs to OvS-DPDK. Multi-segment mbufs are typically used when the size of an mbuf is insufficient to contain the entirety of a packet's data. Instead, the data is split across numerous mbufs, each carrying a portion, or 'segment', of the packet data. mbufs are chained via their 'next' attribute (an mbuf pointer). Use Cases = i. Handling oversized (guest-originated) frames, which are marked for hardware accelration/offload (TSO, for example). Packets which originate from a non-DPDK source may be marked for offload; as such, they may be larger than the permitted ingress interface's MTU, and may be stored in an oversized dp-packet. In order to transmit such packets over a DPDK port, their contents must be copied to a DPDK mbuf (via dpdk_do_tx_copy). However, in its current implementation, that function only copies data into a single mbuf; if the space available in the mbuf is exhausted, but not all packet data has been copied, then it is lost. Similarly, when cloning a DPDK mbuf, it must be considered whether that mbuf contains multiple segments. Both issues are resolved within this patchset. ii. Handling jumbo frames. While OvS already supports jumbo frames, it does so by increasing mbuf size, such that the entirety of a jumbo frame may be handled in a single mbuf. This is certainly the preferred, and most performant approach (and remains the default). Enabling multi-segment mbufs Multi-segment and single-segment mbufs are mutually exclusive, and the user must decide on which approach to adopt on init. The introduction of a new OVSDB field, 'dpdk-multi-seg-mbufs', facilitates this. This is a global boolean value, which determines how jumbo frames are represented across all DPDK ports. In the absence of a user-supplied value, 'dpdk-multi-seg-mbufs' defaults to false, i.e. multi-segment mbufs must be explicitly enabled / single-segment mbufs remain the default. Setting the field is identical to setting existing DPDK-specific OVSDB fields: ovs-vsctl set Open_vSwitch . other_config:dpdk-init=true ovs-vsctl set Open_vSwitch . other_config:dpdk-lcore-mask=0x10 ovs-vsctl set Open_vSwitch . other_config:dpdk-socket-mem=4096,0 ==> ovs-vsctl set Open_vSwitch . other_config:dpdk-multi-seg-mbufs=true Performance notes (based on v8) = In order to test for regressions in performance, tests were run on top of master 88125d6 and v8 of this patchset, both with the multi-segment mbufs option enabled and disabled. VSperf was used to run the phy2phy_cont and pvp_cont tests with varying packet sizes of 64B, 1500B and 7000B, on a 10Gbps interface. Test | Size | Master | Multi-seg disabled | Multi-seg enabled - p2p | 64 | ~22.7 | ~22.65| ~18.3 p2p | 1500 | ~1.6 |~1.6|~1.6 p2p | 7000 | ~0.36 | ~0.36| ~0.36 pvp | 64 | ~6.7 |~6.7|~6.3 pvp | 1500 | ~1.6 |~1.6|~1.6 pvp | 7000 | ~0.36 | ~0.36| ~0.36 Packet size is in bytes, while all packet rates are reported in mpps (aggregated). No noticeable regression has been observed (certainly everything is within the ± 5% margin of existing performance), aside from the 64B packet size case when multi-segment mbuf is enabled. This is expected, however, because of how Tx vectoriszed functions are incompatible with multi-segment mbufs on some PMDs. The PMD under use during these tests was the i40e (on a Intel X710 NIC), which indeed doesn't support vectorized Tx functions with multi-segment mbufs. --- v5: - Rebase on master 030958a0cc ("conntrack: Fix conn_update_state_alg use after free."); - Address Eelco's comments: - Remove dpdk_mp_sweep() call in netdev_dpdk_mempool_configure(), a leftover from rebase. Only call should be in dpdk_mp_get(); - Remove NEWS line added by mistake during rebase (about adding experimental vhost zero copy support). - Address Ian's comments: - Drop patch 01 from previous series entirely; - Patch (now) 01/14 adds a new call to dpdk_buf_size() inside dpdk_mp_create() to get the correct "mbuf_size" to be used; - Patch (now) 11/14 modifies dpdk_mp_create() to check if multi-segment mbufs is enabled, in which case it calculates the new "mbuf_size" to be used; - In free_dpdk_buf() and dpdk_buf_alloc(), don't lock and unlock conditionally. - Add "per-port-memory=true" to test "Multi-segment mbufs Tx" as the current DPDK set up in system-dpdk-testsuite can't handle higher MTU sizes using the shared mempool model (runs out of memory); - Add new examples for when multi-segment mbufs are enabled in topics/dpdk/memory.rst, and a reference to
[ovs-dev] [PATCH] ovn-controller: Use ovsdb index for mac-binding update.
Signed-off-by: Han Zhou --- ovn/controller/ovn-controller.c | 6 - ovn/controller/pinctrl.c| 54 - ovn/controller/pinctrl.h| 3 +-- 3 files changed, 43 insertions(+), 20 deletions(-) diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 6ee72a9..b071801 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -607,6 +607,10 @@ main(int argc, char *argv[]) struct ovsdb_idl_index *sbrec_datapath_binding_by_key = ovsdb_idl_index_create1(ovnsb_idl_loop.idl, _datapath_binding_col_tunnel_key); +struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip += ovsdb_idl_index_create2(ovnsb_idl_loop.idl, + _mac_binding_col_logical_port, + _mac_binding_col_ip); ovsdb_idl_omit_alert(ovnsb_idl_loop.idl, _chassis_col_nb_cfg); update_sb_monitors(ovnsb_idl_loop.idl, NULL, NULL, NULL); @@ -715,8 +719,8 @@ main(int argc, char *argv[]) sbrec_port_binding_by_datapath, sbrec_port_binding_by_key, sbrec_port_binding_by_name, +sbrec_mac_binding_by_lport_ip, sbrec_dns_table_get(ovnsb_idl_loop.idl), -sbrec_mac_binding_table_get(ovnsb_idl_loop.idl), br_int, chassis, _datapaths, _tunnels); update_ct_zones(_lports, _datapaths, _zones, diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index a0bf602..0164696 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -70,7 +70,7 @@ static void run_put_mac_bindings( struct ovsdb_idl_txn *ovnsb_idl_txn, struct ovsdb_idl_index *sbrec_datapath_binding_by_key, struct ovsdb_idl_index *sbrec_port_binding_by_key, -const struct sbrec_mac_binding_table *); +struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip); static void wait_put_mac_bindings(struct ovsdb_idl_txn *ovnsb_idl_txn); static void flush_put_mac_bindings(void); @@ -1251,8 +1251,8 @@ pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn, struct ovsdb_idl_index *sbrec_port_binding_by_datapath, struct ovsdb_idl_index *sbrec_port_binding_by_key, struct ovsdb_idl_index *sbrec_port_binding_by_name, +struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, const struct sbrec_dns_table *dns_table, -const struct sbrec_mac_binding_table *mac_binding_table, const struct ovsrec_bridge *br_int, const struct sbrec_chassis *chassis, const struct hmap *local_datapaths, @@ -1293,7 +1293,8 @@ pinctrl_run(struct ovsdb_idl_txn *ovnsb_idl_txn, } run_put_mac_bindings(ovnsb_idl_txn, sbrec_datapath_binding_by_key, - sbrec_port_binding_by_key, mac_binding_table); + sbrec_port_binding_by_key, + sbrec_mac_binding_by_lport_ip); send_garp_run(sbrec_chassis_by_name, sbrec_port_binding_by_datapath, sbrec_port_binding_by_name, br_int, chassis, local_datapaths, active_tunnels); @@ -1702,11 +1703,30 @@ pinctrl_handle_put_mac_binding(const struct flow *md, pmb->mac = headers->dl_src; } +static const struct sbrec_mac_binding * +mac_binding_lookup(struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, + const char *logical_port, + const char *ip) +{ +struct sbrec_mac_binding *mb = sbrec_mac_binding_index_init_row( +sbrec_mac_binding_by_lport_ip); +sbrec_mac_binding_index_set_logical_port(mb, logical_port); +sbrec_mac_binding_index_set_ip(mb, ip); + +const struct sbrec_mac_binding *retval += sbrec_mac_binding_index_find(sbrec_mac_binding_by_lport_ip, + mb); + +sbrec_mac_binding_index_destroy_row(mb); + +return retval; +} + static void run_put_mac_binding(struct ovsdb_idl_txn *ovnsb_idl_txn, struct ovsdb_idl_index *sbrec_datapath_binding_by_key, struct ovsdb_idl_index *sbrec_port_binding_by_key, -const struct sbrec_mac_binding_table *mac_binding_table, +struct ovsdb_idl_index *sbrec_mac_binding_by_lport_ip, const struct put_mac_binding *pmb) { if (time_msec() > pmb->timestamp + 1000) { @@ -1730,19 +1750,17 @@ run_put_mac_binding(struct ovsdb_idl_txn *ovnsb_idl_txn, snprintf(mac_string, sizeof mac_string, ETH_ADDR_FMT, ETH_ADDR_ARGS(pmb->mac)); -/* Check for an update an existing IP-MAC binding for this logical +/* Check for and update an existing IP-MAC binding for this logical * port. - * - * XXX This is not very efficient. */ -const struct
Re: [ovs-dev] ovs-vswitchd 2.4.1 scale >10K add/delete flows 100% cpu
On Tue, Jul 10, 2018 at 2:07 PM Ben Pfaff wrote: > On Thu, Jul 05, 2018 at 01:44:33PM -0700, Ravi Kerur wrote: > > During scale flow add/delete (>10K), I am seeing ovs-vswitchd cpu usage > > spike to 100% and stay there without any sign of returning to normal cpu > > usage. It's normal OVS 2.4.1 and no DPDK involved. I am trying to get > > 'perf' working which might help in isolating the problem. In the > meantime I > > would like to understand following things > > > > (1) Recommended system configuration i.e. core allocation, memory, > > hugepages, ... > > (2) Published scale numbers for 2.4.1 > > (3) Known performance issues with 2.4.1 > > (4) Debugs to collect > > 2.4.x is really old. It was released in 2015. I doubt anyone is going > to be able to help you with it. > Thanks for the information. We are using OF1.3, (10K) Add/Delete come into OVS as a individual flowmod. Currently I have three versions in our lab (1) OVS 2.4.1 -- issue is seen, I am still trying to get 'perf' running on that system. Once I have it running I will post more details. (2) OVS 2.5.x -- Using this version with DPDK for other things (3) OVS 2.9.90 -- Currently testing for vhost-virtio functionality Do you think OVS 2.5.x might be better suited for large number of individual flowmods or you recommend 2.9.90? ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, PATCHv3] datapath: work around the single GRE receive limitation.
Bleep bloop. Greetings William Tu, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. checkpatch: ERROR: Too many signoffs; are you missing Co-authored-by lines? Lines checked: 149, Warnings: 0, Errors: 1 Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCHv3] datapath: work around the single GRE receive limitation.
On Wed, Jul 11, 2018 at 09:45:08AM -0700, William Tu wrote: > Commit 9f57c67c379d ("gre: Remove support for sharing GRE protocol hook") > allows only single GRE packet receiver. When upstream kernel's gre module > is loaded, the gre.ko exclusively becomes the only gre packet receiver, > preventing OVS kernel module from registering another gre receiver. > > We can either try to unload the gre.ko by removing its dependencies, > or, in this patch, we try to register OVS as only the GRE transmit > portion when detecting there already exists another GRE receiver. > > Signed-off-by: William Tu > Tested-by: Greg Rose > Reviewed-by: Greg Rose > Cc: Greg Rose > Cc: Yifeng Sun > --- > v1->v2: improve warnning message Applied to master. Thanks William (and everyone who reviewed and tested)! ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] bot suggestion (was: Re: [ovs-dev,v1; ,branch,2.8] conntrack: Fix conn_update_state_alg use after free.)
The bot couldn't apply this patch presumably because it tried to apply it against master. Maybe the bot should notice version numbers in [] in subject lines and try against that branch. Thanks, Ben. On Wed, Jul 11, 2018 at 11:59:24AM -0400, 0-day Robot wrote: > Bleep bloop. Greetings Darrell Ball, I am a robot and I have tried out your > patch. > Thanks for your contribution. > > I encountered some error that I wasn't expecting. See the details below. > > > git-am: > Failed to merge in the changes. > Patch failed at 0001 conntrack: Fix conn_update_state_alg use after free. > The copy of the patch that failed is found in: > > /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch > When you have resolved this problem, run "git am --resolved". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am --abort". > > > Please check this out. If you feel there has been an error, please email > acon...@bytheb.org > > Thanks, > 0-day Robot > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 1/2] ovs python: ovs.stream.open_block() returns success even if the remote is unreachable
On Wed, Jul 11, 2018 at 12:37:28PM +0530, Numan Siddique wrote: > On Wed, Jul 11, 2018 at 2:08 AM Ben Pfaff wrote: > > > On Wed, Jul 11, 2018 at 12:56:39AM +0530, nusid...@redhat.com wrote: > > > From: Numan Siddique > > > > > > The python function ovs.socket_util.check_connection_completion() uses > > select() > > > (provided by python) to monitor the socket file descriptor. The select() > > > returns 1 when the file descriptor becomes ready. For error cases like - > > > 111 (Connection refused) and 113 (No route to host) (POLLERR), > > ovs.poller._SelectSelect.poll() > > > expects the exceptfds list to be set by select(). But that is not the > > case. > > > As per the select() man page, writefds list will be set for POLLERR. > > > Please see "Correspondence between select() and poll() notifications" > > section of select(2) > > > man page. > > > > > > Because of this behavior, ovs.socket_util.check_connection_completion() > > returns success > > > even if the remote is unreachable or not listening on the port. > > > > > > This patch fixes this issue by adding a wrapper function - > > check_connection_completion_status() > > > which calls sock.connect_ex() to get the status of the connection if > > > ovs.socket_util.check_connection_completion() returns success. > > > > > > The test cases added fails without the fix in this patch. > > > > > > Signed-off-by: Numan Siddique > > > > Can we just code check_connection_completion() like we do in C, by > > directly using select() on Windows and poll() everywhere else? The > > approach in this patch seems a little indirect to me. > > > > > Thanks for the review. As per the comments here - > https://github.com/openvswitch/ovs/blob/master/python/ovs/poller.py#L51 > * > # eventlet/gevent doesn't support select.poll. If select.poll is used, > # python interpreter is blocked as a whole instead of switching from the > # current thread that is about to block to other runnable thread. > # So emulate select.poll by select.select because using python means that > # performance isn't so important. > *** > > we cannot use poll() in python. I tried with this patch to test it out - > https://paste.fedoraproject.org/paste/YUhgVte-BOjgid-ojmHZJw > All the ovs python idl tests pass. But it doesn't work with openstack > networking-ovn. The whole neutron-server process just blocks. > > I don't see any other way for python. Once select() returns we have to use > some mechanism to get the error code. > Does calling sock.connect_ex() bother you ? I don't mean to change what poller.py does. I mean to implement ovs.socket_util.check_connection_completion in terms of select.poll and select.select directly. The comment in python/ovs/poller.py should not be relevant because the use of select.poll in check_connection_completion would never block (it would use a timeout of 0). Thanks, Ben. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev, v2, branch, 2.8] conntrack: Fix use after free for FTP control case.
Bleep bloop. Greetings Darrell Ball, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. git-am: Failed to merge in the changes. Patch failed at 0001 conntrack: Fix use after free for FTP control case. The copy of the patch that failed is found in: /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch When you have resolved this problem, run "git am --resolved". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCHv3] datapath: work around the single GRE receive limitation.
Commit 9f57c67c379d ("gre: Remove support for sharing GRE protocol hook") allows only single GRE packet receiver. When upstream kernel's gre module is loaded, the gre.ko exclusively becomes the only gre packet receiver, preventing OVS kernel module from registering another gre receiver. We can either try to unload the gre.ko by removing its dependencies, or, in this patch, we try to register OVS as only the GRE transmit portion when detecting there already exists another GRE receiver. Signed-off-by: William Tu Tested-by: Greg Rose Reviewed-by: Greg Rose Cc: Greg Rose Cc: Yifeng Sun --- v1->v2: improve warnning message --- datapath/linux/compat/ip_gre.c | 60 +- datapath/vport.c | 12 ++--- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index 92de70127189..1ab798164894 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -71,6 +71,7 @@ static void erspan_build_header(struct sk_buff *skb, bool truncate, bool is_ipv4); static struct rtnl_link_ops ipgre_link_ops __read_mostly; +static bool ip_gre_loaded = false; #define ip_gre_calc_hlen rpl_ip_gre_calc_hlen static int ip_gre_calc_hlen(__be16 o_flags) @@ -1640,25 +1641,57 @@ int rpl_ipgre_init(void) int err; err = register_pernet_device(_tap_net_ops); - if (err < 0) - goto pnet_tap_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_tap_failed; + } err = register_pernet_device(_net_ops); - if (err < 0) - goto pnet_erspan_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_erspan_failed; + } err = register_pernet_device(_net_ops); - if (err < 0) - goto pnet_ipgre_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_ipgre_failed; + } err = gre_add_protocol(_protocol, GREPROTO_CISCO); if (err < 0) { pr_info("%s: can't add protocol\n", __func__); - goto add_proto_failed; + if (err == -EBUSY) { + goto ip_gre_loaded; + } else { + goto add_proto_failed; + } } pr_info("GRE over IPv4 tunneling driver\n"); - + ovs_vport_ops_register(_ipgre_vport_ops); + ovs_vport_ops_register(_erspan_vport_ops); + return 0; + +ip_gre_loaded: + /* Since GRE only allows single receiver to be registerd, +* we skip here so only gre transmit works, see: +* +* commit 9f57c67c379d88a10e8ad676426fee5ae7341b14 +* Author: Pravin B Shelar +* Date: Fri Aug 7 23:51:52 2015 -0700 +* gre: Remove support for sharing GRE protocol hook +* +* OVS GRE receive part is disabled. +*/ + pr_info("GRE TX only over IPv4 tunneling driver\n"); + ip_gre_loaded = true; ovs_vport_ops_register(_ipgre_vport_ops); ovs_vport_ops_register(_erspan_vport_ops); return 0; @@ -1678,10 +1711,13 @@ void rpl_ipgre_fini(void) { ovs_vport_ops_unregister(_erspan_vport_ops); ovs_vport_ops_unregister(_ipgre_vport_ops); - gre_del_protocol(_protocol, GREPROTO_CISCO); - unregister_pernet_device(_net_ops); - unregister_pernet_device(_net_ops); - unregister_pernet_device(_tap_net_ops); + + if (!ip_gre_loaded) { + gre_del_protocol(_protocol, GREPROTO_CISCO); + unregister_pernet_device(_net_ops); + unregister_pernet_device(_net_ops); + unregister_pernet_device(_tap_net_ops); + } } #endif diff --git a/datapath/vport.c b/datapath/vport.c index 02f6b56d3243..28ddb865c3a2 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -66,11 +66,15 @@ int ovs_vport_init(void) if (err) goto err_lisp; err = gre_init(); - if (err && err != -EEXIST) + if (err && err != -EEXIST) { goto err_gre; - else if (err == -EEXIST) - pr_warn("Cannot take GRE protocol entry - The ERSPAN feature may not be supported\n"); - else { + } else { + if (err == -EEXIST) { + pr_warn("Cannot take GRE protocol rx entry"\ + "- The GRE/ERSPAN rx feature not supported\n"); + /* continue GRE tx */ + } + err = ipgre_init(); if (err && err != -EEXIST) goto err_ipgre; --
Re: [ovs-dev] [PATCHv2] datapath: work around the single GRE receive limitation.
On 7/11/2018 9:24 AM, William Tu wrote: Commit 9f57c67c379d ("gre: Remove support for sharing GRE protocol hook") allows only single GRE packet receiver. When upstream kernel's gre module is loaded, the gre.ko exclusively becomes the only gre packet receiver, preventing OVS kernel module from registering another gre receiver. We can either try to unload the gre.ko by removing its dependencies, or, in this patch, we try to register OVS as only the GRE transmit portion when detecting there already exists another GRE receiver. Signed-off-by: William Tu Cc: Greg Rose Cc: Yifeng Sun You can go ahead and add my Tested-by and Reviewed-by tags. Thanks, - Greg --- v1->v2: improve warnning message --- datapath/linux/compat/ip_gre.c | 60 +- datapath/vport.c | 12 ++--- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index 92de70127189..1ab798164894 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -71,6 +71,7 @@ static void erspan_build_header(struct sk_buff *skb, bool truncate, bool is_ipv4); static struct rtnl_link_ops ipgre_link_ops __read_mostly; +static bool ip_gre_loaded = false; #define ip_gre_calc_hlen rpl_ip_gre_calc_hlen static int ip_gre_calc_hlen(__be16 o_flags) @@ -1640,25 +1641,57 @@ int rpl_ipgre_init(void) int err; err = register_pernet_device(_tap_net_ops); - if (err < 0) - goto pnet_tap_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_tap_failed; + } err = register_pernet_device(_net_ops); - if (err < 0) - goto pnet_erspan_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_erspan_failed; + } err = register_pernet_device(_net_ops); - if (err < 0) - goto pnet_ipgre_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_ipgre_failed; + } err = gre_add_protocol(_protocol, GREPROTO_CISCO); if (err < 0) { pr_info("%s: can't add protocol\n", __func__); - goto add_proto_failed; + if (err == -EBUSY) { + goto ip_gre_loaded; + } else { + goto add_proto_failed; + } } pr_info("GRE over IPv4 tunneling driver\n"); - + ovs_vport_ops_register(_ipgre_vport_ops); + ovs_vport_ops_register(_erspan_vport_ops); + return 0; + +ip_gre_loaded: + /* Since GRE only allows single receiver to be registerd, +* we skip here so only gre transmit works, see: +* +* commit 9f57c67c379d88a10e8ad676426fee5ae7341b14 +* Author: Pravin B Shelar +* Date: Fri Aug 7 23:51:52 2015 -0700 +* gre: Remove support for sharing GRE protocol hook +* +* OVS GRE receive part is disabled. +*/ + pr_info("GRE TX only over IPv4 tunneling driver\n"); + ip_gre_loaded = true; ovs_vport_ops_register(_ipgre_vport_ops); ovs_vport_ops_register(_erspan_vport_ops); return 0; @@ -1678,10 +1711,13 @@ void rpl_ipgre_fini(void) { ovs_vport_ops_unregister(_erspan_vport_ops); ovs_vport_ops_unregister(_ipgre_vport_ops); - gre_del_protocol(_protocol, GREPROTO_CISCO); - unregister_pernet_device(_net_ops); - unregister_pernet_device(_net_ops); - unregister_pernet_device(_tap_net_ops); + + if (!ip_gre_loaded) { + gre_del_protocol(_protocol, GREPROTO_CISCO); + unregister_pernet_device(_net_ops); + unregister_pernet_device(_net_ops); + unregister_pernet_device(_tap_net_ops); + } } #endif diff --git a/datapath/vport.c b/datapath/vport.c index 02f6b56d3243..28ddb865c3a2 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -66,11 +66,15 @@ int ovs_vport_init(void) if (err) goto err_lisp; err = gre_init(); - if (err && err != -EEXIST) + if (err && err != -EEXIST) { goto err_gre; - else if (err == -EEXIST) - pr_warn("Cannot take GRE protocol entry - The ERSPAN feature may not be supported\n"); - else { + } else { + if (err == -EEXIST) { + pr_warn("Cannot take GRE protocol rx entry"\ + "- The GRE/ERSPAN rx feature not supported\n"); + /* continue GRE tx */ + } + err = ipgre_init();
[ovs-dev] [PATCHv2] datapath: work around the single GRE receive limitation.
Commit 9f57c67c379d ("gre: Remove support for sharing GRE protocol hook") allows only single GRE packet receiver. When upstream kernel's gre module is loaded, the gre.ko exclusively becomes the only gre packet receiver, preventing OVS kernel module from registering another gre receiver. We can either try to unload the gre.ko by removing its dependencies, or, in this patch, we try to register OVS as only the GRE transmit portion when detecting there already exists another GRE receiver. Signed-off-by: William Tu Cc: Greg Rose Cc: Yifeng Sun --- v1->v2: improve warnning message --- datapath/linux/compat/ip_gre.c | 60 +- datapath/vport.c | 12 ++--- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index 92de70127189..1ab798164894 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -71,6 +71,7 @@ static void erspan_build_header(struct sk_buff *skb, bool truncate, bool is_ipv4); static struct rtnl_link_ops ipgre_link_ops __read_mostly; +static bool ip_gre_loaded = false; #define ip_gre_calc_hlen rpl_ip_gre_calc_hlen static int ip_gre_calc_hlen(__be16 o_flags) @@ -1640,25 +1641,57 @@ int rpl_ipgre_init(void) int err; err = register_pernet_device(_tap_net_ops); - if (err < 0) - goto pnet_tap_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_tap_failed; + } err = register_pernet_device(_net_ops); - if (err < 0) - goto pnet_erspan_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_erspan_failed; + } err = register_pernet_device(_net_ops); - if (err < 0) - goto pnet_ipgre_failed; + if (err < 0) { + if (err == -EEXIST) + goto ip_gre_loaded; + else + goto pnet_ipgre_failed; + } err = gre_add_protocol(_protocol, GREPROTO_CISCO); if (err < 0) { pr_info("%s: can't add protocol\n", __func__); - goto add_proto_failed; + if (err == -EBUSY) { + goto ip_gre_loaded; + } else { + goto add_proto_failed; + } } pr_info("GRE over IPv4 tunneling driver\n"); - + ovs_vport_ops_register(_ipgre_vport_ops); + ovs_vport_ops_register(_erspan_vport_ops); + return 0; + +ip_gre_loaded: + /* Since GRE only allows single receiver to be registerd, +* we skip here so only gre transmit works, see: +* +* commit 9f57c67c379d88a10e8ad676426fee5ae7341b14 +* Author: Pravin B Shelar +* Date: Fri Aug 7 23:51:52 2015 -0700 +* gre: Remove support for sharing GRE protocol hook +* +* OVS GRE receive part is disabled. +*/ + pr_info("GRE TX only over IPv4 tunneling driver\n"); + ip_gre_loaded = true; ovs_vport_ops_register(_ipgre_vport_ops); ovs_vport_ops_register(_erspan_vport_ops); return 0; @@ -1678,10 +1711,13 @@ void rpl_ipgre_fini(void) { ovs_vport_ops_unregister(_erspan_vport_ops); ovs_vport_ops_unregister(_ipgre_vport_ops); - gre_del_protocol(_protocol, GREPROTO_CISCO); - unregister_pernet_device(_net_ops); - unregister_pernet_device(_net_ops); - unregister_pernet_device(_tap_net_ops); + + if (!ip_gre_loaded) { + gre_del_protocol(_protocol, GREPROTO_CISCO); + unregister_pernet_device(_net_ops); + unregister_pernet_device(_net_ops); + unregister_pernet_device(_tap_net_ops); + } } #endif diff --git a/datapath/vport.c b/datapath/vport.c index 02f6b56d3243..28ddb865c3a2 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -66,11 +66,15 @@ int ovs_vport_init(void) if (err) goto err_lisp; err = gre_init(); - if (err && err != -EEXIST) + if (err && err != -EEXIST) { goto err_gre; - else if (err == -EEXIST) - pr_warn("Cannot take GRE protocol entry - The ERSPAN feature may not be supported\n"); - else { + } else { + if (err == -EEXIST) { + pr_warn("Cannot take GRE protocol rx entry"\ + "- The GRE/ERSPAN rx feature not supported\n"); + /* continue GRE tx */ + } + err = ipgre_init(); if (err && err != -EEXIST) goto err_ipgre; -- 2.7.4
[ovs-dev] [patch v2 branch 2.8] conntrack: Fix use after free for FTP control case.
When conn_update_state() returns true, conn has been freed, so skip calling handle_ftp_ctl() with this conn and instead follow code path for new connections. Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") Signed-off-by: Darrell Ball --- lib/conntrack.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 6691877..08bec61 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -1135,8 +1135,11 @@ process_one(struct conntrack *ct, struct dp_packet *pkt, } else { create_new_conn = conn_update_state(ct, pkt, ctx, , now, bucket); -handle_ftp_ctl(ct, ctx, pkt, conn, now, CT_FTP_CTL_OTHER, - !!nat_action_info); + +if (!create_new_conn) { +handle_ftp_ctl(ct, ctx, pkt, conn, now, CT_FTP_CTL_OTHER, + !!nat_action_info); +} } } else { create_new_conn = conn_update_state(ct, pkt, ctx, , now, -- 1.9.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v5 2/2] tests: Fix unit test case caused by SMC cache.
Acked-by: Billy O'Mahony > -Original Message- > From: Wang, Yipeng1 > Sent: Tuesday, July 10, 2018 11:14 AM > To: d...@openvswitch.org; jan.scheur...@ericsson.com; O Mahony, Billy > > Cc: Wang, Yipeng1 ; Stokes, Ian > ; b...@ovn.org > Subject: [PATCH v5 2/2] tests: Fix unit test case caused by SMC cache. > > Test 1024 PMD - stats reported different stats data during tests because of > the > SMC data. This commit fix the test. > > Signed-off-by: Yipeng Wang > --- > tests/pmd.at | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tests/pmd.at b/tests/pmd.at index 60452f5..4cae6c8 100644 > --- a/tests/pmd.at > +++ b/tests/pmd.at > @@ -196,12 +196,13 @@ dummy@ovs-dummy: hit:0 missed:0 > p0 7/1: (dummy-pmd: configured_rx_queues=4, > configured_tx_queues=, requested_rx_queues=4, > requested_tx_queues=) > ]) > > -AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed > SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 8], [0], [dnl > +AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed > +SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 9], [0], [dnl > pmd thread numa_id core_id : >packets received: 0 >packet recirculations: 0 >avg. datapath passes per packet: 0.00 >emc hits: 0 > + smc hits: 0 >megaflow hits: 0 >avg. subtable lookups per megaflow hit: 0.00 >miss with success upcall: 0 > @@ -226,12 +227,13 @@ AT_CHECK([cat ovs-vswitchd.log | filter_flow_install > | strip_xout], [0], [dnl > recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:77,dst=50 > :54:00:00:01:78),eth_type(0x0800),ipv4(frag=no), actions: > ]) > > -AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed > SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 8], [0], [dnl > +AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed > +SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 9], [0], [dnl > pmd thread numa_id core_id : >packets received: 20 >packet recirculations: 0 >avg. datapath passes per packet: 1.00 >emc hits: 19 > + smc hits: 0 >megaflow hits: 0 >avg. subtable lookups per megaflow hit: 0.00 >miss with success upcall: 1 > -- > 2.7.4 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v5 1/2] dpif-netdev: Add SMC cache after EMC cache
Acked-by: Billy O'Mahony > -Original Message- > From: Wang, Yipeng1 > Sent: Tuesday, July 10, 2018 11:14 AM > To: d...@openvswitch.org; jan.scheur...@ericsson.com; O Mahony, Billy > > Cc: Wang, Yipeng1 ; Stokes, Ian > ; b...@ovn.org > Subject: [PATCH v5 1/2] dpif-netdev: Add SMC cache after EMC cache > > This patch adds a signature match cache (SMC) after exact match cache (EMC). > The difference between SMC and EMC is SMC only stores a signature of a flow > thus it is much more memory efficient. With same memory space, EMC can > store 8k flows while SMC can store 1M flows. It is generally beneficial to > turn on > SMC but turn off EMC when traffic flow count is much larger than EMC size. > > SMC cache will map a signature to an dp_netdev_flow index in flow_table. Thus, > we add two new APIs in cmap for lookup key by index and lookup index by key. > > For now, SMC is an experimental feature that it is turned off by default. One > can > turn it on using ovsdb options. > > Signed-off-by: Yipeng Wang > Co-authored-by: Jan Scheurich > Signed-off-by: Jan Scheurich > --- > Documentation/topics/dpdk/bridge.rst | 15 ++ > NEWS | 2 + > lib/cmap.c | 74 > lib/cmap.h | 11 ++ > lib/dpif-netdev-perf.h | 1 + > lib/dpif-netdev.c| 329 > +++ > tests/pmd.at | 1 + > vswitchd/vswitch.xml | 13 ++ > 8 files changed, 409 insertions(+), 37 deletions(-) > > diff --git a/Documentation/topics/dpdk/bridge.rst > b/Documentation/topics/dpdk/bridge.rst > index 63f8a62..df74c02 100644 > --- a/Documentation/topics/dpdk/bridge.rst > +++ b/Documentation/topics/dpdk/bridge.rst > @@ -102,3 +102,18 @@ For certain traffic profiles with many parallel flows, > it's > recommended to set ``N`` to '0' to achieve higher forwarding performance. > > For more information on the EMC refer to :doc:`/intro/install/dpdk` . > + > + > +SMC cache (experimental) > +- > + > +SMC cache or signature match cache is a new cache level after EMC cache. > +The difference between SMC and EMC is SMC only stores a signature of a > +flow thus it is much more memory efficient. With same memory space, EMC > +can store 8k flows while SMC can store 1M flows. When traffic flow > +count is much larger than EMC size, it is generally beneficial to turn > +off EMC and turn on SMC. It is currently turned off by default and an > experimental feature. > + > +To turn on SMC:: > + > +$ ovs-vsctl --no-wait set Open_vSwitch . > + other_config:smc-enable=true > diff --git a/NEWS b/NEWS > index 92e9b92..f30a1e0 100644 > --- a/NEWS > +++ b/NEWS > @@ -44,6 +44,8 @@ Post-v2.9.0 > ovs-appctl dpif-netdev/pmd-perf-show > * Supervision of PMD performance metrics and logging of suspicious > iterations > + * Add signature match cache (SMC) as experimental feature. When turned > on, > + it improves throughput when traffic has many more flows than EMC size. > - ERSPAN: > * Implemented ERSPAN protocol (draft-foschiano-erspan-00.txt) for > both kernel datapath and userspace datapath. > diff --git a/lib/cmap.c b/lib/cmap.c > index 07719a8..cb9cd32 100644 > --- a/lib/cmap.c > +++ b/lib/cmap.c > @@ -373,6 +373,80 @@ cmap_find(const struct cmap *cmap, uint32_t hash) > hash); > } > > +/* Find a node by the index of the entry of cmap. Index N means the > +N/CMAP_K > + * bucket and N%CMAP_K entry in that bucket. > + * Notice that it is not protected by the optimistic lock (versioning) > +because > + * it does not compare the hashes. Currently it is only used by the > +datapath > + * SMC cache. > + * > + * Return node for the entry of index or NULL if the index beyond > +boundary */ const struct cmap_node * cmap_find_by_index(const struct > +cmap *cmap, uint32_t index) { > +const struct cmap_impl *impl = cmap_get_impl(cmap); > + > +uint32_t b = index / CMAP_K; > +uint32_t e = index % CMAP_K; > + > +if (b > impl->mask) { > +return NULL; > +} > + > +const struct cmap_bucket *bucket = >buckets[b]; > + > +return cmap_node_next(>nodes[e]); > +} > + > +/* Find the index of certain hash value. Currently only used by the > +datapath > + * SMC cache. > + * > + * Return the index of the entry if found, or UINT32_MAX if not found. > +The > + * function assumes entry index cannot be larger than UINT32_MAX. */ > +uint32_t cmap_find_index(const struct cmap *cmap, uint32_t hash) { > +const struct cmap_impl *impl = cmap_get_impl(cmap); > +uint32_t h1 = rehash(impl, hash); > +uint32_t h2 = other_hash(h1); > + > +uint32_t b_index1 = h1 & impl->mask; > +uint32_t b_index2 = h2 & impl->mask; > + > +uint32_t c1, c2; > +uint32_t index = UINT32_MAX; > + > +const struct cmap_bucket *b1 = >buckets[b_index1]; > +const struct
Re: [ovs-dev] [patch v2] conntrack: Fix conn_update_state_alg use after free.
On Wed, Jul 11, 2018 at 8:56 AM, Darrell Ball wrote: > > > On Wed, Jul 11, 2018 at 8:36 AM, Ben Pfaff wrote: > >> On Wed, Jul 11, 2018 at 08:34:49AM -0700, Ben Pfaff wrote: >> > On Tue, Jul 10, 2018 at 04:41:58PM -0700, Darrell Ball wrote: >> > > When conn_update_state() returns true, conn has been freed, so skip >> calling >> > > handle_ftp_ctl() with this conn and instead follow code path for new >> > > connections. >> > > >> > > Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") >> > > Signed-off-by: Darrell Ball >> > > --- >> > > >> > > Needs backporting as far back as 2.8. >> > > >> > > v1->v2: Fix commit messaage. >> > >> > Thanks, applied and backported. >> >> Actually, I spoke too soon. I applied to master and branch-2.9, but >> branch-2.8 isn't a clean backport. Would you mind submitting a >> branch-2.8 backport version? >> > > > oops, right. > Here it is: > > https://patchwork.ozlabs.org/patch/942587/ > > > actually, I just noticed the commit message mentions a new function in 2.9 I'll send a V2 > > >> >> Thanks, >> >> Ben. >> > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [ovs-dev,v1; ,branch,2.8] conntrack: Fix conn_update_state_alg use after free.
Bleep bloop. Greetings Darrell Ball, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. git-am: Failed to merge in the changes. Patch failed at 0001 conntrack: Fix conn_update_state_alg use after free. The copy of the patch that failed is found in: /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch When you have resolved this problem, run "git am --resolved". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Please check this out. If you feel there has been an error, please email acon...@bytheb.org Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [patch v2] conntrack: Fix conn_update_state_alg use after free.
On Wed, Jul 11, 2018 at 8:36 AM, Ben Pfaff wrote: > On Wed, Jul 11, 2018 at 08:34:49AM -0700, Ben Pfaff wrote: > > On Tue, Jul 10, 2018 at 04:41:58PM -0700, Darrell Ball wrote: > > > When conn_update_state() returns true, conn has been freed, so skip > calling > > > handle_ftp_ctl() with this conn and instead follow code path for new > > > connections. > > > > > > Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") > > > Signed-off-by: Darrell Ball > > > --- > > > > > > Needs backporting as far back as 2.8. > > > > > > v1->v2: Fix commit messaage. > > > > Thanks, applied and backported. > > Actually, I spoke too soon. I applied to master and branch-2.9, but > branch-2.8 isn't a clean backport. Would you mind submitting a > branch-2.8 backport version? > oops, right. Here it is: https://patchwork.ozlabs.org/patch/942587/ > > Thanks, > > Ben. > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [patch v1; branch 2.8] conntrack: Fix conn_update_state_alg use after free.
When conn_update_state() returns true, conn has been freed, so skip calling handle_ftp_ctl() with this conn and instead follow code path for new connections. Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") Signed-off-by: Darrell Ball --- lib/conntrack.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 56b5cd8..b6d1464 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -1135,8 +1135,11 @@ process_one(struct conntrack *ct, struct dp_packet *pkt, } else { create_new_conn = conn_update_state(ct, pkt, ctx, , now, bucket); -handle_ftp_ctl(ct, ctx, pkt, conn, now, CT_FTP_CTL_OTHER, - !!nat_action_info); + +if (!create_new_conn) { +handle_ftp_ctl(ct, ctx, pkt, conn, now, CT_FTP_CTL_OTHER, + !!nat_action_info); +} } } else { create_new_conn = conn_update_state(ct, pkt, ctx, , now, -- 1.9.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 2/3] ipsec: add CA-cert based authentication
Thanks for your review! On Tue, Jul 10, 2018 at 6:16 PM, Ansis Atteka wrote: > On Wed, 27 Jun 2018 at 10:59, Qiuyu Xiao wrote: >> >> This patch adds CA-cert based authentication to the ovs-monitor-ipsec >> daemon. With CA-cert based authentication enabled, OVS approves IPsec >> tunnel if the peer has a cert signed by a trusted CA and the identity of >> the peer cert is as expected. Belows are the major changes and the >> reasons: >> >> 1) Added CA-cert based authentication. Compared with peer-cert based >> authentication, this one doesn't need to import peer cert to the local >> host to do configuration. This is especially beneficial if host has >> mutiple peers and peers frequently update their certs. This feature is >> required for the upcoming OVN IPsec support. >> >> 2) Changed the host cert and private key configuration interface. >> Previously, the host's cert and private key can be configured in either >> Open_vSwitch's SSL column or the SSL table. Now, the host certificate >> and private key can be only configured in the Open_vSwitch table's >> other_config column. Since it is not SSL cert and key, we'd better not >> to confuse users by saying so. >> >> 3) Changed the peer cert configuration interface. Previously, the peer >> cert is configured by setting the interface's options column as the >> content of the peer cert. It's changed to setting the column as the path >> of the peer cert. This is easier to be configured by the command line >> tool, and is consistent with other cert and key configuration interface >> which is better from a usability point of view. >> > > Would you mind creating a patch ovs/poc/ipsec ansible+vagrant recipe > that deploys two VMs, installs strongswan, openvswitch and then > configure IPsec between them? > Current tests use mocked strongSwan's ipsec utility. This sounds a more solid test compared to the simulated one. I will try to create such test. > > >> Signed-off-by: Qiuyu Xiao >> --- >> Documentation/howto/ipsec.rst | 78 --- >> ipsec/ovs-monitor-ipsec | 138 +- >> 2 files changed, 156 insertions(+), 60 deletions(-) >> >> diff --git a/Documentation/howto/ipsec.rst b/Documentation/howto/ipsec.rst >> index 4e4f4d211..b42312da5 100644 >> --- a/Documentation/howto/ipsec.rst >> +++ b/Documentation/howto/ipsec.rst >> @@ -21,9 +21,9 @@ >> >>Avoid deeper levels because they do not render well. >> >> -== >> -How to Encrypt Open vSwitch Tunnels with IPsec >> -== >> +=== >> +Encrypt Open vSwitch Tunnels with IPsec >> +=== >> >> This document describes how to use Open vSwitch integration with strongSwan >> 5.1 or later to provide IPsec security for STT, GENEVE, GRE and VXLAN >> tunnels. >> @@ -77,6 +77,67 @@ Install strongSwan and openvswitch-ipsec debian packages:: >> Configuration >> - >> >> +The IPsec configuration is done by setting options of the tunnel interface. >> +ovs-monitor-ipsec configures strongSwan accordingly based on the tunnel >> options. >> + >> +Authentication Methods >> +~~ >> + >> +Hosts of the IPsec tunnel need to authenticate each other to build a secure >> +channel. There are three authentication methods: >> + >> +1) You can set a pre-shared key in both hosts to do authentication. This >> + method is easier to use but less secure:: >> + >> + % ovs-vsctl add-port br0 ipsec_gre0 -- \ >> + set interface ipsec_gre0 type=gre \ >> + options:remote_ip=1.2.3.4 \ >> + options:psk=swordfish]) >> + >> +2) You can use peer certificates to do authentication. First, generate >> + certificate and private key in each host. The certificate could be >> + self-signed. Refer to the ovs-pki(8) man page for more information >> + regarding certificate and key generation. Then, copy the peer certificate >> + to the local host and type:: >> + >> + % ovs-vsctl set Open_vSwitch . \ >> + other_config:certificate=/path/to/local_cert.pem \ >> + other_config:private_key=/path/to/priv_key.pem >> + % ovs-vsctl add-port br0 ipsec_gre0 -- \ >> + set interface ipsec_gre0 type=gre \ >> + options:remote_ip=1.2.3.4 \ >> + options:pki=peer_auth \ > It seems you have introduced options:pki to allow to pick between > self-signed certificate configuration and certificate authority signed > certificate configuration. Instead, could you determine the > configuration from some fields that you uniquely set in each > configuration? Yes. I think the pki option is not needed. I will change this. >> + >> options:peer_cert=/path/to/peer_cert.pem >> + >> +
Re: [ovs-dev] [patch v2] conntrack: Fix conn_update_state_alg use after free.
On Wed, Jul 11, 2018 at 08:34:49AM -0700, Ben Pfaff wrote: > On Tue, Jul 10, 2018 at 04:41:58PM -0700, Darrell Ball wrote: > > When conn_update_state() returns true, conn has been freed, so skip calling > > handle_ftp_ctl() with this conn and instead follow code path for new > > connections. > > > > Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") > > Signed-off-by: Darrell Ball > > --- > > > > Needs backporting as far back as 2.8. > > > > v1->v2: Fix commit messaage. > > Thanks, applied and backported. Actually, I spoke too soon. I applied to master and branch-2.9, but branch-2.8 isn't a clean backport. Would you mind submitting a branch-2.8 backport version? Thanks, Ben. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [patch v2] conntrack: Fix conn_update_state_alg use after free.
On Tue, Jul 10, 2018 at 04:41:58PM -0700, Darrell Ball wrote: > When conn_update_state() returns true, conn has been freed, so skip calling > handle_ftp_ctl() with this conn and instead follow code path for new > connections. > > Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") > Signed-off-by: Darrell Ball > --- > > Needs backporting as far back as 2.8. > > v1->v2: Fix commit messaage. Thanks, applied and backported. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] ofproto-dpif-xlate: Check the right IPv6 address in is_nd_dst_correct().
On Tue, Jul 10, 2018 at 08:23:17PM -0400, Aaron Conole wrote: > Ben Pfaff writes: > > > Fixes test 815 "tunnel_push_pop_ipv6 - action". > > > > CC: Aaron Conole > > Fixes: 6f231f7c3a9e ("xlate: use const struct in6_addr in linklocal check") > > Signed-off-by: Ben Pfaff > > --- > > D'oh! The names killed me. Sorry :-( > > Acked-by: Aaron Conole Thanks, applied to master. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] sparse: Make IN6_IS_ADDR_MC_LINKLOCAL and IN6_ARE_ADDR_EQUAL pickier.
On Tue, Jul 10, 2018 at 10:19:22PM -0400, Aaron Conole wrote: > Ben Pfaff writes: > > > On GNU systems these macros work with arbitrary pointers, but the relevant > > standards only require IN6_IS_ADDR_MC_LINKLOCAL to work with in6_addr (and > > don't specify IN6_ARE_ADDR_EQUAL at all). Make the "sparse" > > implementations correspondingly pickier so that we catch any introduced > > problems more quickly. > > > > CC: Aaron Conole > > Signed-off-by: Ben Pfaff > > --- > > LGTM > > Acked-by: Aaron Conole Thanks, applied. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] ovn-nbctl: Fix compilation warnings.
On Wed, Jul 11, 2018 at 09:13:15AM +, Stokes, Ian wrote: > > On Tue, Jul 10, 2018 at 07:46:55PM +0100, Ian Stokes wrote: > > > This commit fixes 'maybe-uninitialized' warnings for pointers in > > > various functions in ovn-nbctl when compiling with gcc 6.3.1 and - > > Werror. > > > Pointers to structs nbrec_logical_switch, nbrec_logical_switch_port, > > > nbrec_logical_router and nbrec_logical_router_port are now initialized > > > to NULL where required. > > > > > > Cc: Justin Pettit > > > Cc: Venkata Anil > > > Fixes: 31114af758c7 ("ovn-nbctl: Update logical router port > > > commands.") > > > Fixes: 80f408f4cffb ("ovn: Use Logical_Switch_Port in NB.") > > > Fixes: 36f232bca2db ("ovn: l3ha, CLI for logical router port gateway > > > chassis") > > > Signed-off-by: Ian Stokes > > > > Does the following patch also fix the problem? > > https://patchwork.ozlabs.org/patch/942179/ > > Thanks for the patch Ben, yes it resolves the problem also. Your patch is > simpler/better than what I have proposed so let's stick with yours :). Thanks. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] ovn-nbctl: Always initialize output arguments in *_by_name_or_uuid().
On Wed, Jul 11, 2018 at 09:17:55AM +, Stokes, Ian wrote: > > This makes it easier to reason about the outputs, and fixes warnings for > > GCC 6.3.x. > > > > Cc: Venkata Anil > > Fixes: 31114af758c7 ("ovn-nbctl: Update logical router port commands.") > > Fixes: 80f408f4cffb ("ovn: Use Logical_Switch_Port in NB.") > > Fixes: 36f232bca2db ("ovn: l3ha, CLI for logical router port gateway > > chassis") > > Signed-off-by: Ben Pfaff > > Acked-by: Ian Stokes Thanks, applied to master. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v3 1/4] dpif-netlink: Detect Out-Of-Resource condition on a netdev
On Wed, Jul 11, 2018 at 05:30:13PM +0530, Sriharsha Basavapatna wrote: > On Wed, Jul 11, 2018 at 3:33 AM, Ben Pfaff wrote: > > On Tue, Jul 10, 2018 at 11:59:35AM +0530, Sriharsha Basavapatna via dev > > wrote: > >> This is the first patch in the patch-set to support dynamic rebalancing > >> of offloaded flows. > >> > >> The patch detects OOR condition on a netdev port when ENOSPC error is > >> returned by TC-Flower while adding a flow rule. A new structure is added > >> to the netdev called "netdev_hw_info", to store OOR related information > >> required to perform dynamic offload-rebalancing. > >> > >> Signed-off-by: Sriharsha Basavapatna > >> Co-authored-by: Venkat Duvvuru > >> Signed-off-by: Venkat Duvvuru > >> Reviewed-by: Sathya Perla > > > > Thanks for the patch. > > > > I spent some time adjusting the style to better fit what we usually do > > these days in OVS, which puts declarations as close to first use as > > practical. I'm appending the incremental that I'd suggest folding in. > > > > However I noticed a potentially serious bug while doing it. Before this > > patch, the code looked for output actions and took the dst_port from the > > last one it found that was a tunnel. After this patch, it does the same > > thing but it also leaks a netdev for every output action other than the > > first. I added a "break;" to mitigate the damage but I guess it's not a > > correct solution. > > > > Thanks, > > > > Ben. > > Hi Ben, > > Thanks for catching this issue. This code was based on an earlier assumption > that multiple output actions won't be specified with offloading; and looks > like that assumption is no more valid with the fix: > "netdev-tc-offloads: Add offloading of multiple outputs" > (commit: 00a0a011d328dc7a9ef163ab2066abe697bd1490). > > I've restored the original code for 'outdev' (along with variable declarations > change that you suggested). I've also removed 'outdev' condition check in our > code while setting OOR, since that is not really needed (we just need > in_port/dev). > > Please let me know if you want me to send out the updated patch-set or if I > should wait for other comments. Please send the revised patches. Thanks, Ben. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH branch-2.9] ovn-northd: Don't shadow addr_family in add_router_lb_flow().
Thanks, applied to branch-2.9. On Wed, Jul 11, 2018 at 08:36:18AM -0400, Mark Michelson wrote: > Thanks, Ben! > > Acked-by: Mark Michelson > > On 07/10/2018 06:24 PM, Ben Pfaff wrote: > >This is a partial backport of commit 396d492cfa8d ("Don't shadow > >variables.") to fix a build break due to backporting a different commit > >that depended on it. > > > >CC: Mark Michelson > >Fixes: 15fbc3baee5a ("ovn: Add router load balancer undnat rule for IPv6") > >Signed-off-by: Ben Pfaff > >--- > > ovn/northd/ovn-northd.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > >diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c > >index 2509b0a57320..334aa6f8c742 100644 > >--- a/ovn/northd/ovn-northd.c > >+++ b/ovn/northd/ovn-northd.c > >@@ -4463,9 +4463,9 @@ add_router_lb_flow(struct hmap *lflows, struct > >ovn_datapath *od, > > while (ip_str && ip_str[0]) { > > char *ip_address = NULL; > > uint16_t port = 0; > >-int addr_family; > >+int addr_family_; > > ip_address_and_port_from_lb_key(ip_str, _address, , > >-_family); > >+_family_); > > if (!ip_address) { > > break; > > } > > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v4 01/15] netdev-dpdk: Differentiate between mtu/mbuf size.
> On 11/07/2018 12:40, Ian Stokes wrote: > > On 7/10/2018 12:06 PM, Tiago Lam wrote: > >> When configuring a mempool, in netdev_dpdk_mempool_configure(), the > >> result of a call to dpdk_buf_size() is being used as the MTU. This, > >> however, is not the MTU but a ROUND_UP aligned number based on the > >> MTU, which could lead to the reuse of mempools even when the real > >> MTUs between different ports differ but somehow round up to the same > >> mbuf size. > >> > >> To support multi-segment mbufs, which is coming in later commits, > >> this distinction is important. For multi-segment mbufs the mbuf size > >> is always the same (multiple mbufs are chained together to hold the > >> packet's data), which means that using the mbuf size as the mtu would > >> lead to reusing always the same mempool, independent of the MTU set. > >> > >> To fix this, two fields are now passed to dpdk_mp_create(), the mtu > >> and the mbuf_size, thus creating a distinction between the two. The > >> latter is used for telling rte_pktmbuf_pool_create() the size of each > >> mbuf, while the former is used for tracking purposes in struct > >> dpdk_mp and as an input to create a unique hash for the mempool's name. > >> > >> Signed-off-by: Tiago Lam > > > > Hi Tiago, > > > > I don't think these changes are acceptable as they break from the > > expected behavior of the shared mempool model. > > > > The reason we introduced the shared mempool model was that it was used > > from OVS 2.6 -> 2.9. > > > > A user with the same deployment moving between releases would not have > > to re-calculate the memory they dimension for OVS DPDK. > > > > With these changes however they may have to. > > > > Consider the following example: > > > > A user adds a port with mtu 1500 and a second port with mtu 1800. > > Assuming both ports are on the same socket, the same mempool would be > > re-used for both ports in the current shared mempool model. > > > However with this change, separate mempools would have to be created > > as the MTU is different, potentially requiring an increase in the > > memory provisioned by the user. It may not be possible for users to > > upgrade from OVS 2.9 to 2.10 without re-dimension their memory with > this. > > > > Hi Ian, > > Thanks for the context here. > > It's a valid point. I did consider this, but wasn't aware that users / > deployments were also taking this round up into account. In that case, > this could certainly cause problems during upgrade. > > > We had a similar issue to this in OVS 2.9 release with the per port > > memory model, it was flagged as a blocking factor for Red Hat and > > Ericsson upgrades which led to the removal of the per port model in 2.9. > > > > One possible solution here is that multiseg is supported for the per > > port memory model only? > > > > It seems we can adapt this in a different way. I was trying to reuse the > "mbuf_size" for both cases; In the per-port and shared mempool case, where > it is being used as the MTU, and in the multi-segment case where it is > being used for telling rte_pktmbuf_pool_create() the size of each mbuf. > Hence why I thought it would be better to differentiate between the real > MTU and the "mbuf_size". Instead, we can calculate two "mbuf_sizes" - the > one the shared and per-port mempool models use for tracking the MTU > changes, and in case multi-segment mbufs are in use, the "mbuf_size" for > when creating the mempool. This should suffice. > > I'll update the series with this; This patch 01/15 will probably be > dropped entirely, and patch 12/15 will likely be the one taking the > changes mentioned above. > > I'll also update patches 05/15 and 11/15 to fix the Travis CI. > > Thanks, > Tiago. That sounds ok, will review in the next revision. Thanks Ian ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v4 01/15] netdev-dpdk: Differentiate between mtu/mbuf size.
On 11/07/2018 12:40, Ian Stokes wrote: > On 7/10/2018 12:06 PM, Tiago Lam wrote: >> When configuring a mempool, in netdev_dpdk_mempool_configure(), the >> result of a call to dpdk_buf_size() is being used as the MTU. This, >> however, is not the MTU but a ROUND_UP aligned number based on the MTU, >> which could lead to the reuse of mempools even when the real MTUs >> between different ports differ but somehow round up to the same mbuf >> size. >> >> To support multi-segment mbufs, which is coming in later commits, this >> distinction is important. For multi-segment mbufs the mbuf size is >> always the same (multiple mbufs are chained together to hold the >> packet's data), which means that using the mbuf size as the mtu would >> lead to reusing always the same mempool, independent of the MTU set. >> >> To fix this, two fields are now passed to dpdk_mp_create(), the mtu and >> the mbuf_size, thus creating a distinction between the two. The latter >> is used for telling rte_pktmbuf_pool_create() the size of each mbuf, >> while the former is used for tracking purposes in struct dpdk_mp and as >> an input to create a unique hash for the mempool's name. >> >> Signed-off-by: Tiago Lam > > Hi Tiago, > > I don't think these changes are acceptable as they break from the > expected behavior of the shared mempool model. > > The reason we introduced the shared mempool model was that it was used > from OVS 2.6 -> 2.9. > > A user with the same deployment moving between releases would not have > to re-calculate the memory they dimension for OVS DPDK. > > With these changes however they may have to. > > Consider the following example: > > A user adds a port with mtu 1500 and a second port with mtu 1800. > Assuming both ports are on the same socket, the same mempool would be > re-used for both ports in the current shared mempool model. > However with this change, separate mempools would have to be created as > the MTU is different, potentially requiring an increase in the memory > provisioned by the user. It may not be possible for users to upgrade > from OVS 2.9 to 2.10 without re-dimension their memory with this. > Hi Ian, Thanks for the context here. It's a valid point. I did consider this, but wasn't aware that users / deployments were also taking this round up into account. In that case, this could certainly cause problems during upgrade. > We had a similar issue to this in OVS 2.9 release with the per port > memory model, it was flagged as a blocking factor for Red Hat and > Ericsson upgrades which led to the removal of the per port model in 2.9. > > One possible solution here is that multiseg is supported for the per > port memory model only? > It seems we can adapt this in a different way. I was trying to reuse the "mbuf_size" for both cases; In the per-port and shared mempool case, where it is being used as the MTU, and in the multi-segment case where it is being used for telling rte_pktmbuf_pool_create() the size of each mbuf. Hence why I thought it would be better to differentiate between the real MTU and the "mbuf_size". Instead, we can calculate two "mbuf_sizes" - the one the shared and per-port mempool models use for tracking the MTU changes, and in case multi-segment mbufs are in use, the "mbuf_size" for when creating the mempool. This should suffice. I'll update the series with this; This patch 01/15 will probably be dropped entirely, and patch 12/15 will likely be the one taking the changes mentioned above. I'll also update patches 05/15 and 11/15 to fix the Travis CI. Thanks, Tiago. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] dpctl: Expand the flow dump type filter
On Sun, Jul 08, 2018 at 02:15:38PM +0300, Gavi Teitz wrote: > Added new types to the flow dump filter, and allowed multiple filter > types to be passed at once, as a comma separated list. The new types > added are: > * tc - specifies flows handled by the tc dp > * non-offloaded - specifies flows not offloaded to the HW > * all - specifies flows of all types > > The type list is now fully parsed by the dpctl, and a new struct was > added to dpif which enables dpctl to define which types of dumps to > provide, rather than passing the type string and having dpif parse it. > > Signed-off-by: Gavi Teitz > Acked-by: Roi Dayan Hi, this looks good to me. However, I wonder if it should wait until after the v2.10 soft-freeze is over. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH branch-2.9] ovn-northd: Don't shadow addr_family in add_router_lb_flow().
Thanks, Ben! Acked-by: Mark Michelson On 07/10/2018 06:24 PM, Ben Pfaff wrote: This is a partial backport of commit 396d492cfa8d ("Don't shadow variables.") to fix a build break due to backporting a different commit that depended on it. CC: Mark Michelson Fixes: 15fbc3baee5a ("ovn: Add router load balancer undnat rule for IPv6") Signed-off-by: Ben Pfaff --- ovn/northd/ovn-northd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 2509b0a57320..334aa6f8c742 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -4463,9 +4463,9 @@ add_router_lb_flow(struct hmap *lflows, struct ovn_datapath *od, while (ip_str && ip_str[0]) { char *ip_address = NULL; uint16_t port = 0; -int addr_family; +int addr_family_; ip_address_and_port_from_lb_key(ip_str, _address, , -_family); +_family_); if (!ip_address) { break; } ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v3 1/4] dpif-netlink: Detect Out-Of-Resource condition on a netdev
On Wed, Jul 11, 2018 at 3:33 AM, Ben Pfaff wrote: > On Tue, Jul 10, 2018 at 11:59:35AM +0530, Sriharsha Basavapatna via dev wrote: >> This is the first patch in the patch-set to support dynamic rebalancing >> of offloaded flows. >> >> The patch detects OOR condition on a netdev port when ENOSPC error is >> returned by TC-Flower while adding a flow rule. A new structure is added >> to the netdev called "netdev_hw_info", to store OOR related information >> required to perform dynamic offload-rebalancing. >> >> Signed-off-by: Sriharsha Basavapatna >> Co-authored-by: Venkat Duvvuru >> Signed-off-by: Venkat Duvvuru >> Reviewed-by: Sathya Perla > > Thanks for the patch. > > I spent some time adjusting the style to better fit what we usually do > these days in OVS, which puts declarations as close to first use as > practical. I'm appending the incremental that I'd suggest folding in. > > However I noticed a potentially serious bug while doing it. Before this > patch, the code looked for output actions and took the dst_port from the > last one it found that was a tunnel. After this patch, it does the same > thing but it also leaks a netdev for every output action other than the > first. I added a "break;" to mitigate the damage but I guess it's not a > correct solution. > > Thanks, > > Ben. Hi Ben, Thanks for catching this issue. This code was based on an earlier assumption that multiple output actions won't be specified with offloading; and looks like that assumption is no more valid with the fix: "netdev-tc-offloads: Add offloading of multiple outputs" (commit: 00a0a011d328dc7a9ef163ab2066abe697bd1490). I've restored the original code for 'outdev' (along with variable declarations change that you suggested). I've also removed 'outdev' condition check in our code while setting OOR, since that is not really needed (we just need in_port/dev). Please let me know if you want me to send out the updated patch-set or if I should wait for other comments. Thanks, -Harsha > > --8<--cut here-->8-- > > diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c > index 5a6d53ad5697..ecc1ea5f4455 100644 > --- a/lib/dpif-netlink.c > +++ b/lib/dpif-netlink.c > @@ -2097,16 +2097,12 @@ parse_flow_put(struct dpif_netlink *dpif, struct > dpif_flow_put *put) > { > static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); > const struct dpif_class *dpif_class = dpif->dpif.dpif_class; > -struct netdev_hw_info *hw_info; > struct match match; > odp_port_t in_port; > -odp_port_t out_port; > const struct nlattr *nla; > size_t left; > struct netdev *dev; > struct netdev *outdev = NULL; > -struct netdev *tunnel_netdev = NULL; > -struct netdev *oor_netdev = NULL; > struct offload_info info; > ovs_be16 dst_port = 0; > int err; > @@ -2137,7 +2133,7 @@ parse_flow_put(struct dpif_netlink *dpif, struct > dpif_flow_put *put) > if (nl_attr_type(nla) == OVS_ACTION_ATTR_OUTPUT) { > const struct netdev_tunnel_config *tnl_cfg; > > -out_port = nl_attr_get_odp_port(nla); > +odp_port_t out_port = nl_attr_get_odp_port(nla); > outdev = netdev_ports_get(out_port, dpif_class); > if (!outdev) { > err = EOPNOTSUPP; > @@ -2147,6 +2143,7 @@ parse_flow_put(struct dpif_netlink *dpif, struct > dpif_flow_put *put) > if (tnl_cfg && tnl_cfg->dst_port != 0) { > dst_port = tnl_cfg->dst_port; > } > +break; > } > } > > @@ -2177,18 +2174,16 @@ parse_flow_put(struct dpif_netlink *dpif, struct > dpif_flow_put *put) > > VLOG_DBG("added flow"); > } else if (err != EEXIST) { > -if (outdev && dev && (err == ENOSPC)) { > -tunnel_netdev = flow_get_tunnel_netdev(); > -if (tunnel_netdev) { > -oor_netdev = tunnel_netdev; > -} else { > -oor_netdev = dev; > -} > -hw_info = _netdev->hw_info; > -hw_info->oor = true; > +struct netdev *oor_netdev = NULL; > +if (outdev && err == ENOSPC) { > +oor_netdev = flow_get_tunnel_netdev(); > +if (!oor_netdev) { > +oor_netdev = dev; > +} > +oor_netdev->hw_info.oor = true; > } > VLOG_ERR_RL(, "failed to offload flow: %s: %s", ovs_strerror(err), > -(oor_netdev ? oor_netdev->name : dev->name)); > +oor_netdev ? oor_netdev->name : dev->name); > } > > out: > diff --git a/lib/flow.c b/lib/flow.c > index 90a1c0a3aa21..c1191e368419 100644 > --- a/lib/flow.c > +++ b/lib/flow.c > @@ -3410,11 +3410,7 @@ flow_limit_vlans(int vlan_limit) > struct netdev * > flow_get_tunnel_netdev(struct flow_tnl *tunnel) > { > -struct netdev *tunnel_netdev; > -char
Re: [ovs-dev] [PATCH v4 05/15] netdev-dpdk: Serialise non-pmds mbufs' alloc/free.
On 7/10/2018 12:06 PM, Tiago Lam wrote: A new mutex, 'nonpmd_mp_mutex', has been introduced to serialise allocation and free operations by non-pmd threads on a given mempool. free_dpdk_buf() has been modified to make use of the introduced mutex. 1 comment Below Tiago. Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/netdev-dpdk.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index a68f78a..72b9955 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -322,6 +322,16 @@ static struct ovs_mutex dpdk_mp_mutex OVS_ACQ_AFTER(dpdk_mutex) static struct ovs_list dpdk_mp_list OVS_GUARDED_BY(dpdk_mp_mutex) = OVS_LIST_INITIALIZER(_mp_list); +/* This mutex must be used by non pmd threads when allocating or freeing + * mbufs through mempools, when outside of the `non_pmd_mutex` mutex, in struct + * dp_netdev. + * The reason, as pointed out in the "Known Issues" section in DPDK's EAL docs, + * is that the implementation on which mempool is based off is non-preemptable. + * Since non-pmds may end up not being pinned this could lead to the preemption + * between non-pmds performing operations on the same mempool, which could lead + * to memory corruption. */ +static struct ovs_mutex nonpmd_mp_mutex = OVS_MUTEX_INITIALIZER; + struct dpdk_mp { struct rte_mempool *mp; int mtu; @@ -492,6 +502,8 @@ struct netdev_rxq_dpdk { dpdk_port_t port_id; }; +static bool dpdk_thread_is_pmd(void); + static void netdev_dpdk_destruct(struct netdev *netdev); static void netdev_dpdk_vhost_destruct(struct netdev *netdev); @@ -525,6 +537,12 @@ dpdk_buf_size(int mtu) NETDEV_DPDK_MBUF_ALIGN); } +static bool +dpdk_thread_is_pmd(void) +{ + return rte_lcore_id() != NON_PMD_CORE_ID; +} + /* Allocates an area of 'sz' bytes from DPDK. The memory is zero'ed. * * Unlike xmalloc(), this function can return NULL on failure. */ @@ -535,11 +553,17 @@ dpdk_rte_mzalloc(size_t sz) } void -free_dpdk_buf(struct dp_packet *p) +free_dpdk_buf(struct dp_packet *packet) { -struct rte_mbuf *pkt = (struct rte_mbuf *) p; +if (!dpdk_thread_is_pmd()) { +ovs_mutex_lock(_mp_mutex); +} -rte_pktmbuf_free(pkt); +rte_pktmbuf_free(>mbuf); + +if (!dpdk_thread_is_pmd()) { +ovs_mutex_unlock(_mp_mutex); +} This causes build failures for travis as nonpmd_mp_mutex will not be held on every path through the code. https://travis-ci.org/istokes/ovs/jobs/402193295 Ian } static void ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v4 11/15] netdev-dpdk: copy large packet to multi-seg. mbufs
On 7/10/2018 12:06 PM, Tiago Lam wrote: From: Mark Kavanagh Currently, packets are only copied to a single segment in the function dpdk_do_tx_copy(). This could be an issue in the case of jumbo frames, particularly when multi-segment mbufs are involved. This patch calculates the number of segments needed by a packet and copies the data to each segment. A new function, dpdk_buf_alloc(), has also been introduced as a wrapper around the nonpmd_mp_mutex to serialise allocations from a non-pmd context. Thanks Tiago, 1 comment below. Co-authored-by: Michael Qiu Co-authored-by: Tiago Lam Signed-off-by: Mark Kavanagh Signed-off-by: Michael Qiu Signed-off-by: Tiago Lam Acked-by: Eelco Chaudron --- lib/netdev-dpdk.c | 79 --- 1 file changed, 70 insertions(+), 9 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 0a3eb3a..81dd1ed 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -552,6 +552,22 @@ dpdk_rte_mzalloc(size_t sz) return rte_zmalloc(OVS_VPORT_DPDK, sz, OVS_CACHE_LINE_SIZE); } +static struct rte_mbuf * +dpdk_buf_alloc(struct rte_mempool *mp) +{ +if (!dpdk_thread_is_pmd()) { +ovs_mutex_lock(_mp_mutex); +} + This causes build failures in travis for nonpmd mutex not being held for every path. https://travis-ci.org/istokes/ovs/jobs/402193295 Ian +struct rte_mbuf *mbuf = rte_pktmbuf_alloc(mp); + +if (!dpdk_thread_is_pmd()) { +ovs_mutex_unlock(_mp_mutex); +} + +return mbuf; +} + void free_dpdk_buf(struct dp_packet *packet) { @@ -2313,6 +2329,49 @@ out: } } +static int +dpdk_copy_dp_packet_to_mbuf(struct dp_packet *packet, struct rte_mbuf **head, +struct rte_mempool *mp) +{ +struct rte_mbuf *mbuf, *fmbuf; +uint32_t size = dp_packet_size(packet); +uint16_t max_data_len; +uint32_t nb_segs = 0; + +/* Allocate first mbuf to know the size of data available */ +fmbuf = mbuf = *head = dpdk_buf_alloc(mp); +if (OVS_UNLIKELY(!mbuf)) { +return ENOMEM; +} + +/* All new allocated mbuf's max data len is the same */ +max_data_len = mbuf->buf_len - mbuf->data_off; + +/* Calculate # of output mbufs. */ +nb_segs = size / max_data_len; +if (size % max_data_len) { +nb_segs = nb_segs + 1; +} + +/* Allocate additional mbufs, less the one alredy allocated above */ +for (int i = 1; i < nb_segs; i++) { +mbuf->next = dpdk_buf_alloc(mp); +if (!mbuf->next) { +free_dpdk_buf(CONTAINER_OF(fmbuf, struct dp_packet, mbuf)); +fmbuf = NULL; +return ENOMEM; +} +mbuf = mbuf->next; +} + +fmbuf->nb_segs = nb_segs; +fmbuf->pkt_len = size; + +dp_packet_mbuf_write(fmbuf, 0, size, dp_packet_data(packet)); + +return 0; +} + /* Tx function. Transmit packets indefinitely */ static void dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) @@ -2329,6 +2388,7 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) struct rte_mbuf *pkts[PKT_ARRAY_SIZE]; uint32_t cnt = batch_cnt; uint32_t dropped = 0; +uint32_t i; if (dev->type != DPDK_DEV_VHOST) { /* Check if QoS has been configured for this netdev. */ @@ -2339,28 +2399,29 @@ dpdk_do_tx_copy(struct netdev *netdev, int qid, struct dp_packet_batch *batch) uint32_t txcnt = 0; -for (uint32_t i = 0; i < cnt; i++) { +for (i = 0; i < cnt; i++) { struct dp_packet *packet = batch->packets[i]; uint32_t size = dp_packet_size(packet); +int err = 0; if (OVS_UNLIKELY(size > dev->max_packet_len)) { VLOG_WARN_RL(, "Too big size %u max_packet_len %d", size, dev->max_packet_len); - dropped++; continue; } -pkts[txcnt] = rte_pktmbuf_alloc(dev->dpdk_mp->mp); -if (OVS_UNLIKELY(!pkts[txcnt])) { +err = dpdk_copy_dp_packet_to_mbuf(packet, [txcnt], + dev->dpdk_mp->mp); +if (err != 0) { +if (err == ENOMEM) { +VLOG_ERR_RL(, "Failed to alloc mbufs! %u packets dropped", +cnt - i); +} + dropped += cnt - i; break; } - -/* We have to do a copy for now */ -memcpy(rte_pktmbuf_mtod(pkts[txcnt], void *), - dp_packet_data(packet), size); -dp_packet_set_size((struct dp_packet *)pkts[txcnt], size); dp_packet_copy_mbuf_flags((struct dp_packet *)pkts[txcnt], packet); txcnt++; ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH v4 01/15] netdev-dpdk: Differentiate between mtu/mbuf size.
On 7/10/2018 12:06 PM, Tiago Lam wrote: When configuring a mempool, in netdev_dpdk_mempool_configure(), the result of a call to dpdk_buf_size() is being used as the MTU. This, however, is not the MTU but a ROUND_UP aligned number based on the MTU, which could lead to the reuse of mempools even when the real MTUs between different ports differ but somehow round up to the same mbuf size. To support multi-segment mbufs, which is coming in later commits, this distinction is important. For multi-segment mbufs the mbuf size is always the same (multiple mbufs are chained together to hold the packet's data), which means that using the mbuf size as the mtu would lead to reusing always the same mempool, independent of the MTU set. To fix this, two fields are now passed to dpdk_mp_create(), the mtu and the mbuf_size, thus creating a distinction between the two. The latter is used for telling rte_pktmbuf_pool_create() the size of each mbuf, while the former is used for tracking purposes in struct dpdk_mp and as an input to create a unique hash for the mempool's name. Signed-off-by: Tiago Lam Hi Tiago, I don't think these changes are acceptable as they break from the expected behavior of the shared mempool model. The reason we introduced the shared mempool model was that it was used from OVS 2.6 -> 2.9. A user with the same deployment moving between releases would not have to re-calculate the memory they dimension for OVS DPDK. With these changes however they may have to. Consider the following example: A user adds a port with mtu 1500 and a second port with mtu 1800. Assuming both ports are on the same socket, the same mempool would be re-used for both ports in the current shared mempool model. However with this change, separate mempools would have to be created as the MTU is different, potentially requiring an increase in the memory provisioned by the user. It may not be possible for users to upgrade from OVS 2.9 to 2.10 without re-dimension their memory with this. We had a similar issue to this in OVS 2.9 release with the per port memory model, it was flagged as a blocking factor for Red Hat and Ericsson upgrades which led to the removal of the per port model in 2.9. One possible solution here is that multiseg is supported for the per port memory model only? Ian --- lib/netdev-dpdk.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index bb4d60f..be8e8b9 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -632,7 +632,8 @@ dpdk_calculate_mbufs(struct netdev_dpdk *dev, int mtu, bool per_port_mp) } static struct dpdk_mp * -dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) +dpdk_mp_create(struct netdev_dpdk *dev, int mtu, uint32_t mbuf_size, + bool per_port_mp) { char mp_name[RTE_MEMPOOL_NAMESIZE]; const char *netdev_name = netdev_get_name(>up); @@ -666,21 +667,23 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) { VLOG_DBG("snprintf returned %d. " "Failed to generate a mempool name for \"%s\". " - "Hash:0x%x, socket_id: %d, mtu:%d, mbufs:%u.", - ret, netdev_name, hash, socket_id, mtu, n_mbufs); + "Hash:0x%x, socket_id: %d, mtu:%d, mbufs:%u, " + "mbuf size: %u", + ret, netdev_name, hash, socket_id, mtu, n_mbufs, + mbuf_size); break; } -VLOG_DBG("Port %s: Requesting a mempool of %u mbufs " +VLOG_DBG("Port %s: Requesting a mempool of %u mbufs of size %u " "on socket %d for %d Rx and %d Tx queues.", - netdev_name, n_mbufs, socket_id, + netdev_name, n_mbufs, mbuf_size, socket_id, dev->requested_n_rxq, dev->requested_n_txq); dmp->mp = rte_pktmbuf_pool_create(mp_name, n_mbufs, MP_CACHE_SZ, sizeof (struct dp_packet) - sizeof (struct rte_mbuf), - MBUF_SIZE(mtu) + MBUF_SIZE(mbuf_size) - sizeof(struct dp_packet), socket_id); @@ -718,7 +721,8 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu, bool per_port_mp) } static struct dpdk_mp * -dpdk_mp_get(struct netdev_dpdk *dev, int mtu, bool per_port_mp) +dpdk_mp_get(struct netdev_dpdk *dev, int mtu, uint32_t mbuf_size, +bool per_port_mp) { struct dpdk_mp *dmp, *next; bool reuse = false; @@ -741,7 +745,7 @@ dpdk_mp_get(struct netdev_dpdk *dev, int mtu, bool per_port_mp) dpdk_mp_sweep(); if (!reuse)