Hi, On Thu, Jan 07, 2021 at 09:30:48PM -0800, Saeed Mahameed wrote: > @@ -1429,6 +1600,14 @@ mlx5_tc_ct_add_ft_cb(struct mlx5_tc_ct_priv *ct_priv, > u16 zone, > if (err) > goto err_insert; > > + nf_ct_zone_init(&ctzone, zone, NF_CT_DEFAULT_ZONE_DIR, 0); > + ft->tmpl = nf_ct_tmpl_alloc(&init_net, &ctzone, GFP_KERNEL);
I didn't test but I think this will add a hard dependency to nf_conntrack_core and will cause conntrack to always be loaded by mlx5_core, which is not good for some use cases. nf_ct_tmpl_alloc() is defined in nf_conntrack_core.c. 762f926d6f19 ("net/sched: act_ct: Make tcf_ct_flow_table_restore_skb inline") was done similarly to avoid this. > + if (!ft->tmpl) > + goto err_tmpl; > + > + __set_bit(IPS_CONFIRMED_BIT, &ft->tmpl->status); > + nf_conntrack_get(&ft->tmpl->ct_general); > + > err = nf_flow_table_offload_add_cb(ft->nf_ft, > mlx5_tc_ct_block_flow_offload, ft); > if (err)