Lines Matching refs:peer_mep
34 struct br_cfm_peer_mep *peer_mep; in br_peer_mep_find() local
36 hlist_for_each_entry_rcu(peer_mep, &mep->peer_mep_list, head, in br_peer_mep_find()
38 if (peer_mep->mepid == mepid) in br_peer_mep_find()
39 return peer_mep; in br_peer_mep_find()
128 static void ccm_rx_timer_start(struct br_cfm_peer_mep *peer_mep) in ccm_rx_timer_start() argument
132 interval_us = interval_to_us(peer_mep->mep->cc_config.exp_interval); in ccm_rx_timer_start()
137 queue_delayed_work(system_wq, &peer_mep->ccm_rx_dwork, in ccm_rx_timer_start()
148 static void cc_peer_enable(struct br_cfm_peer_mep *peer_mep) in cc_peer_enable() argument
150 memset(&peer_mep->cc_status, 0, sizeof(peer_mep->cc_status)); in cc_peer_enable()
151 peer_mep->ccm_rx_count_miss = 0; in cc_peer_enable()
153 ccm_rx_timer_start(peer_mep); in cc_peer_enable()
156 static void cc_peer_disable(struct br_cfm_peer_mep *peer_mep) in cc_peer_disable() argument
158 cancel_delayed_work_sync(&peer_mep->ccm_rx_dwork); in cc_peer_disable()
297 struct br_cfm_peer_mep *peer_mep; in ccm_rx_work_expired() local
302 peer_mep = container_of(del_work, struct br_cfm_peer_mep, ccm_rx_dwork); in ccm_rx_work_expired()
305 if (peer_mep->ccm_rx_count_miss < 13) { in ccm_rx_work_expired()
307 peer_mep->ccm_rx_count_miss++; in ccm_rx_work_expired()
310 ccm_rx_timer_start(peer_mep); in ccm_rx_work_expired()
315 peer_mep->cc_status.ccm_defect = true; in ccm_rx_work_expired()
319 b_port = rcu_dereference(peer_mep->mep->b_port); in ccm_rx_work_expired()
327 struct br_cfm_peer_mep *peer_mep) in ccm_tlv_extract() argument
349 peer_mep->cc_status.tlv_seen = true; in ccm_tlv_extract()
350 peer_mep->cc_status.if_tlv_value = (h_s_tlv & 0xFF); in ccm_tlv_extract()
355 peer_mep->cc_status.tlv_seen = true; in ccm_tlv_extract()
356 peer_mep->cc_status.port_tlv_value = (h_s_tlv & 0xFF); in ccm_tlv_extract()
374 struct br_cfm_peer_mep *peer_mep; in br_cfm_frame_rx() local
434 peer_mep = br_peer_mep_find(mep, (u32)ntohs(*mepid)); in br_cfm_frame_rx()
435 if (!peer_mep) in br_cfm_frame_rx()
445 if (peer_mep->cc_status.ccm_defect) { in br_cfm_frame_rx()
446 peer_mep->cc_status.ccm_defect = false; in br_cfm_frame_rx()
452 ccm_rx_timer_start(peer_mep); in br_cfm_frame_rx()
455 peer_mep->cc_status.seen = true; in br_cfm_frame_rx()
456 peer_mep->ccm_rx_count_miss = 0; in br_cfm_frame_rx()
459 peer_mep->cc_status.rdi = (hdr->flags & 0x80) ? true : false; in br_cfm_frame_rx()
469 peer_mep->cc_status.seq_unexp_seen = true; in br_cfm_frame_rx()
479 size = ccm_tlv_extract(skb, index, peer_mep); in br_cfm_frame_rx()
572 struct br_cfm_peer_mep *peer_mep; in mep_delete_implementation() local
578 hlist_for_each_entry_safe(peer_mep, n_store, &mep->peer_mep_list, head) { in mep_delete_implementation()
579 cancel_delayed_work_sync(&peer_mep->ccm_rx_dwork); in mep_delete_implementation()
580 hlist_del_rcu(&peer_mep->head); in mep_delete_implementation()
581 kfree_rcu(peer_mep, rcu); in mep_delete_implementation()
640 struct br_cfm_peer_mep *peer_mep; in br_cfm_cc_config_set() local
658 hlist_for_each_entry(peer_mep, &mep->peer_mep_list, head) in br_cfm_cc_config_set()
659 cc_peer_enable(peer_mep); in br_cfm_cc_config_set()
663 hlist_for_each_entry(peer_mep, &mep->peer_mep_list, head) in br_cfm_cc_config_set()
664 cc_peer_disable(peer_mep); in br_cfm_cc_config_set()
677 struct br_cfm_peer_mep *peer_mep; in br_cfm_cc_peer_mep_add() local
689 peer_mep = br_peer_mep_find(mep, mepid); in br_cfm_cc_peer_mep_add()
690 if (peer_mep) { in br_cfm_cc_peer_mep_add()
696 peer_mep = kzalloc(sizeof(*peer_mep), GFP_KERNEL); in br_cfm_cc_peer_mep_add()
697 if (!peer_mep) in br_cfm_cc_peer_mep_add()
700 peer_mep->mepid = mepid; in br_cfm_cc_peer_mep_add()
701 peer_mep->mep = mep; in br_cfm_cc_peer_mep_add()
702 INIT_DELAYED_WORK(&peer_mep->ccm_rx_dwork, ccm_rx_work_expired); in br_cfm_cc_peer_mep_add()
705 cc_peer_enable(peer_mep); in br_cfm_cc_peer_mep_add()
707 hlist_add_tail_rcu(&peer_mep->head, &mep->peer_mep_list); in br_cfm_cc_peer_mep_add()
716 struct br_cfm_peer_mep *peer_mep; in br_cfm_cc_peer_mep_remove() local
728 peer_mep = br_peer_mep_find(mep, mepid); in br_cfm_cc_peer_mep_remove()
729 if (!peer_mep) { in br_cfm_cc_peer_mep_remove()
735 cc_peer_disable(peer_mep); in br_cfm_cc_peer_mep_remove()
737 hlist_del_rcu(&peer_mep->head); in br_cfm_cc_peer_mep_remove()
738 kfree_rcu(peer_mep, rcu); in br_cfm_cc_peer_mep_remove()
836 struct br_cfm_peer_mep *peer_mep; in br_cfm_peer_mep_count() local
843 hlist_for_each_entry_rcu(peer_mep, &mep->peer_mep_list, head) in br_cfm_peer_mep_count()