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
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
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
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
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
-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
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
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
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
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
_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
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
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
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
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
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
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
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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
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
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
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
35 matches
Mail list logo