summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2020-04-14 13:33:28 -0700
committerWilliam Tu <u9012063@gmail.com>2020-04-29 09:00:54 -0700
commit81f71381ff66b059aa9d19000ceded33139a5eca (patch)
tree424cc194e0362fdc5be7dd377c59aba1f7f1a6f2 /include
parent5e76d41d52b0a86e1e351abc6b08920993eafc61 (diff)
downloadopenvswitch-81f71381ff66b059aa9d19000ceded33139a5eca.tar.gz
ofp-actions: Add delete field action
This patch adds a new OpenFlow action, delete field, to delete a field in packets. Currently, only the tun_metadata fields are supported. One use case to add this action is to support multiple versions of geneve tunnel metadatas to be exchanged among different versions of networks. For example, we may introduce tun_metadata2 to replace old tun_metadata1, but still want to provide backward compatibility to the older release. In this case, in the new OpenFlow pipeline, we would like to support the case to receive a packet with tun_metadata1, do some processing. And if the packet is going to a switch in the newer release, we would like to delete the value in tun_metadata1 and set a value into tun_metadata2. Currently, ovs does not provide an action to remove a value in tun_metadata if the value is present. This patch fulfills the gap by adding the delete_field action. For example, the OpenFlow syntax to delete tun_metadata1 is: actions=delete_field:tun_metadata1 Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: William Tu <u9012063@gmail.com> Acked-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/ofp-actions.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h
index c8948e0d6..226e86d0b 100644
--- a/include/openvswitch/ofp-actions.h
+++ b/include/openvswitch/ofp-actions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2019 Nicira, Inc.
+ * Copyright (c) 2012-2017, 2019-2020 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,6 +94,7 @@ struct vl_mff_map;
OFPACT(PUSH_MPLS, ofpact_push_mpls, ofpact, "push_mpls") \
OFPACT(POP_MPLS, ofpact_pop_mpls, ofpact, "pop_mpls") \
OFPACT(DEC_NSH_TTL, ofpact_null, ofpact, "dec_nsh_ttl") \
+ OFPACT(DELETE_FIELD, ofpact_delete_field, ofpact, "delete_field") \
\
/* Generic encap & decap */ \
OFPACT(ENCAP, ofpact_encap, props, "encap") \
@@ -576,6 +577,16 @@ struct ofpact_pop_mpls {
);
};
+/* OFPACT_DELETE_FIELD.
+ *
+ * Used for NXAST_DELETE_FIELD. */
+struct ofpact_delete_field {
+ OFPACT_PADDED_MEMBERS(
+ struct ofpact ofpact;
+ const struct mf_field *field;
+ );
+};
+
/* OFPACT_SET_TUNNEL.
*
* Used for NXAST_SET_TUNNEL, NXAST_SET_TUNNEL64. */