Lines Matching refs:sfa

2308 	struct sw_flow_actions *sfa;  in nla_alloc_flow_actions()  local
2312 sfa = kmalloc(kmalloc_size_roundup(sizeof(*sfa) + size), GFP_KERNEL); in nla_alloc_flow_actions()
2313 if (!sfa) in nla_alloc_flow_actions()
2316 sfa->actions_len = 0; in nla_alloc_flow_actions()
2317 return sfa; in nla_alloc_flow_actions()
2452 static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, in reserve_sfa_size() argument
2460 (*sfa)->actions_len; in reserve_sfa_size()
2462 if (req_size <= (ksize(*sfa) - next_offset)) in reserve_sfa_size()
2465 new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2); in reserve_sfa_size()
2480 memcpy(acts->actions, (*sfa)->actions, (*sfa)->actions_len); in reserve_sfa_size()
2481 acts->actions_len = (*sfa)->actions_len; in reserve_sfa_size()
2482 acts->orig_len = (*sfa)->orig_len; in reserve_sfa_size()
2483 kfree(*sfa); in reserve_sfa_size()
2484 *sfa = acts; in reserve_sfa_size()
2487 (*sfa)->actions_len += req_size; in reserve_sfa_size()
2488 return (struct nlattr *) ((unsigned char *)(*sfa) + next_offset); in reserve_sfa_size()
2491 static struct nlattr *__add_action(struct sw_flow_actions **sfa, in __add_action() argument
2496 a = reserve_sfa_size(sfa, nla_attr_size(len), log); in __add_action()
2510 int ovs_nla_add_action(struct sw_flow_actions **sfa, int attrtype, void *data, in ovs_nla_add_action() argument
2515 a = __add_action(sfa, attrtype, data, len, log); in ovs_nla_add_action()
2520 static inline int add_nested_action_start(struct sw_flow_actions **sfa, in add_nested_action_start() argument
2523 int used = (*sfa)->actions_len; in add_nested_action_start()
2526 err = ovs_nla_add_action(sfa, attrtype, NULL, 0, log); in add_nested_action_start()
2533 static inline void add_nested_action_end(struct sw_flow_actions *sfa, in add_nested_action_end() argument
2536 struct nlattr *a = (struct nlattr *) ((unsigned char *)sfa->actions + in add_nested_action_end()
2539 a->nla_len = sfa->actions_len - st_offset; in add_nested_action_end()
2544 struct sw_flow_actions **sfa,
2550 struct sw_flow_actions **sfa, in validate_and_copy_sample() argument
2579 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SAMPLE, log); in validate_and_copy_sample()
2597 err = ovs_nla_add_action(sfa, OVS_SAMPLE_ATTR_ARG, &arg, sizeof(arg), in validate_and_copy_sample()
2602 err = __ovs_nla_copy_actions(net, actions, key, sfa, in validate_and_copy_sample()
2608 add_nested_action_end(*sfa, start); in validate_and_copy_sample()
2616 struct sw_flow_actions **sfa, in validate_and_copy_dec_ttl() argument
2652 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_DEC_TTL, log); in validate_and_copy_dec_ttl()
2656 action_start = add_nested_action_start(sfa, OVS_DEC_TTL_ATTR_ACTION, log); in validate_and_copy_dec_ttl()
2660 err = __ovs_nla_copy_actions(net, actions, key, sfa, eth_type, in validate_and_copy_dec_ttl()
2665 add_nested_action_end(*sfa, action_start); in validate_and_copy_dec_ttl()
2666 add_nested_action_end(*sfa, start); in validate_and_copy_dec_ttl()
2673 struct sw_flow_actions **sfa, in validate_and_copy_clone() argument
2683 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_CLONE, log); in validate_and_copy_clone()
2689 err = ovs_nla_add_action(sfa, OVS_CLONE_ATTR_EXEC, &exec, in validate_and_copy_clone()
2694 err = __ovs_nla_copy_actions(net, attr, key, sfa, in validate_and_copy_clone()
2699 add_nested_action_end(*sfa, start); in validate_and_copy_clone()
2751 struct sw_flow_actions **sfa, bool log) in validate_and_copy_set_tun() argument
2785 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_SET, log); in validate_and_copy_set_tun()
2801 a = __add_action(sfa, OVS_KEY_ATTR_TUNNEL_INFO, NULL, in validate_and_copy_set_tun()
2826 add_nested_action_end(*sfa, start); in validate_and_copy_set_tun()
2860 struct sw_flow_actions **sfa, bool *skip_copy, in validate_set() argument
2901 err = validate_and_copy_set_tun(a, sfa, log); in validate_set()
3006 start = add_nested_action_start(sfa, in validate_set()
3012 at = __add_action(sfa, key_type, NULL, len, log); in validate_set()
3024 add_nested_action_end(*sfa, start); in validate_set()
3061 struct sw_flow_actions **sfa, in validate_and_copy_check_pkt_len() argument
3090 start = add_nested_action_start(sfa, OVS_ACTION_ATTR_CHECK_PKT_LEN, in validate_and_copy_check_pkt_len()
3101 err = ovs_nla_add_action(sfa, OVS_CHECK_PKT_LEN_ATTR_ARG, &arg, in validate_and_copy_check_pkt_len()
3106 nested_acts_start = add_nested_action_start(sfa, in validate_and_copy_check_pkt_len()
3111 err = __ovs_nla_copy_actions(net, acts_if_lesser_eq, key, sfa, in validate_and_copy_check_pkt_len()
3117 add_nested_action_end(*sfa, nested_acts_start); in validate_and_copy_check_pkt_len()
3119 nested_acts_start = add_nested_action_start(sfa, in validate_and_copy_check_pkt_len()
3124 err = __ovs_nla_copy_actions(net, acts_if_greater, key, sfa, in validate_and_copy_check_pkt_len()
3130 add_nested_action_end(*sfa, nested_acts_start); in validate_and_copy_check_pkt_len()
3131 add_nested_action_end(*sfa, start); in validate_and_copy_check_pkt_len()
3136 struct sw_flow_actions **sfa, bool log) in copy_action() argument
3141 to = reserve_sfa_size(sfa, from->nla_len, log); in copy_action()
3151 struct sw_flow_actions **sfa, in __ovs_nla_copy_actions() argument
3332 err = validate_set(a, key, sfa, in __ovs_nla_copy_actions()
3340 err = validate_set(a, key, sfa, in __ovs_nla_copy_actions()
3350 err = validate_and_copy_sample(net, a, key, sfa, in __ovs_nla_copy_actions()
3361 err = ovs_ct_copy_action(net, a, key, sfa, log); in __ovs_nla_copy_actions()
3421 err = validate_and_copy_clone(net, a, key, sfa, in __ovs_nla_copy_actions()
3434 err = validate_and_copy_check_pkt_len(net, a, key, sfa, in __ovs_nla_copy_actions()
3446 err = validate_and_copy_dec_ttl(net, a, key, sfa, in __ovs_nla_copy_actions()
3459 err = copy_action(a, sfa, log); in __ovs_nla_copy_actions()
3474 struct sw_flow_actions **sfa, bool log) in ovs_nla_copy_actions() argument
3479 *sfa = nla_alloc_flow_actions(min(nla_len(attr), MAX_ACTIONS_BUFSIZE)); in ovs_nla_copy_actions()
3480 if (IS_ERR(*sfa)) in ovs_nla_copy_actions()
3481 return PTR_ERR(*sfa); in ovs_nla_copy_actions()
3486 (*sfa)->orig_len = nla_len(attr); in ovs_nla_copy_actions()
3487 err = __ovs_nla_copy_actions(net, attr, key, sfa, key->eth.type, in ovs_nla_copy_actions()
3490 ovs_nla_free_flow_actions(*sfa); in ovs_nla_copy_actions()