2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 00:35:33 +00:00

netdev-offload: Use dpif type instead of class.

There is no real difference between the 'class' and 'type' in the
context of common lookup operations inside netdev-offload module
because it only checks the value of pointers without using the
value itself.  However, 'type' has some meaning and can be used by
offload provides on the initialization phase to check if this type
of Flow API in pair with the netdev type could be used in particular
datapath type.  For example, this is needed to check if Linux flow
API could be used for current tunneling vport because it could be
used only if tunneling vport belongs to system datapath, i.e. has
backing linux interface.

This is needed to unblock tunneling offloads in userspace datapath
with DPDK flow API.

Acked-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Roni Bar Yanai <roniba@mellanox.com>
Acked-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Ilya Maximets
2020-07-08 06:38:29 +00:00
parent 48c1ab5d74
commit 8842fdf1b3
8 changed files with 76 additions and 76 deletions

View File

@@ -934,15 +934,14 @@ add_port_id_action(struct flow_actions *actions,
static int
add_output_action(struct netdev *netdev,
struct flow_actions *actions,
const struct nlattr *nla,
struct offload_info *info)
const struct nlattr *nla)
{
struct netdev *outdev;
odp_port_t port;
int ret = 0;
port = nl_attr_get_odp_port(nla);
outdev = netdev_ports_get(port, info->dpif_class);
outdev = netdev_ports_get(port, netdev->dpif_type);
if (outdev == NULL) {
VLOG_DBG_RL(&rl, "Cannot find netdev for odp port %"PRIu32, port);
return -1;
@@ -1125,8 +1124,7 @@ static int
parse_flow_actions(struct netdev *netdev,
struct flow_actions *actions,
struct nlattr *nl_actions,
size_t nl_actions_len,
struct offload_info *info)
size_t nl_actions_len)
{
struct nlattr *nla;
size_t left;
@@ -1134,7 +1132,7 @@ parse_flow_actions(struct netdev *netdev,
add_count_action(actions);
NL_ATTR_FOR_EACH_UNSAFE (nla, left, nl_actions, nl_actions_len) {
if (nl_attr_type(nla) == OVS_ACTION_ATTR_OUTPUT) {
if (add_output_action(netdev, actions, nla, info)) {
if (add_output_action(netdev, actions, nla)) {
return -1;
}
} else if (nl_attr_type(nla) == OVS_ACTION_ATTR_DROP) {
@@ -1176,8 +1174,7 @@ static struct rte_flow *
netdev_offload_dpdk_actions(struct netdev *netdev,
struct flow_patterns *patterns,
struct nlattr *nl_actions,
size_t actions_len,
struct offload_info *info)
size_t actions_len)
{
const struct rte_flow_attr flow_attr = { .ingress = 1, .transfer = 1 };
struct flow_actions actions = { .actions = NULL, .cnt = 0 };
@@ -1185,7 +1182,7 @@ netdev_offload_dpdk_actions(struct netdev *netdev,
struct rte_flow_error error;
int ret;
ret = parse_flow_actions(netdev, &actions, nl_actions, actions_len, info);
ret = parse_flow_actions(netdev, &actions, nl_actions, actions_len);
if (ret) {
goto out;
}
@@ -1217,7 +1214,7 @@ netdev_offload_dpdk_add_flow(struct netdev *netdev,
}
flow = netdev_offload_dpdk_actions(netdev, &patterns, nl_actions,
actions_len, info);
actions_len);
if (!flow) {
/* If we failed to offload the rule actions fallback to MARK+RSS
* actions.