[ovs-dev] [PATCH v2] ofp-parse: Check ranges on string to uint32_t conversion.

2023-04-20 Thread Yunjian Wang via dev
An unnecessarily overflow would occurs when the 'value' is longer than 4294967295. So it's required to check ranges to avoid uint32_t overflow. Reported-by: Nan Zhou Signed-off-by: Yunjian Wang --- v2: fix patch code styles --- lib/ofp-parse.c | 7 ++- 1 file changed, 2 insertions(+), 5 del

Re: [ovs-dev] [PATCH] ofp-parse: Check ranges on string to uint32_t conversion.

2023-04-20 Thread wangyunjian via dev
> -Original Message- > From: Simon Horman [mailto:simon.hor...@corigine.com] > Sent: Thursday, April 20, 2023 9:38 PM > To: wangyunjian > Cc: d...@openvswitch.org; i.maxim...@ovn.org; luyicai > Subject: Re: [ovs-dev] [PATCH] ofp-parse: Check ranges on string to uint32_t > conversion. > >

[ovs-dev] [PATCH ovn] tests: decrease risk of flaky failures of ovn -- CoPP system test

2023-04-20 Thread Xavier Simonart
The test was often failing with a meter of 10 pps while generating 100 packets. When the 100 packets generation takes more than 100 msec, the test fails. This happens from time to time in upstream ci. Reducing the number of generated packets to 40 should reduce number of flakes. Signed-off-by: Xav

Re: [ovs-dev] [PATCH ovn] tests: update OVS_PAUSE_TEST behavior

2023-04-20 Thread Xavier Simonart
CoPP test failed for this patch, but this is in a flaky test - the failure is independent of this patch. A patch for the CoPP test will be proposed later, independently of this patch On Thu, Apr 20, 2023 at 8:04 AM Ales Musil wrote: > > > On Wed, Apr 19, 2023 at 2:44 PM Xavier Simonart > wrote:

[ovs-dev] [PATCH ovn] tests: fix "load balancing affinity sessions - IPv4 and IPv6"

2023-04-20 Thread Xavier Simonart
The tests were randomly failing as there is no guarentee that 15 nc will reach different load balancers. Also, running 15 nc made the test quite slow. Fixed by running loops of 5 nc, and then checking results. Test duration decreased by 15 to 20 seconds. Signed-off-by: Xavier Simonart --- tests/

[ovs-dev] [PATCH ovn 1/3] tests: Fixed "1 LR with HA distributed router gateway port"

2023-04-20 Thread Xavier Simonart
This test is broken since a long time but passed as it used OVS_WAIT_UNTIL for checking output, which succeeds whatever the output is ... - Replaced OVS_WAIT_UNTIL by OVS_WAIT_FOR_OUTPUT - Update table numbers - Added back hv$i-vif1 port - Changed slaves to members - Added back gw2 (hence could rem

[ovs-dev] [PATCH ovn 2/3] tests: Fixed wrong usage of OVS_WAIT_UNTIL

2023-04-20 Thread Xavier Simonart
Signed-off-by: Xavier Simonart --- tests/ovn-controller.at | 19 --- tests/ovn.at| 24 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 597aed00b..137724723 100644 --- a/te

[ovs-dev] [PATCH ovn 3/3] tests: check arguments count of OVS_WAIT_UNTIL

2023-04-20 Thread Xavier Simonart
The macro has been used erroneously with the expectation to take the third parameter as the expected output. Fail if more than 2 arguments are used. Also fail if the second argument is an integer (second arg expected to be a command to execute in case of failure). Same checks are used in ovs. Sign

[ovs-dev] [PATCH ovn] northd: fix use-after-free after lrp destroyed

2023-04-20 Thread Tao Liu
In vxlan mode with more than 2047 lrp in router, build_ports() prints "all port tunnel ids exhausted", and frees the lrp port. However, lsp of type "router" connected to the lrp still holds the pointer in port->peer. This leads to northd crash in build_lflows(). CallTrace: build_lswitch_rport_a

Re: [ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread Simon Horman
On Thu, Apr 20, 2023 at 05:31:23PM +0200, Stefan Hoffmann wrote: > On Thu, 2023-04-20 at 15:50 +0200, Simon Horman wrote: > > On Thu, Apr 20, 2023 at 02:18:33PM +0200, David Marchand wrote: > > > On Thu, Apr 20, 2023 at 2:06 PM Simon Horman > > > wrote: > > > > > I do see CI failures, but I think

Re: [ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread Stefan Hoffmann
On Thu, 2023-04-20 at 15:50 +0200, Simon Horman wrote: > On Thu, Apr 20, 2023 at 02:18:33PM +0200, David Marchand wrote: > > On Thu, Apr 20, 2023 at 2:06 PM Simon Horman > > wrote: > > > > I do see CI failures, but I think these are false negatives: > > > > > > > > * > > > > https://patchwork.o

Re: [ovs-dev] [PATCH ovn 1/2] tests: define fmt_pkt function to construct packets with scapy

2023-04-20 Thread Ihar Hrachyshka
I don't see how this is any better. Instead of calling to python that imports GPL libraries, we now call to scapy that calls to python that imports GPL libraries. In both cases we communicate through shell pipes and the only "copyright"-able piece here is scapy API. (There are arguments about wheth

Re: [ovs-dev] [PATCH v2] dpif-netlink: Fix memory leak dpif_netlink_open().

2023-04-20 Thread Simon Horman
On Thu, Apr 20, 2023 at 03:47:43PM +0200, Simon Horman wrote: > On Wed, Apr 19, 2023 at 03:49:58PM +0800, Yunjian Wang via dev wrote: > > Hi Yunjian, > > Please add some text here describing why passing dp and buf is a proble: > how it leads to a leak. > > Also, FYI, I notice that the CI run fai

Re: [ovs-dev] [PATCH v2] ci: Separate DPDK from OVS build.

2023-04-20 Thread Simon Horman
On Thu, Apr 13, 2023 at 10:23:31AM +0200, David Marchand wrote: > Let's separate DPDK compilation from the rest of OVS build: > - this avoids multiple jobs building DPDK in parallel, which especially > affects builds in the dpdk-latest branch, > - we separate concerns about DPDK build requirement

Re: [ovs-dev] [PATCH v2] netdev-dpdk: Check rx/tx descriptor sizes for device.

2023-04-20 Thread Simon Horman
On Fri, Apr 14, 2023 at 04:44:53PM +0100, Kevin Traynor wrote: > By default OVS configures 2048 descriptors for tx and rx queues > on DPDK devices. It also allows the user to configure those values. > > If the values used are not acceptable to the device then queue setup > would fail. > > The dev

Re: [ovs-dev] [PATCH ovn 1/2] tests: define fmt_pkt function to construct packets with scapy

2023-04-20 Thread Simon Horman
On Thu, Apr 20, 2023 at 03:13:20PM +0200, Dumitru Ceara wrote: > Hi Ihar, Simon, > > This is not very pretty but would it improve the situation (not even > importing scapy anymore)? IANAL, but I would be more comfortable with this approach. > > fmt_pkt() { > echo "import binascii; \ >

Re: [ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread Simon Horman
On Thu, Apr 20, 2023 at 02:18:33PM +0200, David Marchand wrote: > On Thu, Apr 20, 2023 at 2:06 PM Simon Horman > wrote: > > > I do see CI failures, but I think these are false negatives: > > > > > > * > > > https://patchwork.ozlabs.org/project/openvswitch/patch/3f70ca7bafad296e18ed9579f30fd7044c

Re: [ovs-dev] [PATCH v2] dpif-netlink: Fix memory leak dpif_netlink_open().

2023-04-20 Thread Simon Horman
On Wed, Apr 19, 2023 at 03:49:58PM +0800, Yunjian Wang via dev wrote: Hi Yunjian, Please add some text here describing why passing dp and buf is a proble: how it leads to a leak. Also, FYI, I notice that the CI run failed, which seems completely unrelated to your patch: * https://github.com/ovs

[ovs-dev] [PATCH ovn] ovn-nbctl: Fix unhandled NULL return from normalize_prefix_str

2023-04-20 Thread Ales Musil
The normalize_prefix_str returns NULL when it fails to normalize the specified string. Prevent UB with formatting NULL with %s and simplify the free pattern. Signed-off-by: Ales Musil --- utilities/ovn-nbctl.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/utili

Re: [ovs-dev] [PATCH] ofp-parse: Check ranges on string to uint32_t conversion.

2023-04-20 Thread Simon Horman
On Fri, Apr 14, 2023 at 05:47:59PM +0800, Yunjian Wang via dev wrote: > An unnecessarily overflow would occurs when the 'value' is longer than > 4294967295. So it's required to check ranges to avoid uint32_t overflow. Thanks, I see this is correct. Perhaps it would be worth noting that it occurs

Re: [ovs-dev] [PATCH ovn v3 1/2] ovn-controller: fixed ovn-installed not always properly added or removed.

2023-04-20 Thread Xavier Simonart
As a note: The newly added system test sometimes fails as it is finding some warnings in the controller.log (e.g. 2023-04-19T13:18:29.536Z|00087|if_status|WARN|Trying to release unknown interface lsp1) This can happen in the following scenario: - logical port is created - OVS interfaces is added w

Re: [ovs-dev] [PATCH ovn 1/2] tests: define fmt_pkt function to construct packets with scapy

2023-04-20 Thread Dumitru Ceara
Hi Ihar, Simon, This is not very pretty but would it improve the situation (not even importing scapy anymore)? fmt_pkt() { echo "import binascii; \ out = binascii.hexlify(raw($1)); \ out.decode()" | scapy -H 2> /dev/null | awk '{print $4}' | cut -f 2 -d "'" } Re

Re: [ovs-dev] [PATCH ovn 1/2] tests: define fmt_pkt function to construct packets with scapy

2023-04-20 Thread Ihar Hrachyshka
IANAL but I don't think it's more of a problem than e.g. autoconf being GPL. (It's not.) We don't link with scapy, and it's only used in test suite. (Also, scapy was already used in the test suite before the patch.) On Thu, Apr 20, 2023 at 8:36 AM Simon Horman wrote: > > On Wed, Apr 12, 2023 at

Re: [ovs-dev] [PATCH ovn 1/2] tests: define fmt_pkt function to construct packets with scapy

2023-04-20 Thread Simon Horman
On Wed, Apr 12, 2023 at 01:29:48AM +, Ihar Hrachyshka wrote: > Scapy allows to define packets in descriptive form that is easier to > digest and debug. > > Signed-off-by: Ihar Hrachyshka > --- > tests/ovn-macros.at | 23 +++ > 1 file changed, 23 insertions(+) > > diff --

Re: [ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread David Marchand
On Thu, Apr 20, 2023 at 2:06 PM Simon Horman wrote: > > I do see CI failures, but I think these are false negatives: > > > > * > > https://patchwork.ozlabs.org/project/openvswitch/patch/3f70ca7bafad296e18ed9579f30fd7044c47fc61.ca...@cloudandheat.com/ > > > > I'm retrying the GitHub based jobs her

Re: [ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread Simon Horman
On Thu, Apr 20, 2023 at 01:35:59PM +0200, Simon Horman wrote: > On Thu, Apr 20, 2023 at 10:14:14AM +0200, Stefan Hoffmann wrote: > > In some cases ovsdb server or relay gets restarted, ovsdb python clients > > may keep the local socket open. Instead of reconnecting a lot of failures > > will be log

Re: [ovs-dev] [Patch ovn v2] pinctrl: fix restart of controller when bfd min_tx set to 1

2023-04-20 Thread Ales Musil
On Thu, Apr 20, 2023 at 11:23 AM wangchuanlei wrote: > Signed-off-by: wangchuanlei > --- > controller/pinctrl.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/controller/pinctrl.c b/controller/pinctrl.c > index 795847729..97a5e392f 100644 > --- a/controller/pinctrl.

Re: [ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread Simon Horman
On Thu, Apr 20, 2023 at 10:14:14AM +0200, Stefan Hoffmann wrote: > In some cases ovsdb server or relay gets restarted, ovsdb python clients > may keep the local socket open. Instead of reconnecting a lot of failures > will be logged. > This can be reproduced with ssl connections to the server/relay

Re: [ovs-dev] [PATCH 1/2] conntrack: Do not defer connection clean up.

2023-04-20 Thread Paolo Valerio
Aaron Conole writes: > Paolo Valerio writes: > >> Connections that need to be removed, e.g. while forcing a direction, >> were invalidated forcing them to be expired. >> This is not actually needed, as it's typically a one-time >> operation. >> The patch replaces a call to conn_force_expire() wi

[ovs-dev] [Patch ovn v2] pinctrl: fix restart of controller when bfd min_tx set to 1

2023-04-20 Thread wangchuanlei
Signed-off-by: wangchuanlei --- controller/pinctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 795847729..97a5e392f 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -7190,7 +7190,9 @@ bfd_monitor_send_ms

Re: [ovs-dev] [PATCH v2 2/2] * netdev-dpdk: Add support for userspace port-based ingress packet-per-second policing.

2023-04-20 Thread Simon Horman
On Sun, Apr 09, 2023 at 07:15:09PM +0800, mit...@outlook.com wrote: > From: Lin Huang > > OvS has supported packet-per-second policer which can be set at ingress and > egress > side in kernel datapath. But the userspace datapath dosen't support for > ingress and > egress packet-per-second polic

Re: [ovs-dev] [PATCH v2 1/2] * netdev-dpdk: Add support for userspace port-based egress packet-per-second policing.

2023-04-20 Thread Simon Horman
Hi Lin Huang, thanks for your patch. On Sun, Apr 09, 2023 at 07:15:08PM +0800, mit...@outlook.com wrote: > From: Lin Huang > > OvS has supported packet-per-second policer which can be set at ingress and > egress > side in kernel datapath. But the userspace datapath dosen't support for > ingre

[ovs-dev] [PATCH] python-stream: handle SSL error in do_handshake

2023-04-20 Thread Stefan Hoffmann
In some cases ovsdb server or relay gets restarted, ovsdb python clients may keep the local socket open. Instead of reconnecting a lot of failures will be logged. This can be reproduced with ssl connections to the server/relay and restarting it, so it has the same IP after restart. This patch catc

Re: [ovs-dev] [Patch ovn] pinctrl: fix restart of controller when bfd min_tx set to 1

2023-04-20 Thread wangchuanlei
On Mon, Apr 17, 2023 at 10:16???AM wangchuanlei wrote: when create bfd entry, set min_tx to 1, (tx_timeout * 25)/100 is zero, which cause controller to restart! Signed-off-by: wangchuanlei Hi, --- controller/pinctrl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/controller/pinctrl.c b/

Re: [ovs-dev] [PATCH] dpif-netdev : Fix typo in comments.

2023-04-20 Thread Simon Horman
On Tue, Apr 26, 2022 at 07:15:59AM -0400, 0-day Robot wrote: > Bleep bloop. Greetings lin huang, 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: > error: corrupt patch at

[ovs-dev] [PATCH] netdev-offload: Fix deadlock/recursive use of the netdev_hmap_rwlock rwlock.

2023-04-20 Thread Eelco Chaudron
When doing performance testing with OVS v3.1 we ran into a deadlock situation with the netdev_hmap_rwlock read/write lock. After some debugging, it was discovered that the netdev_hmap_rwlock read lock was taken recursively. And well in the folowing sequence of events: netdev_ports_flow_get() I