Add the support of offload of set IPv6 DSCP action.
Signed-off-by: Chaoyong He <[email protected]>
Reviewed-by: Louis Peens <[email protected]>
---
lib/netdev-offload-dpdk.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 2054693..ad0ce10 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -769,7 +769,8 @@ dump_flow_action(struct ds *s, struct ds *s_extra,
IP_ARGS(set_ipv4->ipv4_addr));
}
ds_put_cstr(s, "/ ");
- } else if (actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP) {
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP ||
+ actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP) {
const struct rte_flow_action_set_dscp *set_dscp = actions->conf;
ds_put_cstr(s, "set_dscp ");
@@ -1865,6 +1866,8 @@ BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_ipv6)
==
MEMBER_SIZEOF(struct ovs_key_ipv6, ipv6_src));
BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_ipv6) ==
MEMBER_SIZEOF(struct ovs_key_ipv6, ipv6_dst));
+BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_dscp) ==
+ MEMBER_SIZEOF(struct ovs_key_ipv6, ipv6_tclass));
BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_ttl) ==
MEMBER_SIZEOF(struct ovs_key_ipv6, ipv6_hlimit));
BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_tp) ==
@@ -1887,7 +1890,8 @@ parse_set_actions(struct flow_actions *actions,
bool dscp_flag = false;
#define add_set_flow_action(field, type) \
- if (type == RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP) \
+ if ((type == RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP) || \
+ (type == RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP)) \
dscp_flag = true; \
if (add_set_flow_action__(actions, &key->field, \
mask ? CONST_CAST(void *, &mask->field) : NULL, \
@@ -1926,6 +1930,8 @@ parse_set_actions(struct flow_actions *actions,
add_set_flow_action(ipv6_src, RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC);
add_set_flow_action(ipv6_dst, RTE_FLOW_ACTION_TYPE_SET_IPV6_DST);
+ add_set_flow_action(ipv6_tclass,
+ RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP);
add_set_flow_action(ipv6_hlimit, RTE_FLOW_ACTION_TYPE_SET_TTL);
if (mask && !is_all_zeros(mask, sizeof *mask)) {
--
1.8.3.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev