Re: [ovs-dev] [PATCH v7 3/7] ovn: Introduce "chassisredirect" port binding

2017-01-08 Thread Mickey Spiegel
On Fri, Jan 6, 2017 at 8:31 PM, Mickey Spiegel wrote: > > On Fri, Jan 6, 2017 at 4:21 PM, Mickey Spiegel > wrote: > >> >> On Fri, Jan 6, 2017 at 4:11 PM, Ben Pfaff wrote: >> >>> On Fri, Jan 06, 2017 at 03:47:03PM -0800, Mickey Spiegel

Re: [ovs-dev] [PATCH 2/4] datapath: Limits the number of tx/rx queues for netdev-dummy.

2017-01-08 Thread nickcooper-zhangtonghao
Thanks Daniele, Yes, it’s a small improvement. but it is necessary for us. I will check it in set_config(). One question to ask: should we check the tx/rx queue for netdev-dpdk in set_config()? Now we check it in dpdk_eth_dev_init(). Thanks. > On Jan 9, 2017, at 11:22 AM, Daniele Di

Re: [ovs-dev] [PATCH 4/4] datapath: Uses the OVS_CORE_UNSPEC instead of magic numbers.

2017-01-08 Thread Daniele Di Proietto
2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao : > This patch uses OVS_CORE_UNSPEC for the queue unpinned instead > of "-1". More important, the "-1" casted to unsigned int is > equal to NON_PMD_CORE_ID. We make the distinction between them. > > Signed-off-by:

Re: [ovs-dev] [PATCH 3/4] datapath: Uses the NR_QUEUE instead of magic numbers.

2017-01-08 Thread Daniele Di Proietto
2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao : > The NR_QUEUE is defined in "lib/dpif-netdev.h", netdev-dpdk > uses it instead of magic number. netdev-dummy should be > in the same case. > > Signed-off-by: nickcooper-zhangtonghao Thanks, I changed

Re: [ovs-dev] [PATCH 2/4] datapath: Limits the number of tx/rx queues for netdev-dummy.

2017-01-08 Thread Daniele Di Proietto
2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao : > This patch avoids the ovs_rcu to report WARN, caused by blocked > for a long time, when ovs-vswitchd processes a port with many > rx/tx queues. The number of tx/rx queues per port may be appropriate, > because the dpdk

[ovs-dev] [PATCH v2] dpdk: Late initialization.

2017-01-08 Thread Daniele Di Proietto
With this commit, we allow the user to set other_config:dpdk-init=true after the process is started. This makes it easier to start Open vSwitch with DPDK using standard init scripts without restarting the service. This is still far from ideal, because initializing DPDK might still abort the

Re: [ovs-dev] [PATCH 1/4] datapath: Fix formatting typo.

2017-01-08 Thread Daniele Di Proietto
2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao : > Signed-off-by: nickcooper-zhangtonghao Thanks, I changed the prefix to netdev-dpdk (instead of datapath) and pushed this to master > --- > lib/netdev-dpdk.c | 2 +- > 1 file changed, 1

[ovs-dev] [PATCH v3 16/18] dpif-netdev: Use hmap for poll_list in pmd threads.

2017-01-08 Thread Daniele Di Proietto
A future commit will use this to determine if a queue is already contained in a pmd thread. To keep the behavior unaltered we now have to sort queues before printing them in pmd_info_show_rxq(). Also this commit introduces 'struct polled_queue' that will be used exclusively in the fast path,

[ovs-dev] [PATCH v3 18/18] ovs-numa: Remove unused functions.

2017-01-08 Thread Daniele Di Proietto
ovs-numa doesn't need to keep the state of the pmd threads, it is an implementation detail of dpif-netdev. Signed-off-by: Daniele Di Proietto --- lib/ovs-numa.c | 175 - lib/ovs-numa.h | 7 --- 2 files changed,

[ovs-dev] [PATCH v3 11/18] dpctl: Avoid making assumptions on pmd threads.

2017-01-08 Thread Daniele Di Proietto
Currently dpctl depends on ovs-numa module to delete and create flows on different pmd threads for pmd devices. The next commits will move away the pmd threads state from ovs-numa to dpif-netdev, so the ovs-numa interface will not be supported. Also, the assignment between ports and thread is an

[ovs-dev] [PATCH v3 15/18] ovs-numa: Add per numa and global counts in dump.

2017-01-08 Thread Daniele Di Proietto
They will be used by a future commit. Suggested-by: Ilya Maximets Signed-off-by: Daniele Di Proietto --- lib/ovs-numa.c | 96 +- lib/ovs-numa.h | 18 +-- 2 files changed, 77

[ovs-dev] [PATCH v3 14/18] ovs-numa: Don't use hmap_first_with_hash().

2017-01-08 Thread Daniele Di Proietto
I think it's better to iterate the hmap than to use hmap_first_with_hash(), because it handles hash collisions. Signed-off-by: Daniele Di Proietto --- lib/ovs-numa.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git

[ovs-dev] [PATCH v3 12/18] ovs-numa: New ovs_numa_dump_contains_core() function.

2017-01-08 Thread Daniele Di Proietto
It will be used by a future commit. struct ovs_numa_dump now uses an hmap instead of a list to make ovs_numa_dump_contains_core() more efficient. Signed-off-by: Daniele Di Proietto --- lib/ovs-numa.c | 25 ++--- lib/ovs-numa.h | 10 ++ 2

[ovs-dev] [PATCH v3 10/18] dpif-netdev: Make 'static_tx_qid' const.

2017-01-08 Thread Daniele Di Proietto
Since previous commit, 'static_tx_qid' doesn't need to be atomic and is actually never touched (except for initialization), so it can be made const. Signed-off-by: Daniele Di Proietto --- lib/dpif-netdev.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-)

[ovs-dev] [PATCH v3 09/18] dpif-netdev: Create pmd threads for every numa node.

2017-01-08 Thread Daniele Di Proietto
A lot of the complexity in the code that handles pmd threads and ports in dpif-netdev is due to the fact that we postpone the creation of pmd threads on a numa node until we have a port that needs to be polled on that particular node. Since the previous commit, a pmd thread with no ports will not

[ovs-dev] [PATCH v3 13/18] ovs-numa: Add new dump types.

2017-01-08 Thread Daniele Di Proietto
They will be used by a future commit. This patch introduces some code duplication which will be removed in a future commit. Signed-off-by: Daniele Di Proietto --- lib/ovs-numa.c | 78 ++ lib/ovs-numa.h | 4 ++- 2

[ovs-dev] [PATCH v3 08/18] dpif-netdev: Block pmd threads if there are no ports.

2017-01-08 Thread Daniele Di Proietto
There's no reason for a pmd thread to perform its main loop if there are no queues in its poll_list. This commit introduces a seq object on which the pmd thread can be blocked, if there are no queues. When the main thread wants to reload a pmd threads it must now change the seq object (in case

[ovs-dev] [PATCH v3 07/18] dpif-netdev: Use a boolean instead of pmd->port_seq.

2017-01-08 Thread Daniele Di Proietto
There's no need for a sequence number, since the main thread has to wait for the pmd thread, so there's no chance that an update will be undetected. A seq object will be introduced for another purpose in the next commit, and changing this to boolean makes the code more readable. Signed-off-by:

[ovs-dev] [PATCH v3 06/18] netdev-dpdk: Refactor construct and destruct.

2017-01-08 Thread Daniele Di Proietto
Some refactoring for _construct() and _destruct() methods: * Rename netdev_dpdk_init() to common_construct(). init() has a different meaning in the netdev context. * Remove DPDK_DEV_ETH and DPDK_DEV_VHOST checks in common_construct() and move them to different functions * Introduce

[ovs-dev] [PATCH v3 03/18] dpif-netdev: Don't try to output on a device without txqs.

2017-01-08 Thread Daniele Di Proietto
Tunnel devices have 0 txqs and don't support netdev_send(). While netdev_send() simply returns EOPNOTSUPP, the XPS logic is still executed on output, and that might be confused by devices with no txqs. It seems better to have different structures in the fast path for ports that support

[ovs-dev] [PATCH v3 05/18] netdev-dpdk: Start also dpdkr devices only once on port-add.

2017-01-08 Thread Daniele Di Proietto
Since commit 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming"), we don't call rte_eth_start() from netdev_open() anymore, we only call it from netdev_reconfigure(). This commit does that also for 'dpdkr' devices, and remove some useless code. Calling rte_eth_start() also from

[ovs-dev] [PATCH v3 04/18] netdev-dpdk: Don't call rte_dev_stop() in update_flags().

2017-01-08 Thread Daniele Di Proietto
Calling rte_eth_dev_stop() while the device is running causes a crash. We could use rte_eth_dev_set_link_down(), but not every PMD implements that, and I found one NIC where that has no effect. Instead, this commit checks if the device has the NETDEV_UP flag when transmitting or receiving

[ovs-dev] [PATCH v3 01/18] dpif-netdev: Fix memory leak.

2017-01-08 Thread Daniele Di Proietto
We keep all the per-port classifiers around, since they can be reused, but when a pmd thread is destroyed we should free them. Found using valgrind. Fixes: 3453b4d62a98("dpif-netdev: dpcls per in_port with sorted subtables") Signed-off-by: Daniele Di Proietto ---

[ovs-dev] [PATCH v3 02/18] dpif-netdev: Take non_pmd_mutex to access tx cached ports.

2017-01-08 Thread Daniele Di Proietto
As documented in dp_netdev_pmd_thread, we must take non_pmd_mutex to access the tx port caches for the non pmd thread. Found by inspection. Signed-off-by: Daniele Di Proietto --- lib/dpif-netdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dpif-netdev.c

[ovs-dev] [PATCH 4/4] datapath: Uses the OVS_CORE_UNSPEC instead of magic numbers.

2017-01-08 Thread nickcooper-zhangtonghao
This patch uses OVS_CORE_UNSPEC for the queue unpinned instead of "-1". More important, the "-1" casted to unsigned int is equal to NON_PMD_CORE_ID. We make the distinction between them. Signed-off-by: nickcooper-zhangtonghao --- lib/dpif-netdev.c | 12 ++-- 1 file

[ovs-dev] [PATCH 3/4] datapath: Uses the NR_QUEUE instead of magic numbers.

2017-01-08 Thread nickcooper-zhangtonghao
The NR_QUEUE is defined in "lib/dpif-netdev.h", netdev-dpdk uses it instead of magic number. netdev-dummy should be in the same case. Signed-off-by: nickcooper-zhangtonghao --- lib/netdev-dummy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[ovs-dev] [PATCH 1/4] datapath: Fix formatting typo.

2017-01-08 Thread nickcooper-zhangtonghao
Signed-off-by: nickcooper-zhangtonghao --- lib/netdev-dpdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 625f425..376aa4d 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -738,7 +738,7 @@

Re: [ovs-dev] Sync on PTAP, EXT-382 and NSH

2017-01-08 Thread Jan Scheurich
Hi Yi, I fully agree that support for NSH has been dragging along for to long. The prime reason for this (in addition to the dependency on the L3 tunneling) have been the mentioned conceptual problems with the current patches. Our initiative is the attempt to put NSH on a solid basis in

[ovs-dev] [PATCH v8 7/8] ovn: avoid snat recirc only on gateway routers

2017-01-08 Thread Mickey Spiegel
Currently, for performance reasons on gateway routers, ct_snat that does not specify an IP address does not immediately trigger recirculation. On gateway routers, ct_snat that does not specify an IP address happens in the UNSNAT pipeline stage, which is followed by the DNAT pipeline stage that

[ovs-dev] [PATCH v8 6/8] ovn: move load balancing flows after NAT flows

2017-01-08 Thread Mickey Spiegel
This will make it easy for distributed NAT to reuse some of the existing code for NAT flows, while leaving load balancing and defrag as functionality specific to gateway routers. There is no intent to change any functionality in this patch. Signed-off-by: Mickey Spiegel

[ovs-dev] [PATCH v8 4/8] ovn: Introduce distributed gateway port and "chassisredirect" port binding

2017-01-08 Thread Mickey Spiegel
Currently OVN distributed logical routers achieve reachability to physical networks by passing through a "join" logical switch to a centralized gateway router, which then connects to another logical switch that has a localnet port connecting to the physical network. This patch adds logical port

[ovs-dev] [PATCH v8 5/8] ovn: add egress loopback capability

2017-01-08 Thread Mickey Spiegel
This patch adds the capability to force loopback at the end of the egress pipeline. A new flags.force_egress_loopback symbol is defined, along with corresponding flags bits. When flags.force_egress_loopback is set, at OFTABLE_LOG_TO_PHY, instead of the packet being sent out to the peer patch

[ovs-dev] [PATCH v8 1/8] ovn: specify addresses of type "router" lsps as "router"

2017-01-08 Thread Mickey Spiegel
Currently in OVN, when a logical switch port of type "router" is created, the MAC and optionally IP addresses of the peer logical router port must be specified again as the addresses of the logical switch port. This patch allows the logical switch port's addresses to be specified as the string

[ovs-dev] [PATCH v8 2/8] ovn: document logical routers and logical patch ports in ovn-architecture

2017-01-08 Thread Mickey Spiegel
This patch adds a description of logical routers and logical patch ports, including gateway routers, to ovn/ovn-architecture.7.xml. Signed-off-by: Mickey Spiegel --- ovn/ovn-architecture.7.xml | 148 ++--- 1 file changed, 140