Lines Matching refs:key
58 static u16 key_to_nfproto(const struct sw_flow_key *key) in key_to_nfproto() argument
60 switch (ntohs(key->eth.type)) { in key_to_nfproto()
132 static void __ovs_ct_update_key(struct sw_flow_key *key, u8 state, in __ovs_ct_update_key() argument
136 key->ct.state = state; in __ovs_ct_update_key()
137 key->ct.zone = zone->id; in __ovs_ct_update_key()
138 key->ct.mark = ovs_ct_get_mark(ct); in __ovs_ct_update_key()
139 ovs_ct_get_labels(ct, &key->ct.labels); in __ovs_ct_update_key()
147 struct sw_flow_key *key, bool post_ct) in ovs_ct_update_key() argument
167 __ovs_ct_update_key(key, state, zone, ct); in ovs_ct_update_key()
170 void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key) in ovs_ct_fill_key() argument
172 ovs_ct_update_key(skb, NULL, key, false); in ovs_ct_fill_key()
175 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb) in ovs_ct_put_key() argument
177 if (nla_put_u32(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state)) in ovs_ct_put_key()
181 nla_put_u16(skb, OVS_KEY_ATTR_CT_ZONE, key->ct.zone)) in ovs_ct_put_key()
185 nla_put_u32(skb, OVS_KEY_ATTR_CT_MARK, key->ct.mark)) in ovs_ct_put_key()
189 nla_put(skb, OVS_KEY_ATTR_CT_LABELS, sizeof(key->ct.labels), in ovs_ct_put_key()
190 &key->ct.labels)) in ovs_ct_put_key()
196 static int ovs_ct_set_mark(struct sk_buff *skb, struct sw_flow_key *key, in ovs_ct_set_mark() argument
214 key->ct.mark = new_mark; in ovs_ct_set_mark()
223 static int ovs_ct_set_labels(struct sk_buff *skb, struct sw_flow_key *key, in ovs_ct_set_labels() argument
250 ovs_ct_get_labels(ct, &key->ct.labels); in ovs_ct_set_labels()
304 static int handle_fragments(struct net *net, struct sw_flow_key *key, in handle_fragments() argument
309 if (key->eth.type == htons(ETH_P_IP)) { in handle_fragments()
320 } else if (key->eth.type == htons(ETH_P_IPV6)) { in handle_fragments()
340 key->ip.proto = ipv6_hdr(reasm)->nexthdr; in handle_fragments()
351 key->ip.frag = OVS_FRAG_TYPE_NONE; in handle_fragments()
395 static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, in __ovs_ct_lookup() argument
426 ovs_ct_update_key(skb, info, key, true); in __ovs_ct_lookup()
432 static int ovs_ct_lookup(struct net *net, struct sw_flow_key *key, in ovs_ct_lookup() argument
443 __ovs_ct_update_key(key, state, &info->zone, exp->master); in ovs_ct_lookup()
447 err = __ovs_ct_lookup(net, key, info, skb); in ovs_ct_lookup()
456 static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, in ovs_ct_commit() argument
463 state = key->ct.state; in ovs_ct_commit()
464 if (key->ct.zone == info->zone.id && in ovs_ct_commit()
472 err = __ovs_ct_lookup(net, key, info, skb); in ovs_ct_commit()
496 struct sw_flow_key *key, in ovs_ct_execute() argument
506 if (key->ip.frag != OVS_FRAG_TYPE_NONE) { in ovs_ct_execute()
507 err = handle_fragments(net, key, info->zone.id, skb); in ovs_ct_execute()
513 err = ovs_ct_commit(net, key, info, skb); in ovs_ct_execute()
515 err = ovs_ct_lookup(net, key, info, skb); in ovs_ct_execute()
520 err = ovs_ct_set_mark(skb, key, info->mark.value, in ovs_ct_execute()
526 err = ovs_ct_set_labels(skb, key, &info->labels.value, in ovs_ct_execute()
536 const struct sw_flow_key *key, bool log) in ovs_ct_add_helper() argument
542 key->ip.proto); in ovs_ct_add_helper()
671 const struct sw_flow_key *key, in ovs_ct_copy_action() argument
679 family = key_to_nfproto(key); in ovs_ct_copy_action()
706 err = ovs_ct_add_helper(&ct_info, helper, key, log); in ovs_ct_copy_action()