[ovs-dev] [CudaMailTagged] [RFC PATCH v2 4/5] Add push_nsh/pop_nsh flow actions for kernel data path

2016-07-12 Thread Johnson Li
Network Service Header is pushed to/stripped from packets with the data path flow actions push_nsh and pop_nsh. Signed-off-by: Johnson Li diff --git a/datapath/actions.c b/datapath/actions.c index 7ef1bae..0c2927e 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -29,6 +29,7

[ovs-dev] [RFC PATCH v2 3/5] parse NSH key in key_extract of openvswitch

2016-07-12 Thread Johnson Li
Parse the Network Service Header to fullfill the fields in the struct sw_flow_key. Signed-off-by: Johnson Li diff --git a/datapath/flow.c b/datapath/flow.c index fd09cec..debac6f 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -44,6 +44,7 @@ #include #include #include +#include

[ovs-dev] [RFC PATCH v2 5/5] Add push_eth/pop_eth flow actions for kernel data path

2016-07-12 Thread Johnson Li
support paches currently being targeted at net-next by Simon Horman. Signed-off-by: Simon Horman Signed-off-by: Johnson Li diff --git a/datapath/actions.c b/datapath/actions.c index 0c2927e..eda9106 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -312,6 +312,48 @@ static int push_nsh

[ovs-dev] [CudaMailTagged] [RFC PATCH v2 2/5] NSH key attributes handling of kernel Netlink message

2016-07-12 Thread Johnson Li
The openvswitch exchange the key with key netlink message between the kernel data path and user space flow tables. Signed-off-by: Johnson Li diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c index eafaca2..e6f42ea 100644 --- a/datapath/flow_netlink.c +++ b/datapath/flow_netlink.c

[ovs-dev] [RFC PATCH v2 0/5] Datapath: add Network Service Header Support

2016-07-12 Thread Johnson Li
e kernel datapath codes, this patch set will also be sent to the net-next tree. Johnson Li (5): Add NSH fields for Openvswitch flow key NSH key attributes handling of kernel Netlink message parse NSH key in key_extract of openvswitch Add push_nsh/pop_nsh flow actions for kernel d

[ovs-dev] [RFC PATCH v2 1/5] Add NSH fields for Openvswitch flow key

2016-07-12 Thread Johnson Li
-by: Johnson Li diff --git a/datapath/flow.c b/datapath/flow.c index c97c9c9..fd09cec 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -489,6 +489,9 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key) skb_reset_mac_len(skb); __skb_push(skb, skb->d

[ovs-dev] [RFC PATCH v2 12/13] Commit push_eth/pop_eth flow action to data plane

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index f5c1888..fb3cd2e 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -5129,8 +5129,17 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len

[ovs-dev] [RFC PATCH v2 11/13] Add control plane command push_eth and pop_eth

2016-07-12 Thread Johnson Li
User can use the flow command push_eth/pop_eth command to push/ strip Ethernet header. Action formats are: actions=push_eth or actions=pop_eth. For pushing an Ethernet header with specified MAC address, "set_field" actions are required before the "push_eth" action. Si

[ovs-dev] [CudaMailTagged] [RFC PATCH v2 13/13] Format ODP action for push_eth/pop_eth flow actions

2016-07-12 Thread Johnson Li
Derived from work by Lorand Jakub and Simon Horman. Cc: Lorand Jakab Cc: Simon Horman --- This is extracted from l3 flow support paches currently being targeted at net-next by Simon Horman. Signed-off-by: Johnson Li diff --git a/lib/odp-util.c b/lib/odp-util.c index 8697e00..cc1c16d 100644

[ovs-dev] [RFC PATCH v2 10/13] Add push_eth/pop_eth flow actions for kernel data path

2016-07-12 Thread Johnson Li
support paches currently being targeted at net-next by Simon Horman. Signed-off-by: Johnson Li diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h index 896fa68..9cf8edd 100644 --- a/datapath/linux/compat/include/linux/openvswitch.h

[ovs-dev] [CudaMailTagged] [RFC PATCH v2 08/13] Add "pop_nsh/push_nsh" flow action for OVS control plane

2016-07-12 Thread Johnson Li
_port=1, ip, nw_src=192.168.0.1 \ actions=push_nsh,${Other actions}" 2) Flow rule for pop_nsh ovs-ofctl add-flow br-int "table=0, priority=260, \ in_port=xxx,actions=pop_nsh,{Other actions}" Signed-off-by: Johnson Li diff --git a/include/openvswitch/ofp-actions.h b/inc

[ovs-dev] [RFC PATCH v2 07/13] Userspace: Parse NSH header in flow_extract

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h index 52e33f6..896fa68 100644 --- a/datapath/linux/compat/include/linux/openvswitch.h +++ b/datapath/linux/compat/include/linux/openvswitch.h @@ -652,6

[ovs-dev] [CudaMailTagged] [RFC PATCH v2 09/13] commit control plane action to data plane

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 90edb56..1a63175 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -5072,8 +5072,58 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len

[ovs-dev] [RFC PATCH v2 04/13] Add APIs to set NSH keys for match fields

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h index c955753..4c79da3 100644 --- a/include/openvswitch/match.h +++ b/include/openvswitch/match.h @@ -40,6 +40,18 @@ struct match { /* Initializer for a "struct match" that matches ev

[ovs-dev] [CudaMailTagged] [RFC PATCH v2 05/13] Add Meta flow key for NSH header

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/include/openvswitch/meta-flow.h b/include/openvswitch/meta-flow.h index 84a0946..1f6277f 100644 --- a/include/openvswitch/meta-flow.h +++ b/include/openvswitch/meta-flow.h @@ -1720,6 +1720,132 @@ enum OVS_PACKED_ENUM mf_field_id { */ MFF_ND_TLL

[ovs-dev] [RFC PATCH v2 06/13] Parse NSH header in function flow_extract in user space

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/flow.c b/lib/flow.c index a4c1215..cdeccfc 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -439,6 +439,46 @@ invalid: arp_buf[1] = eth_addr_zero; } +static int +parse_nsh(const void **datap, size_t *sizep, + struct flow_nsh *key, struct

[ovs-dev] [RFC PATCH v2 03/13] Add key attributes of Network Service Header

2016-07-12 Thread Johnson Li
The openvswitch exchange the key with key netlink message between the kernel data path and user space flow tables. The key fields are defined as key attributes. Signed-off-by: Johnson Li diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux

[ovs-dev] [CudaMailTagged] [RFC PATCH v2 01/13] Add NSH keys as match fields for user space flow table

2016-07-12 Thread Johnson Li
Add NSH keys (Metadata type I only, MD type II will reuse the the fields definition tun_metadataN) as part of match fields for the user space flow table. Signed-off-by: Johnson Li diff --git a/include/openvswitch/flow.h b/include/openvswitch/flow.h index 03d406b..4fcc6f6 100644 --- a/include

[ovs-dev] [RFC PATCH v2 02/13] Format NSH keys to readable strings

2016-07-12 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/match.c b/lib/match.c index db78831..4eab67f 100644 --- a/lib/match.c +++ b/lib/match.c @@ -1031,6 +1031,52 @@ format_flow_tunnel(struct ds *s, const struct match *match) } static void +format_flow_nsh(struct ds *s, const struct match *match

[ovs-dev] [RFC PATCH v2 00/13] Add Network Service Header Support

2016-07-12 Thread Johnson Li
if this approach makes sense. 2. Add Ethernet transport support. To remove the dependency on Simon' patches for raw protocol support, we enable Ethernet as a supported NSH transport. Hence explicit flow actions push_eth/pop_eth to push

[ovs-dev] [RFC PATCH 07/14] Add APIs to set NSH keys for match fields

2016-06-15 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h index c955753..a1cca7e 100644 --- a/include/openvswitch/match.h +++ b/include/openvswitch/match.h @@ -86,6 +86,26 @@ void match_set_tun_gbp_id_masked(struct match *match, ovs_be16 gbp_id, ovs_be16

[ovs-dev] [RFC PATCH 01/14] Add VxLAN-GPE extension for the Openvswitch

2016-06-15 Thread Johnson Li
-port br-int vxlan0 -- set interface vxlan0 \ type=vxlan options:remote_ip=172.168.1.101 options:key=flow \ options:dst_port=4790 options:exts=gpe Signed-off-by: Johnson Li diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h index

[ovs-dev] [RFC PATCH 02/14] Add NSH fields for Openvswitch flow key

2016-06-13 Thread Johnson Li
Openvswitch could use the fields of Network Serivce Header(NSH) as key to steer traffic to the Virtual Network Functions(VNF). Signed-off-by: Johnson Li diff --git a/datapath/flow.c b/datapath/flow.c index c97c9c9..fd09cec 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -489,6 +489,9

[ovs-dev] [RFC PATCH 11/14] Kernel: Add push_nsh/pop_nsh flow actions for data path

2016-06-07 Thread Johnson Li
Network Service Header is pushed to/stripped from packets with the data path flow actions push_nsh and pop_nsh. Signed-off-by: Johnson Li diff --git a/datapath/actions.c b/datapath/actions.c index dcf8591..69f5d2a 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -29,6 +29,7

[ovs-dev] [RFC PATCH 12/14] Openflow message for push/pop NSH header

2016-06-07 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/odp-util.c b/lib/odp-util.c index f970e86..056b0be 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -550,6 +550,41 @@ format_odp_tnl_push_action(struct ds *ds, const struct nlattr *attr) ds_put_format(ds, ",out_port(%"PRIu32"))&q

[ovs-dev] [RFC PATCH 14/14] commit control plane action to data plane

2016-06-07 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/odp-util.c b/lib/odp-util.c index 056b0be..1a2d8a5 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -5822,6 +5822,37 @@ commit_vlan_action(ovs_be16 vlan_tci, struct flow *base, base->vlan_tci = vlan_tci; } +static void +commit_nsh_act

[ovs-dev] [CudaMailTagged] [RFC PATCH 08/14] Add Meta flow key for NSH header

2016-06-07 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/include/openvswitch/meta-flow.h b/include/openvswitch/meta-flow.h index e5f9962..344e5b7 100644 --- a/include/openvswitch/meta-flow.h +++ b/include/openvswitch/meta-flow.h @@ -1720,6 +1720,132 @@ enum OVS_PACKED_ENUM mf_field_id { */ MFF_ND_TLL

[ovs-dev] [RFC PATCH 13/14] Add "pop_nsh/push_nsh" flow action for OVS control plane

2016-06-07 Thread Johnson Li
VxLAN-GPE extension ovs-ofctl add-flow br-int "table=0, priority=260, \ in_port=${GPE_PORT},actions=pop_nsh,output:LOCAL" Signed-off-by: Johnson Li diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h index 038ef87..b1d7a67 100644 --- a/include/openvswitch

[ovs-dev] [CudaMailTagged] [RFC PATCH 05/14] Add key attributes of Network Service Header

2016-06-07 Thread Johnson Li
The openvswitch exchange the key with key netlink message between the kernel data path and user space flow tables. The key fields are defined as key attributes. Signed-off-by: Johnson Li diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c index 6ffcc53..15685c7 100644 --- a/datapath

[ovs-dev] [CudaMailTagged] [RFC PATCH 10/14] Parse NSH header in flow_extract

2016-06-07 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/flow.c b/lib/flow.c index a4c1215..be87b3c 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -439,6 +439,37 @@ invalid: arp_buf[1] = eth_addr_zero; } +static inline int +parse_nsh(const void **datap, size_t *sizep, struct flow_nsh *key) +{ +const

[ovs-dev] [CudaMailTagged] [RFC PATCH 06/14] Parse and format NSH key attributes

2016-06-07 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/odp-util.c b/lib/odp-util.c index d9ace90..8a2e521 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -146,6 +146,7 @@ ovs_key_attr_to_string(enum ovs_key_attr attr, char *namebuf, size_t bufsize) case OVS_KEY_ATTR_CT_MARK: return "ct

[ovs-dev] [CudaMailTagged] [RFC PATCH 09/14] parse NSH key in key_extract of openvswitch

2016-06-07 Thread Johnson Li
Parse the Network Service Header to fullfill the fields in the struct sw_flow_key. Signed-off-by: Johnson Li diff --git a/datapath/flow.c b/datapath/flow.c index fd09cec..223ff5c 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -44,6 +44,7 @@ #include #include #include +#include

[ovs-dev] [CudaMailTagged] [RFC PATCH 03/14] Add NSH keys as match fields for user space flow table

2016-06-07 Thread Johnson Li
Add NSH keys (Metadata type I only) as part of match fields for the user space flow table. Signed-off-by: Johnson Li diff --git a/include/openvswitch/flow.h b/include/openvswitch/flow.h index 03d406b..5f3cd39 100644 --- a/include/openvswitch/flow.h +++ b/include/openvswitch/flow.h @@ -100,6

[ovs-dev] [CudaMailTagged] [RFC PATCH 04/14] Format NSH keys to readable strings

2016-06-07 Thread Johnson Li
Signed-off-by: Johnson Li diff --git a/lib/match.c b/lib/match.c index db78831..f12c802 100644 --- a/lib/match.c +++ b/lib/match.c @@ -1046,6 +1046,40 @@ format_ct_label_masked(struct ds *s, const ovs_u128 *key, const ovs_u128 *mask) } } +static void +format_flow_nsh(struct ds *s, const

[ovs-dev] [CudaMailTagged] [RFC PATCH 00/14] Add Network Service Header Support

2016-06-07 Thread Johnson Li
3: Add flow for Ingress $ovs-ofctl add-flow br-int "table=0, priority=260, in_port=1,\ nsh_mdtype=1, nsp=0x1, nsi=0xFF, nshc1=0x11223344,\ nshc2=0x55667788, nshc3=0x99aabbcc, nshc4=0xddeeff00, \ actions=pop_nsh,output:LOCAL" Now we could test the flows between 172.168.60.101 and 17