Lines Matching refs:sfa

1536 	struct sw_flow_actions *sfa;  in nla_alloc_flow_actions()  local
1543 sfa = kmalloc(sizeof(*sfa) + size, GFP_KERNEL); in nla_alloc_flow_actions()
1544 if (!sfa) in nla_alloc_flow_actions()
1547 sfa->actions_len = 0; in nla_alloc_flow_actions()
1548 return sfa; in nla_alloc_flow_actions()
1558 static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, in reserve_sfa_size() argument
1566 (*sfa)->actions_len; in reserve_sfa_size()
1568 if (req_size <= (ksize(*sfa) - next_offset)) in reserve_sfa_size()
1571 new_acts_size = ksize(*sfa) * 2; in reserve_sfa_size()
1583 memcpy(acts->actions, (*sfa)->actions, (*sfa)->actions_len); in reserve_sfa_size()
1584 acts->actions_len = (*sfa)->actions_len; in reserve_sfa_size()
1585 kfree(*sfa); in reserve_sfa_size()
1586 *sfa = acts; in reserve_sfa_size()
1589 (*sfa)->actions_len += req_size; in reserve_sfa_size()
1590 return (struct nlattr *) ((unsigned char *)(*sfa) + next_offset); in reserve_sfa_size()
1593 static struct nlattr *__add_action(struct sw_flow_actions **sfa, in __add_action() argument
1598 a = reserve_sfa_size(sfa, nla_attr_size(len), log); in __add_action()
1612 static int add_action(struct sw_flow_actions **sfa, int attrtype, in add_action() argument
1617 a = __add_action(sfa, attrtype, data, len, log); in add_action()
1622 static inline int add_nested_action_start(struct sw_flow_actions **sfa, in add_nested_action_start() argument
1625 int used = (*sfa)->actions_len; in add_nested_action_start()
1628 err = add_action(sfa, attrtype, NULL, 0, log); in add_nested_action_start()
1635 static inline void add_nested_action_end(struct sw_flow_actions *sfa, in add_nested_action_end() argument
1638 struct nlattr *a = (struct nlattr *) ((unsigned char *)sfa->actions + in add_nested_action_end()
1641 a->nla_len = sfa->actions_len - st_offset; in add_nested_action_end()
1646 int depth, struct sw_flow_actions **sfa,
1651 struct sw_flow_actions **sfa, in validate_and_copy_sample() argument
1678 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SAMPLE, log); in validate_and_copy_sample()
1681 err = add_action(sfa, OVS_SAMPLE_ATTR_PROBABILITY, in validate_and_copy_sample()
1685 st_acts = add_nested_action_start(sfa, OVS_SAMPLE_ATTR_ACTIONS, log); in validate_and_copy_sample()
1689 err = __ovs_nla_copy_actions(actions, key, depth + 1, sfa, in validate_and_copy_sample()
1694 add_nested_action_end(*sfa, st_acts); in validate_and_copy_sample()
1695 add_nested_action_end(*sfa, start); in validate_and_copy_sample()
1745 struct sw_flow_actions **sfa, bool log) in validate_and_copy_set_tun() argument
1770 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SET, log); in validate_and_copy_set_tun()
1774 a = __add_action(sfa, OVS_KEY_ATTR_TUNNEL_INFO, NULL, in validate_and_copy_set_tun()
1795 add_nested_action_end(*sfa, start); in validate_and_copy_set_tun()
1816 struct sw_flow_actions **sfa, in validate_set() argument
1857 err = validate_and_copy_set_tun(a, sfa, log); in validate_set()
1951 start = add_nested_action_start(sfa, in validate_set()
1957 at = __add_action(sfa, key_type, NULL, len, log); in validate_set()
1969 add_nested_action_end(*sfa, start); in validate_set()
1998 struct sw_flow_actions **sfa, bool log) in copy_action() argument
2003 to = reserve_sfa_size(sfa, from->nla_len, log); in copy_action()
2013 int depth, struct sw_flow_actions **sfa, in __ovs_nla_copy_actions() argument
2128 err = validate_set(a, key, sfa, in __ovs_nla_copy_actions()
2135 err = validate_set(a, key, sfa, in __ovs_nla_copy_actions()
2142 err = validate_and_copy_sample(a, key, depth, sfa, in __ovs_nla_copy_actions()
2154 err = copy_action(a, sfa, log); in __ovs_nla_copy_actions()
2169 struct sw_flow_actions **sfa, bool log) in ovs_nla_copy_actions() argument
2173 *sfa = nla_alloc_flow_actions(nla_len(attr), log); in ovs_nla_copy_actions()
2174 if (IS_ERR(*sfa)) in ovs_nla_copy_actions()
2175 return PTR_ERR(*sfa); in ovs_nla_copy_actions()
2177 err = __ovs_nla_copy_actions(attr, key, 0, sfa, key->eth.type, in ovs_nla_copy_actions()
2180 kfree(*sfa); in ovs_nla_copy_actions()