Lines Matching refs:ft
109 struct mlx5_flow_table *ft; member
120 struct mlx5e_ipsec_ft ft; member
133 struct mlx5_flow_table *ft; member
142 struct mlx5e_ipsec_ft ft; member
233 struct mlx5_flow_table *ft; in ipsec_chains_create() local
248 ft = mlx5_chains_get_table(chains, 0, 1, 0); in ipsec_chains_create()
249 if (IS_ERR(ft)) { in ipsec_chains_create()
250 err = PTR_ERR(ft); in ipsec_chains_create()
254 *root_ft = ft; in ipsec_chains_create()
295 struct mlx5_flow_table *ft, in ipsec_miss_create() argument
313 MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, ft->max_fte - 1); in ipsec_miss_create()
314 MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, ft->max_fte - 1); in ipsec_miss_create()
315 miss->group = mlx5_create_flow_group(ft, flow_group_in); in ipsec_miss_create()
328 miss->rule = mlx5_add_flow_rules(ft, NULL, &flow_act, dest, 1); in ipsec_miss_create()
551 dest[0].ft = rx->ft.status; in rx_add_rule()
571 rule = mlx5_add_flow_rules(rx->ft.sa, spec, &flow_act, dest, 2); in rx_add_rule()
583 rule = mlx5_add_flow_rules(rx->ft.sa, spec, &flow_act, dest, 2); in rx_add_rule()
643 fte = mlx5_add_flow_rules(tx->ft.status, NULL, &flow_act, &dest, 1); in ipsec_counter_rule_tx()
658 if (!tx->roce.ft) in tx_destroy_roce()
663 mlx5_destroy_flow_table(tx->roce.ft); in tx_destroy_roce()
664 tx->roce.ft = NULL; in tx_destroy_roce()
676 mlx5_destroy_flow_table(tx->ft.pol); in tx_destroy()
678 mlx5_destroy_flow_table(tx->ft.sa); in tx_destroy()
683 mlx5_destroy_flow_table(tx->ft.sa_kspi); in tx_destroy()
685 mlx5_destroy_flow_table(tx->ft.status); in tx_destroy()
698 dst.ft = tx->ft.pol; in ipsec_tx_roce_rule_setup()
699 rule = mlx5_add_flow_rules(tx->roce.ft, NULL, &flow_act, &dst, 1); in ipsec_tx_roce_rule_setup()
715 struct mlx5_flow_table *ft; in ipsec_tx_create_roce() local
729 ft = mlx5_create_flow_table(tx->roce.ns, &ft_attr); in ipsec_tx_create_roce()
730 if (IS_ERR(ft)) { in ipsec_tx_create_roce()
731 err = PTR_ERR(ft); in ipsec_tx_create_roce()
736 tx->roce.ft = ft; in ipsec_tx_create_roce()
741 g = mlx5_create_flow_group(ft, in); in ipsec_tx_create_roce()
762 mlx5_destroy_flow_table(tx->roce.ft); in ipsec_tx_create_roce()
763 tx->roce.ft = NULL; in ipsec_tx_create_roce()
790 dest.ft = tx->ft.status; in tx_create_kspi_bypass_rules()
795 rule = mlx5_add_flow_rules(tx->ft.sa_kspi, spec, &flow_act_kspi, in tx_create_kspi_bypass_rules()
809 rule = mlx5_add_flow_rules(tx->ft.sa_kspi, spec, &flow_act, &dest, 1); in tx_create_kspi_bypass_rules()
830 struct mlx5_flow_table *ft; in tx_create() local
844 ft = ipsec_tx_ft_create(tx->ns, 0, 0, 4); in tx_create()
845 if (IS_ERR(ft)) in tx_create()
846 return PTR_ERR(ft); in tx_create()
847 tx->ft.sa_kspi = ft; in tx_create()
849 ft = ipsec_tx_ft_create(tx->ns, 2, 0, 4); in tx_create()
850 if (IS_ERR(ft)) { in tx_create()
851 err = PTR_ERR(ft); in tx_create()
854 tx->ft.sa = ft; in tx_create()
858 mdev, tx->ft.sa, MLX5_FLOW_NAMESPACE_EGRESS_IPSEC, 0, 1, in tx_create()
859 &tx->ft.pol); in tx_create()
865 ft = ipsec_tx_ft_create(tx->ns, 1, 0, 2); in tx_create()
866 if (IS_ERR(ft)) { in tx_create()
867 err = PTR_ERR(ft); in tx_create()
870 tx->ft.pol = ft; in tx_create()
872 dest.ft = tx->ft.sa; in tx_create()
873 err = ipsec_miss_create(mdev, tx->ft.pol, &tx->pol, &dest); in tx_create()
878 ft = ipsec_tx_ft_create(tx->ns, 2, 0, 1); in tx_create()
879 if (IS_ERR(ft)) { in tx_create()
880 err = PTR_ERR(ft); in tx_create()
883 tx->ft.status = ft; in tx_create()
886 err = ipsec_miss_create(mdev, tx->ft.sa_kspi, &tx->kspi_miss, NULL); in tx_create()
910 mlx5_destroy_flow_table(tx->ft.status); in tx_create()
920 mlx5_destroy_flow_table(tx->ft.pol); in tx_create()
925 mlx5_destroy_flow_table(tx->ft.sa); in tx_create()
927 mlx5_destroy_flow_table(tx->ft.sa_kspi); in tx_create()
936 if (tx->ft.refcnt) in tx_get()
944 tx->ft.refcnt++; in tx_get()
950 if (--tx->ft.refcnt) in tx_put()
962 mutex_lock(&tx->ft.mutex); in tx_ft_get()
964 mutex_unlock(&tx->ft.mutex); in tx_ft_get()
976 struct mlx5_flow_table *ft; in tx_ft_get_policy() local
979 mutex_lock(&tx->ft.mutex); in tx_ft_get_policy()
984 ft = tx->chains ? ipsec_chains_get_table(tx->chains, prio) : tx->ft.pol; in tx_ft_get_policy()
985 if (IS_ERR(ft)) { in tx_ft_get_policy()
986 err = PTR_ERR(ft); in tx_ft_get_policy()
990 mutex_unlock(&tx->ft.mutex); in tx_ft_get_policy()
991 return ft; in tx_ft_get_policy()
996 mutex_unlock(&tx->ft.mutex); in tx_ft_get_policy()
1004 mutex_lock(&tx->ft.mutex); in tx_ft_put_policy()
1009 mutex_unlock(&tx->ft.mutex); in tx_ft_put_policy()
1016 mutex_lock(&tx->ft.mutex); in tx_ft_put()
1018 mutex_unlock(&tx->ft.mutex); in tx_ft_put()
1119 rule = mlx5_add_flow_rules(tx->ft.sa_kspi, spec, flow_act, dest, num_dest); in tx_add_kspi_rule()
1156 rule = mlx5_add_flow_rules(tx->ft.sa, spec, flow_act, dest, num_dest); in tx_add_reqid_ip_rules()
1172 rule = mlx5_add_flow_rules(tx->ft.sa, spec, flow_act, dest, num_dest); in tx_add_reqid_ip_rules()
1226 dest[0].ft = tx->ft.status; in tx_add_rule()
1266 struct mlx5_flow_table *ft; in tx_add_policy() local
1269 ft = tx_ft_get_policy(mdev, pol_entry->ipsec, attrs->prio); in tx_add_policy()
1270 if (IS_ERR(ft)) in tx_add_policy()
1271 return PTR_ERR(ft); in tx_add_policy()
1308 dest[dstn].ft = tx->ft.sa; in tx_add_policy()
1311 rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, dstn); in tx_add_policy()
1342 struct mlx5_flow_table *ft; in rx_add_policy() local
1347 ft = rx->chains ? ipsec_chains_get_table(rx->chains, attrs->prio) : rx->ft.pol; in rx_add_policy()
1348 if (IS_ERR(ft)) in rx_add_policy()
1349 return PTR_ERR(ft); in rx_add_policy()
1374 dest[dstn].ft = rx->ft.sa; in rx_add_policy()
1389 rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, dstn); in rx_add_policy()
1402 rule = mlx5_add_flow_rules(ft, spec, &flow_act, dest, dstn); in rx_add_policy()
1547 rule = mlx5_add_flow_rules(rx->ft.status, spec, &flow_act, dest, 2); in ipsec_status_rule()
1579 mutex_lock(&rx->ft.mutex); in ipsec_fs_rx_catchall_rules_destroy()
1589 mutex_unlock(&rx->ft.mutex); in ipsec_fs_rx_catchall_rules_destroy()
1598 mlx5_destroy_flow_table(rx_roce->ft); in ipsec_fs_rx_roce_table_destroy()
1603 mutex_lock(&rx->ft.mutex); in ipsec_fs_rx_table_destroy()
1608 mlx5_destroy_flow_table(rx->ft.pol); in ipsec_fs_rx_table_destroy()
1610 mlx5_destroy_flow_table(rx->ft.sa); in ipsec_fs_rx_table_destroy()
1611 mlx5_destroy_flow_table(rx->ft.status); in ipsec_fs_rx_table_destroy()
1613 mutex_unlock(&rx->ft.mutex); in ipsec_fs_rx_table_destroy()
1642 dst.ft = roce->ft_rdma; in ipsec_roce_rx_rule_setup()
1645 rule = mlx5_add_flow_rules(roce->ft, spec, &flow_act, &dst, 1); in ipsec_roce_rx_rule_setup()
1655 rule = mlx5_add_flow_rules(roce->ft, NULL, &flow_act, default_dst, 1); in ipsec_roce_rx_rule_setup()
1702 g = mlx5_create_flow_group(rx->roce.ft, in); in ipsec_roce_rx_rules()
1714 g = mlx5_create_flow_group(rx->roce.ft, in); in ipsec_roce_rx_rules()
1747 mutex_lock(&rx->ft.mutex); in ipsec_fs_rx_catchall_rules()
1755 if (rx->roce.ft) in ipsec_fs_rx_catchall_rules()
1756 dest[0].ft = rx->roce.ft; in ipsec_fs_rx_catchall_rules()
1758 dest[0].ft = priv->fts.vlan.t; in ipsec_fs_rx_catchall_rules()
1768 err = ipsec_miss_create(mdev, rx->ft.pol, &rx->pol, defdst); in ipsec_fs_rx_catchall_rules()
1777 err = ipsec_miss_create(mdev, rx->ft.sa, &rx->sa, defdst); in ipsec_fs_rx_catchall_rules()
1781 mutex_unlock(&rx->ft.mutex); in ipsec_fs_rx_catchall_rules()
1795 mutex_unlock(&rx->ft.mutex); in ipsec_fs_rx_catchall_rules()
1803 struct mlx5_flow_table *ft; in ipsec_fs_rx_roce_tables_create() local
1811 ft = mlx5_create_flow_table(rx->ns, &ft_attr); in ipsec_fs_rx_roce_tables_create()
1812 if (IS_ERR(ft)) { in ipsec_fs_rx_roce_tables_create()
1813 err = PTR_ERR(ft); in ipsec_fs_rx_roce_tables_create()
1816 rx->roce.ft = ft; in ipsec_fs_rx_roce_tables_create()
1820 ft = mlx5_create_flow_table(rx->roce.ns_rdma, &ft_attr); in ipsec_fs_rx_roce_tables_create()
1821 if (IS_ERR(ft)) { in ipsec_fs_rx_roce_tables_create()
1822 err = PTR_ERR(ft); in ipsec_fs_rx_roce_tables_create()
1825 rx->roce.ft_rdma = ft; in ipsec_fs_rx_roce_tables_create()
1829 mlx5_destroy_flow_table(rx->roce.ft); in ipsec_fs_rx_roce_tables_create()
1830 rx->roce.ft = NULL; in ipsec_fs_rx_roce_tables_create()
1838 struct mlx5_flow_table *ft; in ipsec_fs_rx_table_create() local
1841 mutex_lock(&rx->ft.mutex); in ipsec_fs_rx_table_create()
1844 ft = ipsec_rx_ft_create(ns, rx_init_level + 1, 0, 1); in ipsec_fs_rx_table_create()
1845 if (IS_ERR(ft)) { in ipsec_fs_rx_table_create()
1846 err = PTR_ERR(ft); in ipsec_fs_rx_table_create()
1849 rx->ft.sa = ft; in ipsec_fs_rx_table_create()
1852 ft = ipsec_rx_ft_create(ns, rx_init_level + 2, 0, 1); in ipsec_fs_rx_table_create()
1853 if (IS_ERR(ft)) { in ipsec_fs_rx_table_create()
1854 err = PTR_ERR(ft); in ipsec_fs_rx_table_create()
1857 rx->ft.status = ft; in ipsec_fs_rx_table_create()
1860 rx->chains = ipsec_chains_create(mdev, rx->ft.sa, in ipsec_fs_rx_table_create()
1862 rx_init_level, &rx->ft.pol); in ipsec_fs_rx_table_create()
1868 ft = ipsec_rx_ft_create(ns, rx_init_level, 0, 1); in ipsec_fs_rx_table_create()
1869 if (IS_ERR(ft)) { in ipsec_fs_rx_table_create()
1870 err = PTR_ERR(ft); in ipsec_fs_rx_table_create()
1873 rx->ft.pol = ft; in ipsec_fs_rx_table_create()
1885 mlx5_destroy_flow_table(rx->ft.pol); in ipsec_fs_rx_table_create()
1887 mlx5_destroy_flow_table(rx->ft.status); in ipsec_fs_rx_table_create()
1889 mlx5_destroy_flow_table(rx->ft.sa); in ipsec_fs_rx_table_create()
1891 mutex_unlock(&rx->ft.mutex); in ipsec_fs_rx_table_create()
2014 dest.ft = priv->fts.vlan.t; in mlx5e_accel_ipsec_fs_rx_catchall_rules()
2058 priv->fts.ipsec_ft = priv->ipsec->rx_ipv4->ft.pol; in mlx5e_accel_ipsec_fs_rx_tables_create()
2065 WARN_ON(ipsec->tx->ft.refcnt); in mlx5e_accel_ipsec_fs_cleanup()
2066 mutex_destroy(&ipsec->rx_ipv6->ft.mutex); in mlx5e_accel_ipsec_fs_cleanup()
2067 mutex_destroy(&ipsec->rx_ipv4->ft.mutex); in mlx5e_accel_ipsec_fs_cleanup()
2068 mutex_destroy(&ipsec->tx->ft.mutex); in mlx5e_accel_ipsec_fs_cleanup()
2105 mutex_init(&ipsec->tx->ft.mutex); in mlx5e_accel_ipsec_fs_init()
2108 mutex_init(&ipsec->rx_ipv4->ft.mutex); in mlx5e_accel_ipsec_fs_init()
2109 mutex_init(&ipsec->rx_ipv6->ft.mutex); in mlx5e_accel_ipsec_fs_init()