netdev-tc-offloads: Remove redundant loop handling ovs action set
OVS action set always has a single nested OVS_KEY_ATTR_*
so there is no need to iterate it.
@@ -644,15 +644,17 @@ static int
parse_put_flow_set_action(struct tc_flower *flower, const struct nlattr *set,
size_t set_len)
{
- const struct nlattr *set_attr;
- size_t set_left;
-
- NL_ATTR_FOR_EACH_UNSAFE (set_attr, set_left, set, set_len) {
- if (nl_attr_type(set_attr) == OVS_KEY_ATTR_TUNNEL) {
- const struct nlattr *tunnel = nl_attr_get(set_attr);
- const size_t tunnel_len = nl_attr_get_size(set_attr);
+ const struct nlattr *tunnel;
const struct nlattr *tun_attr;
- size_t tun_left;
+ size_t tun_left, tunnel_len;
+
+ if (nl_attr_type(set) != OVS_KEY_ATTR_TUNNEL) {
+ return parse_put_flow_set_masked_action(flower, set, set_len,
+ false);
+ }
+
+ tunnel = nl_attr_get(set);
+ tunnel_len = nl_attr_get_size(set);
flower->set.set = true;
NL_ATTR_FOR_EACH_UNSAFE(tun_attr, tun_left, tunnel, tunnel_len) {
@@ -689,11 +691,7 @@ parse_put_flow_set_action(struct tc_flower *flower, const struct nlattr *set,
break;
}
}
- } else {
- return parse_put_flow_set_masked_action(flower, set, set_len,
- false);
- }
- }
+
return 0;
}
