Lines Matching refs:ptp_state

369 	struct mlxsw_sp_ptp_state *ptp_state = mlxsw_sp->ptp_state;  in mlxsw_sp1_ptp_unmatched_save()  local
380 unmatched->gc_cycle = mlxsw_sp->ptp_state->gc_cycle + cycles; in mlxsw_sp1_ptp_unmatched_save()
382 err = rhltable_insert(&ptp_state->unmatched_ht, &unmatched->ht_node, in mlxsw_sp1_ptp_unmatched_save()
398 list = rhltable_lookup(&mlxsw_sp->ptp_state->unmatched_ht, &key, in mlxsw_sp1_ptp_unmatched_lookup()
413 return rhltable_remove(&mlxsw_sp->ptp_state->unmatched_ht, in mlxsw_sp1_ptp_unmatched_remove()
508 spin_lock(&mlxsw_sp->ptp_state->unmatched_lock); in mlxsw_sp1_ptp_got_piece()
536 spin_unlock(&mlxsw_sp->ptp_state->unmatched_lock); in mlxsw_sp1_ptp_got_piece()
630 mlxsw_sp1_ptp_ht_gc_collect(struct mlxsw_sp_ptp_state *ptp_state, in mlxsw_sp1_ptp_ht_gc_collect() argument
646 spin_lock(&ptp_state->unmatched_lock); in mlxsw_sp1_ptp_ht_gc_collect()
647 err = rhltable_remove(&ptp_state->unmatched_ht, &unmatched->ht_node, in mlxsw_sp1_ptp_ht_gc_collect()
649 spin_unlock(&ptp_state->unmatched_lock); in mlxsw_sp1_ptp_ht_gc_collect()
655 mlxsw_sp_port = ptp_state->mlxsw_sp->ports[unmatched->key.local_port]; in mlxsw_sp1_ptp_ht_gc_collect()
672 mlxsw_sp1_ptp_unmatched_finish(ptp_state->mlxsw_sp, unmatched); in mlxsw_sp1_ptp_ht_gc_collect()
682 struct mlxsw_sp_ptp_state *ptp_state; in mlxsw_sp1_ptp_ht_gc() local
687 ptp_state = container_of(dwork, struct mlxsw_sp_ptp_state, ht_gc_dw); in mlxsw_sp1_ptp_ht_gc()
688 gc_cycle = ptp_state->gc_cycle++; in mlxsw_sp1_ptp_ht_gc()
690 rhltable_walk_enter(&ptp_state->unmatched_ht, &iter); in mlxsw_sp1_ptp_ht_gc()
698 mlxsw_sp1_ptp_ht_gc_collect(ptp_state, unmatched); in mlxsw_sp1_ptp_ht_gc()
703 mlxsw_core_schedule_dw(&ptp_state->ht_gc_dw, in mlxsw_sp1_ptp_ht_gc()
828 struct mlxsw_sp_ptp_state *ptp_state; in mlxsw_sp1_ptp_init() local
836 ptp_state = kzalloc(sizeof(*ptp_state), GFP_KERNEL); in mlxsw_sp1_ptp_init()
837 if (!ptp_state) in mlxsw_sp1_ptp_init()
839 ptp_state->mlxsw_sp = mlxsw_sp; in mlxsw_sp1_ptp_init()
841 spin_lock_init(&ptp_state->unmatched_lock); in mlxsw_sp1_ptp_init()
843 err = rhltable_init(&ptp_state->unmatched_ht, in mlxsw_sp1_ptp_init()
869 INIT_DELAYED_WORK(&ptp_state->ht_gc_dw, mlxsw_sp1_ptp_ht_gc); in mlxsw_sp1_ptp_init()
870 mlxsw_core_schedule_dw(&ptp_state->ht_gc_dw, in mlxsw_sp1_ptp_init()
872 return ptp_state; in mlxsw_sp1_ptp_init()
879 rhltable_destroy(&ptp_state->unmatched_ht); in mlxsw_sp1_ptp_init()
881 kfree(ptp_state); in mlxsw_sp1_ptp_init()
885 void mlxsw_sp1_ptp_fini(struct mlxsw_sp_ptp_state *ptp_state) in mlxsw_sp1_ptp_fini() argument
887 struct mlxsw_sp *mlxsw_sp = ptp_state->mlxsw_sp; in mlxsw_sp1_ptp_fini()
889 cancel_delayed_work_sync(&ptp_state->ht_gc_dw); in mlxsw_sp1_ptp_fini()
894 rhltable_free_and_destroy(&ptp_state->unmatched_ht, in mlxsw_sp1_ptp_fini()
896 kfree(ptp_state); in mlxsw_sp1_ptp_fini()