Lines Matching refs:meter_entry
573 struct nfp_meter_entry *meter_entry = NULL; in nfp_flower_add_meter_entry() local
576 meter_entry = rhashtable_lookup_fast(&priv->meter_table, in nfp_flower_add_meter_entry()
579 if (meter_entry) in nfp_flower_add_meter_entry()
580 return meter_entry; in nfp_flower_add_meter_entry()
582 meter_entry = kzalloc(sizeof(*meter_entry), GFP_KERNEL); in nfp_flower_add_meter_entry()
583 if (!meter_entry) in nfp_flower_add_meter_entry()
586 meter_entry->meter_id = meter_id; in nfp_flower_add_meter_entry()
587 meter_entry->used = jiffies; in nfp_flower_add_meter_entry()
588 if (rhashtable_insert_fast(&priv->meter_table, &meter_entry->ht_node, in nfp_flower_add_meter_entry()
590 kfree(meter_entry); in nfp_flower_add_meter_entry()
599 return meter_entry; in nfp_flower_add_meter_entry()
604 struct nfp_meter_entry *meter_entry = NULL; in nfp_flower_del_meter_entry() local
607 meter_entry = rhashtable_lookup_fast(&priv->meter_table, &meter_id, in nfp_flower_del_meter_entry()
609 if (!meter_entry) in nfp_flower_del_meter_entry()
613 &meter_entry->ht_node, in nfp_flower_del_meter_entry()
615 kfree(meter_entry); in nfp_flower_del_meter_entry()
627 struct nfp_meter_entry *meter_entry = NULL; in nfp_flower_setup_meter_entry() local
637 meter_entry = nfp_flower_add_meter_entry(app, meter_id); in nfp_flower_setup_meter_entry()
644 if (!meter_entry) { in nfp_flower_setup_meter_entry()
650 meter_entry->bps = true; in nfp_flower_setup_meter_entry()
651 meter_entry->rate = action->police.rate_bytes_ps; in nfp_flower_setup_meter_entry()
652 meter_entry->burst = action->police.burst; in nfp_flower_setup_meter_entry()
654 meter_entry->bps = false; in nfp_flower_setup_meter_entry()
655 meter_entry->rate = action->police.rate_pkt_ps; in nfp_flower_setup_meter_entry()
656 meter_entry->burst = action->police.burst_pkt; in nfp_flower_setup_meter_entry()
674 struct nfp_meter_entry *meter_entry = NULL; in nfp_flower_stats_meter_request_all() local
681 while ((meter_entry = rhashtable_walk_next(&iter)) != NULL) { in nfp_flower_stats_meter_request_all()
682 if (IS_ERR(meter_entry)) in nfp_flower_stats_meter_request_all()
685 meter_entry->meter_id, false); in nfp_flower_stats_meter_request_all()
755 struct nfp_meter_entry *meter_entry = NULL; in nfp_act_remove_actions() local
769 meter_entry = nfp_flower_search_meter_entry(app, meter_id); in nfp_act_remove_actions()
770 if (!meter_entry) { in nfp_act_remove_actions()
775 pps = !meter_entry->bps; in nfp_act_remove_actions()
799 struct nfp_meter_entry *meter_entry = NULL; in nfp_act_stats_reply() local
806 meter_entry = nfp_flower_search_meter_entry(app, meter_id); in nfp_act_stats_reply()
807 if (!meter_entry) in nfp_act_stats_reply()
810 meter_entry->stats.curr.pkts = be64_to_cpu(msg->pass_pkts) + in nfp_act_stats_reply()
812 meter_entry->stats.curr.bytes = be64_to_cpu(msg->pass_bytes) + in nfp_act_stats_reply()
814 meter_entry->stats.curr.drops = be64_to_cpu(msg->drop_pkts); in nfp_act_stats_reply()
815 if (!meter_entry->stats.update) { in nfp_act_stats_reply()
816 meter_entry->stats.prev.pkts = meter_entry->stats.curr.pkts; in nfp_act_stats_reply()
817 meter_entry->stats.prev.bytes = meter_entry->stats.curr.bytes; in nfp_act_stats_reply()
818 meter_entry->stats.prev.drops = meter_entry->stats.curr.drops; in nfp_act_stats_reply()
821 meter_entry->stats.update = jiffies; in nfp_act_stats_reply()
832 struct nfp_meter_entry *meter_entry = NULL; in nfp_act_stats_actions() local
843 meter_entry = nfp_flower_search_meter_entry(app, fl_act->index); in nfp_act_stats_actions()
844 if (!meter_entry) { in nfp_act_stats_actions()
848 diff_pkts = meter_entry->stats.curr.pkts > meter_entry->stats.prev.pkts ? in nfp_act_stats_actions()
849 meter_entry->stats.curr.pkts - meter_entry->stats.prev.pkts : 0; in nfp_act_stats_actions()
850 diff_bytes = meter_entry->stats.curr.bytes > meter_entry->stats.prev.bytes ? in nfp_act_stats_actions()
851 meter_entry->stats.curr.bytes - meter_entry->stats.prev.bytes : 0; in nfp_act_stats_actions()
852 diff_drops = meter_entry->stats.curr.drops > meter_entry->stats.prev.drops ? in nfp_act_stats_actions()
853 meter_entry->stats.curr.drops - meter_entry->stats.prev.drops : 0; in nfp_act_stats_actions()
856 meter_entry->stats.update, in nfp_act_stats_actions()
859 meter_entry->stats.prev.pkts = meter_entry->stats.curr.pkts; in nfp_act_stats_actions()
860 meter_entry->stats.prev.bytes = meter_entry->stats.curr.bytes; in nfp_act_stats_actions()
861 meter_entry->stats.prev.drops = meter_entry->stats.curr.drops; in nfp_act_stats_actions()