Lines Matching defs:flow

24 	struct flow_offload	*flow;
224 const struct flow_offload *flow,
236 this_tuple = &flow->tuplehash[dir].tuple;
243 other_tuple = &flow->tuplehash[!dir].tuple;
271 const struct flow_offload *flow,
286 this_tuple = &flow->tuplehash[dir].tuple;
293 other_tuple = &flow->tuplehash[!dir].tuple;
328 const struct flow_offload *flow,
339 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.dst_v4.s_addr;
343 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_v4.s_addr;
355 const struct flow_offload *flow,
366 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.src_v4.s_addr;
370 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_v4.s_addr;
396 const struct flow_offload *flow,
406 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.dst_v6.s6_addr32;
410 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_v6.s6_addr32;
421 const struct flow_offload *flow,
431 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.src_v6.s6_addr32;
435 addr = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_v6.s6_addr32;
445 static int flow_offload_l4proto(const struct flow_offload *flow)
447 u8 protonum = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.l4proto;
465 const struct flow_offload *flow,
475 port = ntohs(flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.dst_port);
481 port = ntohs(flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_port);
490 flow_offload_mangle(entry, flow_offload_l4proto(flow), offset,
495 const struct flow_offload *flow,
505 port = ntohs(flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.src_port);
511 port = ntohs(flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_port);
520 flow_offload_mangle(entry, flow_offload_l4proto(flow), offset,
525 const struct flow_offload *flow,
528 u8 protonum = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.l4proto;
545 const struct flow_offload *flow,
554 this_tuple = &flow->tuplehash[dir].tuple;
557 this_tuple = &flow->tuplehash[dir].tuple;
561 other_tuple = &flow->tuplehash[!dir].tuple;
577 static void flow_offload_encap_tunnel(const struct flow_offload *flow,
585 this_tuple = &flow->tuplehash[dir].tuple;
602 static void flow_offload_decap_tunnel(const struct flow_offload *flow,
610 other_tuple = &flow->tuplehash[!dir].tuple;
627 nf_flow_rule_route_common(struct net *net, const struct flow_offload *flow,
635 flow_offload_decap_tunnel(flow, dir, flow_rule);
636 flow_offload_encap_tunnel(flow, dir, flow_rule);
638 if (flow_offload_eth_src(net, flow, dir, flow_rule) < 0 ||
639 flow_offload_eth_dst(net, flow, dir, flow_rule) < 0)
642 tuple = &flow->tuplehash[dir].tuple;
656 other_tuple = &flow->tuplehash[!dir].tuple;
682 int nf_flow_rule_route_ipv4(struct net *net, struct flow_offload *flow,
686 if (nf_flow_rule_route_common(net, flow, dir, flow_rule) < 0)
689 if (test_bit(NF_FLOW_SNAT, &flow->flags)) {
690 flow_offload_ipv4_snat(net, flow, dir, flow_rule);
691 flow_offload_port_snat(net, flow, dir, flow_rule);
693 if (test_bit(NF_FLOW_DNAT, &flow->flags)) {
694 flow_offload_ipv4_dnat(net, flow, dir, flow_rule);
695 flow_offload_port_dnat(net, flow, dir, flow_rule);
697 if (test_bit(NF_FLOW_SNAT, &flow->flags) ||
698 test_bit(NF_FLOW_DNAT, &flow->flags))
699 flow_offload_ipv4_checksum(net, flow, flow_rule);
701 flow_offload_redirect(net, flow, dir, flow_rule);
707 int nf_flow_rule_route_ipv6(struct net *net, struct flow_offload *flow,
711 if (nf_flow_rule_route_common(net, flow, dir, flow_rule) < 0)
714 if (test_bit(NF_FLOW_SNAT, &flow->flags)) {
715 flow_offload_ipv6_snat(net, flow, dir, flow_rule);
716 flow_offload_port_snat(net, flow, dir, flow_rule);
718 if (test_bit(NF_FLOW_DNAT, &flow->flags)) {
719 flow_offload_ipv6_dnat(net, flow, dir, flow_rule);
720 flow_offload_port_dnat(net, flow, dir, flow_rule);
723 flow_offload_redirect(net, flow, dir, flow_rule);
738 struct flow_offload *flow = offload->flow;
755 tuple = &flow->tuplehash[dir].tuple;
756 other_tuple = &flow->tuplehash[!dir].tuple;
765 if (flowtable->type->action(net, flow, dir, flow_rule) < 0)
836 struct flow_offload *flow,
850 &flow->tuplehash[dir].tuple, &extack);
875 return nf_flow_offload_tuple(offload->flowtable, offload->flow,
885 nf_flow_offload_tuple(offload->flowtable, offload->flow, NULL, dir,
898 if (test_bit(NF_FLOW_HW_BIDIRECTIONAL, &offload->flow->flags))
920 set_bit(IPS_HW_OFFLOAD_BIT, &offload->flow->ct->status);
928 clear_bit(IPS_HW_OFFLOAD_BIT, &offload->flow->ct->status);
930 if (test_bit(NF_FLOW_HW_BIDIRECTIONAL, &offload->flow->flags))
932 set_bit(NF_FLOW_HW_DEAD, &offload->flow->flags);
939 nf_flow_offload_tuple(offload->flowtable, offload->flow, NULL, dir,
951 if (test_bit(NF_FLOW_HW_BIDIRECTIONAL, &offload->flow->flags))
956 offload->flow->timeout = max_t(u64, offload->flow->timeout,
957 lastused + flow_offload_get_timeout(offload->flow));
961 nf_ct_acct_add(offload->flow->ct,
965 nf_ct_acct_add(offload->flow->ct,
995 clear_bit(NF_FLOW_HW_PENDING, &offload->flow->flags);
1017 struct flow_offload *flow, unsigned int cmd)
1021 if (test_and_set_bit(NF_FLOW_HW_PENDING, &flow->flags))
1026 clear_bit(NF_FLOW_HW_PENDING, &flow->flags);
1031 offload->flow = flow;
1040 struct flow_offload *flow)
1044 offload = nf_flow_offload_work_alloc(flowtable, flow, FLOW_CLS_REPLACE);
1052 struct flow_offload *flow)
1056 offload = nf_flow_offload_work_alloc(flowtable, flow, FLOW_CLS_DESTROY);
1060 set_bit(NF_FLOW_HW_DYING, &flow->flags);
1065 struct flow_offload *flow)
1070 delta = nf_flow_timeout_delta(flow->timeout);
1071 if ((delta >= (9 * flow_offload_get_timeout(flow)) / 10))
1074 offload = nf_flow_offload_work_alloc(flowtable, flow, FLOW_CLS_STATS);