Skip to content

Commit d5774cb

Browse files
w1ldptrdavem330
authored andcommitted
net/sched: act_ct: set ctinfo in meta action depending on ct state
Currently tcf_ct_flow_table_fill_actions() function assumes that only established connections can be offloaded and always sets ctinfo to either IP_CT_ESTABLISHED or IP_CT_ESTABLISHED_REPLY strictly based on direction without checking actual connection state. To enable UDP NEW connection offload set the ctinfo, metadata cookie and NF_FLOW_HW_ESTABLISHED flow_offload flags bit based on ct->status value. Signed-off-by: Vlad Buslov <vladbu@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1a441a9 commit d5774cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/sched/act_ct.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ static int tcf_ct_flow_table_fill_actions(struct net *net,
249249
switch (tdir) {
250250
case FLOW_OFFLOAD_DIR_ORIGINAL:
251251
dir = IP_CT_DIR_ORIGINAL;
252-
ctinfo = IP_CT_ESTABLISHED;
253-
set_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags);
252+
ctinfo = test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ?
253+
IP_CT_ESTABLISHED : IP_CT_NEW;
254+
if (ctinfo == IP_CT_ESTABLISHED)
255+
set_bit(NF_FLOW_HW_ESTABLISHED, &flow->flags);
254256
break;
255257
case FLOW_OFFLOAD_DIR_REPLY:
256258
dir = IP_CT_DIR_REPLY;

0 commit comments

Comments
 (0)