Re: [ovs-dev] [PATCH v3] Add Support for 802.1qad (qinq) Allows TPID of 0x88a8

2014-04-17 Thread Avinash
Hi, Thanks Tom for the patch. The patch is clear and concise. We are looking forward for the testing results of the working patch. Currently, if a VLAN packet is received by the openvswitch, where the input switch port is having vlan_mode as: a. trunk, the packet is forwarded to the respective de

Re: [ovs-dev] [PATCH] lib/ofp-util: Restore the check for minus sign in port number strings.

2014-04-17 Thread Justin Pettit
It might be useful to print the port string that was handed to it, since the other errors in that function do that.  Something like:   VLOG_WARN("port %s is a negative value, which is not a valid port number", s); Assuming that seems reasonable to you and Zoltan thinks it would prevent the issu

[ovs-dev] [PATCH] ofproto-dpif-upcall: Don't use stack garbage

2014-04-17 Thread YAMAMOTO Takashi
Catched by "learning action - self-modifying flow with hard_timeout" test case. The bug introduced by commit b256dc52. ("ofproto-dpif-xlate: Cache xlate_actions() effects.") Signed-off-by: YAMAMOTO Takashi --- ofproto/ofproto-dpif-upcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [ovs-dev] OpenFlow rule deletion during port destroy

2014-04-17 Thread Jarno Rajahalme
On Apr 17, 2014, at 11:26 AM, Zoltan Kiss wrote: > On 16/04/14 18:00, Justin Pettit wrote: >> On April 16, 2014 at 9:00:15 AM, Zoltan Kiss (zoltan.k...@citrix.com) wrote: >> >>> My actual problem is that an important rule gets deleted: >>> >>> cookie=0x0, duration=1581.083s, table=0, n_packets

[ovs-dev] [PATCH 3/5] lib/flow: Possibly faster miniflow_hash_in_minimask()

2014-04-17 Thread Jarno Rajahalme
Upcoming patches add classifier lookups using miniflows, this is heavily used for it. Signed-off-by: Jarno Rajahalme --- lib/flow.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/flow.c b/lib/flow.c index c6e5e07..03d86ae 100644 --- a/lib/flow.c +

[ovs-dev] [PATCH 2/5] lib/flow: Add miniflow accessors and miniflow_get_tcp_flags().

2014-04-17 Thread Jarno Rajahalme
Add inlined generic accessors for miniflow integer type fields, and a new miniflow_get_tcp_flags() usinge these. These will be used in a later patch. Some definitions also used in lib/packets.h had to be moved there to resolve circular include dependencies. Similarly, some inline functions using

[ovs-dev] [PATCH 5/5] dpif-netdev: Use miniflow as a flow key.

2014-04-17 Thread Jarno Rajahalme
Use miniflow as a flow key in the userspace datapath classifier. The miniflow is expanded for upcalls, but for existing datapath flows, the key need not be expanded. Signed-off-by: Jarno Rajahalme --- lib/dpif-netdev.c | 52 +--- lib/flow.c

[ovs-dev] [PATCH 4/5] classifier: Support miniflow as a key.

2014-04-17 Thread Jarno Rajahalme
Support struct miniflow as a key for datapath flow lookup. The new classifier interface classifier_lookup_miniflow_first() takes a miniflow as a key and stops at the first match with no regard to flow prioritites. This works only if the classifier has no conflicting rules (as is the case with the

[ovs-dev] [PATCH] lib/ofp-util: Restore the check for minus sign in port number strings.

2014-04-17 Thread Jarno Rajahalme
Commit 33ab38d9 (meta-flow: Simplify mf_from_ofp_port_string()) inadvertently removed a check for minus sign at the beginning of a port number string introduced by commit 05dddba (meta-flow: Don't allow negative port numbers). This check is still needed, so put it back, but to ofputil_port_from_st

[ovs-dev] [PATCH 1/5] lib/flow: Introduce miniflow_extract().

2014-04-17 Thread Jarno Rajahalme
miniflow_extract() extracts packet headers directly to a miniflow, which is a compressed form of the struct flow. This does not require a large struct to be cleared to begin with, and accesses less memory. These performance benefits should allow this to be used in the DPDK datapath. miniflow_extr

[ovs-dev] [PATCH 0/5] lib: Extract packet to a miniflow

2014-04-17 Thread Jarno Rajahalme
Userspace datapath can be made faster by streamlining the flow extraction code. We already use miniflows internally within the classifier. This series of patches changes flow extraction to use miniflow directly, and then also use the extracted miniflow as a lookup key in the classifier. This mea

[ovs-dev] [PATCH V9 2/3] dpif-linux: Pass 'struct dpif_linux *' to internal static functions.

2014-04-17 Thread Alex Wang
This commit reformats the dpif-linux module so that all internal static functions take 'struct dpif_linux *' as input argument. This will allow the adding of thread-safety annotations. Signed-off-by: Alex Wang --- V9: - necessary changes for adding thread-safety annotations. --- lib/dpif-linux.

[ovs-dev] [PATCH V9 3/3] dpif-linux: Add thread-safety annotations.

2014-04-17 Thread Alex Wang
Signed-off-by: Alex Wang --- V9: - add thread-safety annotations. --- lib/dpif-linux.c | 60 +- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index b70ddef..a575b78 100644 --- a/lib/dpif-l

[ovs-dev] [PATCH V9 1/3] dpif-linux: Implement the API functions to allow multiple handler threads read upcall.

2014-04-17 Thread Alex Wang
Signed-off-by: Alex Wang --- V8 -> v9: - move the fat-lock acquisition inside the if-statement in dpif_linux_run(). - fix an error: dpif_linux_recv_purge() should acquire wrlock. V7 -> V8: - rebase. V6 -> V7: - rebase. - set n_handlers to 0 in destroy_all_channels(). - fix the indexing error in

Re: [ovs-dev] [PATCH 2/2] ofproto-dpif-upcall: Remove the dispatcher thread.

2014-04-17 Thread Ethan Jackson
I'd remove the comment about the flow dumper being removed in future. Doesn't really fit as a code comment. The comment to upcall_destroy() is rather weird, that function doesn't know how it's allocated. At any rate, there's only one caller, I'd be inclined to just get rid of that function and do

Re: [ovs-dev] [PATCH 1/2] dpif-linux: Implement the API functions to allow multiple handler threads read upcall.

2014-04-17 Thread Ethan Jackson
All that sounds good to me, go ahead and add my acked by then. Acked-by: Ethan Jackson On Thu, Apr 17, 2014 at 4:04 PM, Alex Wang wrote: > Thx for the review, Ethan, > > > On Thu, Apr 17, 2014 at 3:50 PM, Ethan Jackson wrote: >> >> I don't like that dpif_linux_run() has to take the write lock

Re: [ovs-dev] [PATCH 1/2] dpif-linux: Implement the API functions to allow multiple handler threads read upcall.

2014-04-17 Thread Ethan Jackson
I don't like that dpif_linux_run() has to take the write lock every time it's called. Maybe you could make the dpif->refresh_channels variable atomic, check it, and only take the lock if it's true? I think a lot of these functions could use annotations saying whether they require a read/write loc

Re: [ovs-dev] [recirc datapath V3 RFC 1/2] datapath: add hash action

2014-04-17 Thread Andy Zhou
On Thu, Apr 17, 2014 at 2:48 PM, Jesse Gross wrote: > On Wed, Apr 16, 2014 at 11:49 PM, Andy Zhou wrote: >> diff --git a/datapath/actions.c b/datapath/actions.c >> index 82cfd2d..820075f 100644 >> --- a/datapath/actions.c >> +++ b/datapath/actions.c >> +static void execute_hash(struct sk_buff *sk

Re: [ovs-dev] [recirc datapath V3 RFC 2/2] datapath: add recirc action

2014-04-17 Thread Jesse Gross
On Wed, Apr 16, 2014 at 11:49 PM, Andy Zhou wrote: > diff --git a/datapath/actions.c b/datapath/actions.c > index 820075f..9307ee1 100644 > --- a/datapath/actions.c > +++ b/datapath/actions.c > +static int execute_recirc(struct datapath *dp, struct sk_buff *skb, > +

Re: [ovs-dev] [recirc datapath V3 RFC 1/2] datapath: add hash action

2014-04-17 Thread Jesse Gross
On Wed, Apr 16, 2014 at 11:49 PM, Andy Zhou wrote: > diff --git a/datapath/actions.c b/datapath/actions.c > index 82cfd2d..820075f 100644 > --- a/datapath/actions.c > +++ b/datapath/actions.c > +static void execute_hash(struct sk_buff *skb, const struct nlattr *attr) > +{ > + struct sw_flow_

Re: [ovs-dev] [recirculation 2/3] datapath: add hash action

2014-04-17 Thread Jesse Gross
On Wed, Apr 16, 2014 at 7:45 PM, Pravin Shelar wrote: > On Thu, Apr 17, 2014 at 8:12 AM, Jesse Gross wrote: >> On Wed, Apr 16, 2014 at 7:39 PM, Pravin Shelar wrote: >>> On Wed, Apr 16, 2014 at 2:09 AM, Andy Zhou wrote: Thanks for the review. I will send V2. On Tue, Apr 15, 2014 a

Re: [ovs-dev] [PATCH V3 2/2] bridge: Remove the 'Instant' stats.

2014-04-17 Thread Alex Wang
> > @@ -2481,8 +2436,17 @@ bridge_wait(void) >>> poll_timer_wait_until(iface_stats_timer); >>> } >>> >>> +/* If the status database transaction is "TXN_INCOMPLETE" in this >>> run, >>> + * register a timeout in "STATUS_CHECK_AGAIN_MSEC". Else, wait on >>> the >>> + * glo

[ovs-dev] [PATCH V4 3/3] bridge: Remove the 'Instant' stats.

2014-04-17 Thread Alex Wang
This commit removes the 'Instant' stats related logic in bridge.c. Instead, the corresponding status is updated immediately after the global connectivity sequence number changes. This change brings the following effects: 1. There is no change to the database update speed, since both the master

[ovs-dev] [PATCH V4 2/3] ofproto-dpif: Use sequence number to wake up main thread for packet-in I/O.

2014-04-17 Thread Alex Wang
This commit adds per 'struct ofproto_dpif' sequence number for packet-in I/O. Whenever a packet-in is inserted into the 'pins' queue, the inserting thread will change the sequence number to wake up the main thread. Signed-off-by: Alex Wang --- V4: - this is a functional change separated from th

[ovs-dev] [PATCH V4 1/3] bfd/cfm: Check status change before update status to database.

2014-04-17 Thread Alex Wang
This commit adds boolean flag in bfd/cfm module for checking status change. If there is no status change, the current update to OVS database will skip the bfd/cfm session. In the experiment with 5K bfd sessions, when one session is flapping at rate of every 0.3 second, this patch reduces the cpu

Re: [ovs-dev] [PATCHv10] ofproto-dpif: Remove the flow_dumper thread.

2014-04-17 Thread Ethan Jackson
Someone other than me needs to review this as I co-authored it. Jarno, do you have time to look at it? Ethan On Wed, Apr 16, 2014 at 9:06 PM, Joe Stringer wrote: > From: Ethan Jackson > > Previously, we had a separate flow_dumper thread that fetched flows from > the datapath to distribute to re

Re: [ovs-dev] OpenFlow rule deletion during port destroy

2014-04-17 Thread Zoltan Kiss
On 16/04/14 18:00, Justin Pettit wrote: On April 16, 2014 at 9:00:15 AM, Zoltan Kiss (zoltan.k...@citrix.com) wrote: My actual problem is that an important rule gets deleted: cookie=0x0, duration=1581.083s, table=0, n_packets=52804, n_bytes=88968151, idle_age=0, priority=0,in_port=ANY actions=

Re: [ovs-dev] [patch net-next RFC v3 02/10] net: rename netdev_phys_port_id to more generic name

2014-04-17 Thread Jiri Pirko
Thu, Apr 17, 2014 at 05:01:10PM CEST, step...@networkplumber.org wrote: >On Thu, 17 Apr 2014 14:14:29 +0200 >Jiri Pirko wrote: > >> So this can be reused for identification of other "items" as well. >> >> Signed-off-by: Jiri Pirko >> --- >> drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2

Re: [ovs-dev] [patch net-next RFC v3 02/10] net: rename netdev_phys_port_id to more generic name

2014-04-17 Thread Stephen Hemminger
On Thu, 17 Apr 2014 14:14:29 +0200 Jiri Pirko wrote: > So this can be reused for identification of other "items" as well. > > Signed-off-by: Jiri Pirko > --- > drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- > drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- > drivers/net/et

Re: [ovs-dev] [patch iproute2 RFC v3 4/5] iproute2: add support for dummyswport

2014-04-17 Thread Nicolas Dichtel
Le 17/04/2014 14:17, Jiri Pirko a écrit : Signed-off-by: Jiri Pirko --- include/linux/if_link.h | 9 ip/Makefile | 3 ++- ip/iplink_dummyswport.c | 56 + 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100

Re: [ovs-dev] [patch net-next RFC v3 04/10] rtnl: expose physical switch id for particular device

2014-04-17 Thread Yegor Yefremov
On Thu, Apr 17, 2014 at 2:14 PM, Jiri Pirko wrote: > The the netdevice represents a port in a switch, it will expose remove one 'the' > IFLA_PHYS_SWITCH_ID value via rtnl. Two netdevices with a same value s/a same/the same > belong to one physical switch. > > Signed-off-by: Jiri Pirko Review

[ovs-dev] [patch iproute2 RFC v3 5/5] iproute2: ipa: show port id

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- ip/ipaddress.c | 8 1 file changed, 8 insertions(+) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 43f7296..f794d02 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -470,6 +470,14 @@ int print_linkinfo(const struct sockaddr_nl *who, f

[ovs-dev] [patch iproute2 RFC v3 4/5] iproute2: add support for dummyswport

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- include/linux/if_link.h | 9 ip/Makefile | 3 ++- ip/iplink_dummyswport.c | 56 + 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 ip/iplink_dummyswport.c diff --git a/include

[ovs-dev] [patch iproute2 RFC v3 2/5] iproute2: utils: change hexstring_n2a and hexstring_a2n to do not work with ":"

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- lib/utils.c | 46 +- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index 4e9c719..e9e1040 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -743,10 +743,6 @@ char *hexstring_n2a(const

[ovs-dev] [patch iproute2 RFC v3 1/5] iproute2: arpd: use ll_addr_a2n and ll_addr_n2a

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- misc/arpd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/arpd.c b/misc/arpd.c index bfe7de9..0839e3f 100644 --- a/misc/arpd.c +++ b/misc/arpd.c @@ -36,6 +36,7 @@ #include "libnetlink.h" #include "utils.h" +#include "rt_names.h"

[ovs-dev] [patch iproute2 RFC v3 3/5] iproute2: ipa: show switch id

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- include/linux/if_link.h | 2 ++ ip/ipaddress.c | 8 2 files changed, 10 insertions(+) diff --git a/include/linux/if_link.h b/include/linux/if_link.h index f08505c..2932453 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h @@ -144,6

[ovs-dev] [patch net-next RFC v3 0/5] iproute2: support switch chip infrastructure

2014-04-17 Thread Jiri Pirko
Jiri Pirko (5): iproute2: arpd: use ll_addr_a2n and ll_addr_n2a iproute2: utils: change hexstring_n2a and hexstring_a2n to do not work with ":" iproute2: ipa: show switch id iproute2: add support for dummyswport iproute2: ipa: show port id include/linux/if_link.h | 11 ++ ip

[ovs-dev] [patch net-next RFC v3 06/10] net: introduce dummy switch

2014-04-17 Thread Jiri Pirko
Dummy switch implementation using switchdev interface Signed-off-by: Jiri Pirko --- drivers/net/Kconfig | 7 +++ drivers/net/Makefile | 1 + drivers/net/dummyswitch.c| 126 +++ include/uapi/linux/if_link.h | 9 4 files chang

[ovs-dev] [patch net-next RFC v3 09/10] openvswitch: introduce vport_op get_netdev

2014-04-17 Thread Jiri Pirko
This will allow to query easily if the vport has netdev. Also it allows to unexpose netdev_vport_priv and struct netdev_vport. Signed-off-by: Jiri Pirko --- net/openvswitch/datapath.c | 2 +- net/openvswitch/dp_notify.c | 7 ++--- net/openvswitch/vport-internal_dev.c | 53 ++

[ovs-dev] [patch net-next RFC v3 08/10] net: add netdev_for_each_all_lower_dev_rcu helper

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- include/linux/netdevice.h | 18 +- net/core/dev.c| 26 ++ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 14bd8b3..bee9673 100644 --- a/in

[ovs-dev] [patch net-next RFC v3 10/10] openvswitch: add support for datapath hardware offload

2014-04-17 Thread Jiri Pirko
Benefit from the possibility to work with flows in switch devices and use the swdev api to offload flow datapath. Signed-off-by: Jiri Pirko --- include/linux/sw_flow.h | 16 +++- net/openvswitch/Makefile | 3 +- net/openvswitch/datapath.c | 16 +++- net/openvswitch/hw_offload.c |

[ovs-dev] [patch net-next RFC v3 05/10] switchdev: introduce basic support for flows

2014-04-17 Thread Jiri Pirko
This patch adds a couple of ndos which can be used to work with flows. Note that user can use random port netdevice to access the switch. Signed-off-by: Jiri Pirko --- include/linux/netdevice.h | 30 include/linux/switchdev.h | 25 net/core/switchdev

[ovs-dev] [patch net-next RFC v3 07/10] dsa: implement ndo_swdev_get_id

2014-04-17 Thread Jiri Pirko
Signed-off-by: Jiri Pirko --- net/dsa/slave.c | 16 1 file changed, 16 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 02c0e17..22855f3 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -171,6 +171,19 @@ static int dsa_slave_ioctl(struct net_device *dev, s

[ovs-dev] [patch net-next RFC v3 04/10] rtnl: expose physical switch id for particular device

2014-04-17 Thread Jiri Pirko
The the netdevice represents a port in a switch, it will expose IFLA_PHYS_SWITCH_ID value via rtnl. Two netdevices with a same value belong to one physical switch. Signed-off-by: Jiri Pirko --- include/uapi/linux/if_link.h | 1 + net/core/rtnetlink.c | 26 +- 2 f

[ovs-dev] [patch net-next RFC v3 00/10] introduce infrastructure for support of switch chip datapath

2014-04-17 Thread Jiri Pirko
The basic idea is to introduce a generic infractructure to support various switch chips in kernel. The current patchset RFC is a heavy rework of the previous ones. The goal is to be low-intrusive and to use as much as possible from the existing infrastructure. Also the idea is to benefit from cur

[ovs-dev] [patch net-next RFC v3 03/10] net: introduce generic switch devices support

2014-04-17 Thread Jiri Pirko
The goal of this is to provide a possibility to suport various switch chips. Drivers should implement relevant ndos to do so. So far, only one ndo for getting physical switch id is in place. Signed-off-by: Jiri Pirko --- Documentation/networking/switchdev.txt | 53 +++

[ovs-dev] [patch net-next RFC v3 01/10] openvswitch: split flow structures into ovs specific and generic ones

2014-04-17 Thread Jiri Pirko
After this, flow related structures can be used in other code. Signed-off-by: Jiri Pirko --- include/linux/sw_flow.h| 108 net/openvswitch/datapath.c | 45 +++ net/openvswitch/datapath.h | 4 +- net/openvswitch/flow.c |

Re: [ovs-dev] [PATCH v2 3/3] datapath: add layer 3 flow/port support

2014-04-17 Thread thomas.morin
Hi Lori, all, While I've attempted to adapt the layer 3 port patch to GRE tunneling, and obtained nice results for IP-over-GRE (as I reported last week), I've had a harder time reusing this framework for -over-GRE, in particular for MPLS-over-GRE. Given its name, I maybe shouldn't have expecte