act_ct.c (c17cda15cc86e65e9725641daddcd7a63cc9ad01) | act_ct.c (d5a116dbe7123f6c1bdc581500349ff3bb9416f9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB 2/* - 3 * net/sched/act_ct.c Connection Tracking action 4 * 5 * Authors: Paul Blakey <paulb@mellanox.com> 6 * Yossi Kuperman <yossiku@mellanox.com> 7 * Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> 8 */ --- 362 unchanged lines hidden (view full) --- 371 372static void tcf_ct_flow_tc_ifidx(struct flow_offload *entry, 373 struct nf_conn_act_ct_ext *act_ct_ext, u8 dir) 374{ 375 entry->tuplehash[dir].tuple.xmit_type = FLOW_OFFLOAD_XMIT_TC; 376 entry->tuplehash[dir].tuple.tc.iifidx = act_ct_ext->ifindex[dir]; 377} 378 | 1// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB 2/* - 3 * net/sched/act_ct.c Connection Tracking action 4 * 5 * Authors: Paul Blakey <paulb@mellanox.com> 6 * Yossi Kuperman <yossiku@mellanox.com> 7 * Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> 8 */ --- 362 unchanged lines hidden (view full) --- 371 372static void tcf_ct_flow_tc_ifidx(struct flow_offload *entry, 373 struct nf_conn_act_ct_ext *act_ct_ext, u8 dir) 374{ 375 entry->tuplehash[dir].tuple.xmit_type = FLOW_OFFLOAD_XMIT_TC; 376 entry->tuplehash[dir].tuple.tc.iifidx = act_ct_ext->ifindex[dir]; 377} 378 |
379static void tcf_ct_flow_ct_ext_ifidx_update(struct flow_offload *entry) 380{ 381 struct nf_conn_act_ct_ext *act_ct_ext; 382 383 act_ct_ext = nf_conn_act_ct_ext_find(entry->ct); 384 if (act_ct_ext) { 385 tcf_ct_flow_tc_ifidx(entry, act_ct_ext, FLOW_OFFLOAD_DIR_ORIGINAL); 386 tcf_ct_flow_tc_ifidx(entry, act_ct_ext, FLOW_OFFLOAD_DIR_REPLY); 387 } 388} 389 |
|
379static void tcf_ct_flow_table_add(struct tcf_ct_flow_table *ct_ft, 380 struct nf_conn *ct, 381 bool tcp, bool bidirectional) 382{ 383 struct nf_conn_act_ct_ext *act_ct_ext; 384 struct flow_offload *entry; 385 int err; 386 --- 279 unchanged lines hidden (view full) --- 666 } 667 668 if (dir == FLOW_OFFLOAD_DIR_ORIGINAL) 669 ctinfo = test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ? 670 IP_CT_ESTABLISHED : IP_CT_NEW; 671 else 672 ctinfo = IP_CT_ESTABLISHED_REPLY; 673 | 390static void tcf_ct_flow_table_add(struct tcf_ct_flow_table *ct_ft, 391 struct nf_conn *ct, 392 bool tcp, bool bidirectional) 393{ 394 struct nf_conn_act_ct_ext *act_ct_ext; 395 struct flow_offload *entry; 396 int err; 397 --- 279 unchanged lines hidden (view full) --- 677 } 678 679 if (dir == FLOW_OFFLOAD_DIR_ORIGINAL) 680 ctinfo = test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ? 681 IP_CT_ESTABLISHED : IP_CT_NEW; 682 else 683 ctinfo = IP_CT_ESTABLISHED_REPLY; 684 |
685 nf_conn_act_ct_ext_fill(skb, ct, ctinfo); 686 tcf_ct_flow_ct_ext_ifidx_update(flow); |
|
674 flow_offload_refresh(nf_ft, flow, force_refresh); 675 if (!test_bit(IPS_ASSURED_BIT, &ct->status)) { 676 /* Process this flow in SW to allow promoting to ASSURED */ 677 return false; 678 } 679 680 nf_conntrack_get(&ct->ct_general); 681 nf_ct_set(skb, ct, ctinfo); --- 343 unchanged lines hidden (view full) --- 1025 goto drop; 1026 } 1027 1028 if (commit) { 1029 tcf_ct_act_set_mark(ct, p->mark, p->mark_mask); 1030 tcf_ct_act_set_labels(ct, p->labels, p->labels_mask); 1031 1032 if (!nf_ct_is_confirmed(ct)) | 687 flow_offload_refresh(nf_ft, flow, force_refresh); 688 if (!test_bit(IPS_ASSURED_BIT, &ct->status)) { 689 /* Process this flow in SW to allow promoting to ASSURED */ 690 return false; 691 } 692 693 nf_conntrack_get(&ct->ct_general); 694 nf_ct_set(skb, ct, ctinfo); --- 343 unchanged lines hidden (view full) --- 1038 goto drop; 1039 } 1040 1041 if (commit) { 1042 tcf_ct_act_set_mark(ct, p->mark, p->mark_mask); 1043 tcf_ct_act_set_labels(ct, p->labels, p->labels_mask); 1044 1045 if (!nf_ct_is_confirmed(ct)) |
1033 nf_conn_act_ct_ext_add(ct); | 1046 nf_conn_act_ct_ext_add(skb, ct, ctinfo); |
1034 1035 /* This will take care of sending queued events 1036 * even if the connection is already confirmed. 1037 */ 1038 if (nf_conntrack_confirm(skb) != NF_ACCEPT) 1039 goto drop; 1040 } 1041 --- 590 unchanged lines hidden --- | 1047 1048 /* This will take care of sending queued events 1049 * even if the connection is already confirmed. 1050 */ 1051 if (nf_conntrack_confirm(skb) != NF_ACCEPT) 1052 goto drop; 1053 } 1054 --- 590 unchanged lines hidden --- |