Lines Matching refs:tc

173 				 struct flow_cls_offload *tc,  in efx_tc_flower_replace()  argument
176 struct flow_rule *fr = flow_cls_offload_flow_rule(tc); in efx_tc_flower_replace()
177 struct netlink_ext_ack *extack = tc->common.extack; in efx_tc_flower_replace()
188 if (WARN_ON(!efx->tc)) in efx_tc_flower_replace()
190 if (WARN_ON(!efx->tc->up)) in efx_tc_flower_replace()
226 if (tc->common.chain_index) { in efx_tc_flower_replace()
240 rule->cookie = tc->cookie; in efx_tc_flower_replace()
241 old = rhashtable_lookup_get_insert_fast(&efx->tc->match_action_ht, in efx_tc_flower_replace()
246 "Already offloaded rule (cookie %lx)\n", tc->cookie); in efx_tc_flower_replace()
332 efx_mae_mport_mport(efx, efx->tc->reps_mport_id, in efx_tc_flower_replace()
346 tc->cookie); in efx_tc_flower_replace()
372 rhashtable_remove_fast(&efx->tc->match_action_ht, in efx_tc_flower_replace()
383 struct flow_cls_offload *tc) in efx_tc_flower_destroy() argument
385 struct netlink_ext_ack *extack = tc->common.extack; in efx_tc_flower_destroy()
388 rule = rhashtable_lookup_fast(&efx->tc->match_action_ht, &tc->cookie, in efx_tc_flower_destroy()
398 "Filter %lx not found to remove\n", tc->cookie); in efx_tc_flower_destroy()
406 rhashtable_remove_fast(&efx->tc->match_action_ht, &rule->linkage, in efx_tc_flower_destroy()
414 struct flow_cls_offload *tc, struct efx_rep *efv) in efx_tc_flower() argument
418 if (!efx->tc) in efx_tc_flower()
421 mutex_lock(&efx->tc->mutex); in efx_tc_flower()
422 switch (tc->command) { in efx_tc_flower()
424 rc = efx_tc_flower_replace(efx, net_dev, tc, efv); in efx_tc_flower()
427 rc = efx_tc_flower_destroy(efx, net_dev, tc); in efx_tc_flower()
433 mutex_unlock(&efx->tc->mutex); in efx_tc_flower()
477 struct efx_tc_flow_rule *rule = &efx->tc->dflt.pf; in efx_tc_configure_default_rule_pf()
487 struct efx_tc_flow_rule *rule = &efx->tc->dflt.wire; in efx_tc_configure_default_rule_wire()
502 efx_mae_mport_mport(efx, efx->tc->reps_mport_id, &eg_port); in efx_tc_configure_default_rule_rep()
519 rc = efx_mae_allocate_mport(efx, &efx->tc->reps_mport_id, &rep_mport_label); in efx_tc_configure_rep_mport()
523 efx->tc->reps_mport_id, rep_mport_label); in efx_tc_configure_rep_mport()
525 efx_mae_mport_mport(efx, efx->tc->reps_mport_id, in efx_tc_configure_rep_mport()
526 &efx->tc->reps_mport_vport_id); in efx_tc_configure_rep_mport()
532 efx_mae_free_mport(efx, efx->tc->reps_mport_id); in efx_tc_deconfigure_rep_mport()
533 efx->tc->reps_mport_id = MAE_MPORT_SELECTOR_NULL; in efx_tc_deconfigure_rep_mport()
543 if (!efx->tc) in efx_tc_insert_rep_filters()
547 efx_filter_set_vport_id(&promisc, efx->tc->reps_mport_vport_id); in efx_tc_insert_rep_filters()
551 efx->tc->reps_filter_uc = rc; in efx_tc_insert_rep_filters()
554 efx_filter_set_vport_id(&allmulti, efx->tc->reps_mport_vport_id); in efx_tc_insert_rep_filters()
558 efx->tc->reps_filter_mc = rc; in efx_tc_insert_rep_filters()
566 if (!efx->tc) in efx_tc_remove_rep_filters()
568 if (efx->tc->reps_filter_mc >= 0) in efx_tc_remove_rep_filters()
569 efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx->tc->reps_filter_mc); in efx_tc_remove_rep_filters()
570 efx->tc->reps_filter_mc = -1; in efx_tc_remove_rep_filters()
571 if (efx->tc->reps_filter_uc >= 0) in efx_tc_remove_rep_filters()
572 efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx->tc->reps_filter_uc); in efx_tc_remove_rep_filters()
573 efx->tc->reps_filter_uc = -1; in efx_tc_remove_rep_filters()
580 rc = efx_mae_get_caps(efx, efx->tc->caps); in efx_init_tc()
583 if (efx->tc->caps->match_field_count > MAE_NUM_FIELDS) in efx_init_tc()
590 efx->tc->caps->match_field_count); in efx_init_tc()
591 if (efx->tc->caps->action_prios < EFX_TC_PRIO__NUM) { in efx_init_tc()
594 efx->tc->caps->action_prios, EFX_TC_PRIO__NUM); in efx_init_tc()
606 efx->tc->up = true; in efx_init_tc()
616 if (!efx->tc) in efx_fini_tc()
618 if (efx->tc->up) in efx_fini_tc()
621 efx_tc_deconfigure_default_rule(efx, &efx->tc->dflt.pf); in efx_fini_tc()
622 efx_tc_deconfigure_default_rule(efx, &efx->tc->dflt.wire); in efx_fini_tc()
623 efx->tc->up = false; in efx_fini_tc()
633 efx->tc = kzalloc(sizeof(*efx->tc), GFP_KERNEL); in efx_init_struct_tc()
634 if (!efx->tc) in efx_init_struct_tc()
636 efx->tc->caps = kzalloc(sizeof(struct mae_caps), GFP_KERNEL); in efx_init_struct_tc()
637 if (!efx->tc->caps) { in efx_init_struct_tc()
641 INIT_LIST_HEAD(&efx->tc->block_list); in efx_init_struct_tc()
643 mutex_init(&efx->tc->mutex); in efx_init_struct_tc()
644 rc = rhashtable_init(&efx->tc->match_action_ht, &efx_tc_match_action_ht_params); in efx_init_struct_tc()
647 efx->tc->reps_filter_uc = -1; in efx_init_struct_tc()
648 efx->tc->reps_filter_mc = -1; in efx_init_struct_tc()
649 INIT_LIST_HEAD(&efx->tc->dflt.pf.acts.list); in efx_init_struct_tc()
650 efx->tc->dflt.pf.fw_id = MC_CMD_MAE_ACTION_RULE_INSERT_OUT_ACTION_RULE_ID_NULL; in efx_init_struct_tc()
651 INIT_LIST_HEAD(&efx->tc->dflt.wire.acts.list); in efx_init_struct_tc()
652 efx->tc->dflt.wire.fw_id = MC_CMD_MAE_ACTION_RULE_INSERT_OUT_ACTION_RULE_ID_NULL; in efx_init_struct_tc()
655 mutex_destroy(&efx->tc->mutex); in efx_init_struct_tc()
656 kfree(efx->tc->caps); in efx_init_struct_tc()
658 kfree(efx->tc); in efx_init_struct_tc()
659 efx->tc = NULL; in efx_init_struct_tc()
665 if (!efx->tc) in efx_fini_struct_tc()
668 mutex_lock(&efx->tc->mutex); in efx_fini_struct_tc()
669 EFX_WARN_ON_PARANOID(efx->tc->dflt.pf.fw_id != in efx_fini_struct_tc()
671 EFX_WARN_ON_PARANOID(efx->tc->dflt.wire.fw_id != in efx_fini_struct_tc()
673 rhashtable_free_and_destroy(&efx->tc->match_action_ht, efx_tc_flow_free, in efx_fini_struct_tc()
675 mutex_unlock(&efx->tc->mutex); in efx_fini_struct_tc()
676 mutex_destroy(&efx->tc->mutex); in efx_fini_struct_tc()
677 kfree(efx->tc->caps); in efx_fini_struct_tc()
678 kfree(efx->tc); in efx_fini_struct_tc()
679 efx->tc = NULL; in efx_fini_struct_tc()