mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
netdev-offload-dpdk: Support offload of set IPv6 actions.
Add support for set IPv6 actions. Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Roni Bar Yanai <roniba@mellanox.com> Acked-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
85270e9963
commit
b6207b1d27
@@ -396,6 +396,7 @@ Supported actions for hardware offload are:
|
||||
- Modification of IPv4 (mod_nw_src/mod_nw_dst/mod_nw_ttl).
|
||||
- Modification of TCP/UDP (mod_tp_src/mod_tp_dst).
|
||||
- VLAN Push/Pop (push_vlan/pop_vlan).
|
||||
- Modification of IPv6 (set_field:<ADDR>->ipv6_src/ipv6_dst/mod_nw_ttl).
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
|
2
NEWS
2
NEWS
@@ -11,6 +11,8 @@ Post-v2.13.0
|
||||
* Deprecated DPDK ring ports (dpdkr) are no longer supported.
|
||||
* Add hardware offload support for VLAN Push/Pop actions (experimental).
|
||||
* Add hardware offload support for matching IPv6 protocol (experimental).
|
||||
* Add hardware offload support for set of IPv6 src/dst/ttl
|
||||
actions (experimental).
|
||||
- Linux datapath:
|
||||
* Support for kernel versions up to 5.5.x.
|
||||
- AF_XDP:
|
||||
|
@@ -437,6 +437,20 @@ dump_flow_action(struct ds *s, const struct rte_flow_action *actions)
|
||||
ds_put_cstr(s, "/ ");
|
||||
} else if (actions->type == RTE_FLOW_ACTION_TYPE_OF_POP_VLAN) {
|
||||
ds_put_cstr(s, "of_pop_vlan / ");
|
||||
} else if (actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC ||
|
||||
actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV6_DST) {
|
||||
const struct rte_flow_action_set_ipv6 *set_ipv6 = actions->conf;
|
||||
|
||||
char *dirstr = actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV6_DST
|
||||
? "dst" : "src";
|
||||
|
||||
ds_put_format(s, "set_ipv6_%s ", dirstr);
|
||||
if (set_ipv6) {
|
||||
ds_put_cstr(s, "ipv6_addr ");
|
||||
ipv6_format_addr((struct in6_addr *) &set_ipv6->ipv6_addr, s);
|
||||
ds_put_cstr(s, " ");
|
||||
}
|
||||
ds_put_cstr(s, "/ ");
|
||||
} else {
|
||||
ds_put_format(s, "unknown rte flow action (%d)\n", actions->type);
|
||||
}
|
||||
@@ -984,6 +998,12 @@ BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_ipv4) ==
|
||||
MEMBER_SIZEOF(struct ovs_key_ipv4, ipv4_dst));
|
||||
BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_ttl) ==
|
||||
MEMBER_SIZEOF(struct ovs_key_ipv4, ipv4_ttl));
|
||||
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_ttl) ==
|
||||
MEMBER_SIZEOF(struct ovs_key_ipv6, ipv6_hlimit));
|
||||
BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_tp) ==
|
||||
MEMBER_SIZEOF(struct ovs_key_tcp, tcp_src));
|
||||
BUILD_ASSERT_DECL(sizeof(struct rte_flow_action_set_tp) ==
|
||||
@@ -1033,6 +1053,18 @@ parse_set_actions(struct flow_actions *actions,
|
||||
VLOG_DBG_RL(&rl, "Unsupported IPv4 set action");
|
||||
return -1;
|
||||
}
|
||||
} else if (nl_attr_type(sa) == OVS_KEY_ATTR_IPV6) {
|
||||
const struct ovs_key_ipv6 *key = nl_attr_get(sa);
|
||||
const struct ovs_key_ipv6 *mask = masked ? key + 1 : NULL;
|
||||
|
||||
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_hlimit, RTE_FLOW_ACTION_TYPE_SET_TTL);
|
||||
|
||||
if (mask && !is_all_zeros(mask, sizeof *mask)) {
|
||||
VLOG_DBG_RL(&rl, "Unsupported IPv6 set action");
|
||||
return -1;
|
||||
}
|
||||
} else if (nl_attr_type(sa) == OVS_KEY_ATTR_TCP) {
|
||||
const struct ovs_key_tcp *key = nl_attr_get(sa);
|
||||
const struct ovs_key_tcp *mask = masked ? key + 1 : NULL;
|
||||
|
Reference in New Issue
Block a user