Lines Matching refs:fc

580 				     struct prestera_kern_fib_cache *fc)
587 if (!prestera_fib_info_is_nh(&fc->info))
590 nhs = prestera_kern_fib_info_nhs(&fc->info);
595 nhc = prestera_kern_fib_info_nhc(&fc->fen4_info.info, i);
604 fc->kern_neigh_cache_head[i].this = fc;
605 fc->kern_neigh_cache_head[i].n_cache = n_cache;
606 list_add(&fc->kern_neigh_cache_head[i].head,
697 struct prestera_kern_fib_cache *fc,
702 switch (fc->key.addr.v) {
704 fri.fi = fc->fen4_info.fi;
705 fri.tb_id = fc->key.kern_tb_id;
706 fri.dst = fc->key.addr.u.ipv4;
707 fri.dst_len = fc->key.prefix_len;
708 fri.dscp = fc->fen4_info.dscp;
709 fri.type = fc->fen4_info.type;
734 /* Exception for fc with prefix 32: LPM entry is already used by fib */
858 struct prestera_kern_fib_cache *fc)
863 memset(&fc->lpm_info, 0, sizeof(fc->lpm_info));
865 switch (prestera_kern_fib_info_type(&fc->info)) {
867 if (prestera_fib_info_is_direct(&fc->info) &&
868 fc->key.prefix_len ==
869 PRESTERA_IP_ADDR_PLEN(fc->key.addr.v)) {
877 nhc = prestera_kern_fib_info_nhc(&fc->info, 0);
878 fc->lpm_info.fib_type = PRESTERA_FIB_TYPE_UC_NH;
879 fc->lpm_info.nh_grp_key.neigh[0].addr =
880 fc->key.addr;
881 fc->lpm_info.nh_grp_key.neigh[0].rif =
892 if (!fc->kern_neigh_cache_head[nh_cnt].n_cache)
895 fc->lpm_info.nh_grp_key.neigh[nh_cnt].addr =
896 fc->kern_neigh_cache_head[nh_cnt].n_cache->key.addr;
897 fc->lpm_info.nh_grp_key.neigh[nh_cnt].rif =
898 fc->kern_neigh_cache_head[nh_cnt].n_cache->key.dev;
901 fc->lpm_info.fib_type = nh_cnt ?
912 fc->lpm_info.fib_type = PRESTERA_FIB_TYPE_TRAP;
915 fc->lpm_info.fib_type = PRESTERA_FIB_TYPE_DROP;
922 fc->lpm_info.fib_key.addr = fc->key.addr;
923 fc->lpm_info.fib_key.prefix_len = fc->key.prefix_len;
924 fc->lpm_info.fib_key.tb_id = prestera_fix_tb_id(fc->key.kern_tb_id);
930 struct prestera_kern_fib_cache *fc,
935 fib_node = prestera_fib_node_find(sw, &fc->lpm_info.fib_key);
942 fib_node = prestera_fib_node_create(sw, &fc->lpm_info.fib_key,
943 fc->lpm_info.fib_type,
944 &fc->lpm_info.nh_grp_key);
948 &fc->key.addr.u.ipv4, fc->key.prefix_len,
949 fc->key.kern_tb_id);
957 struct prestera_kern_fib_cache *fc)
961 err = __prestera_pr_k_arb_fc_lpm_info_calc(sw, fc);
965 err = __prestera_k_arb_f_lpm_set(sw, fc, fc->reachable);
967 __prestera_k_arb_fib_lpm_offload_set(sw, fc,
972 switch (fc->lpm_info.fib_type) {
974 __prestera_k_arb_fib_lpm_offload_set(sw, fc, false,
975 fc->reachable, false);
978 __prestera_k_arb_fib_lpm_offload_set(sw, fc, false,
979 false, fc->reachable);
982 __prestera_k_arb_fib_lpm_offload_set(sw, fc, false, true,
983 fc->reachable);
994 struct prestera_kern_fib_cache *fc)
1001 if (fc->key.kern_tb_id == RT_TABLE_LOCAL) {
1002 memcpy(&fc_key, &fc->key, sizeof(fc_key));
1012 struct prestera_kern_fib_cache *fc)
1019 if (fc->key.kern_tb_id == RT_TABLE_MAIN) {
1020 memcpy(&fc_key, &fc->key, sizeof(fc_key));