Lines Matching refs:cnt

32 	struct efx_tc_counter *cnt = ptr;  in efx_tc_counter_free()  local
34 kfree(cnt); in efx_tc_counter_free()
82 struct efx_tc_counter *cnt; in efx_tc_flower_allocate_counter() local
85 cnt = kzalloc(sizeof(*cnt), GFP_USER); in efx_tc_flower_allocate_counter()
86 if (!cnt) in efx_tc_flower_allocate_counter()
89 spin_lock_init(&cnt->lock); in efx_tc_flower_allocate_counter()
90 cnt->touched = jiffies; in efx_tc_flower_allocate_counter()
91 cnt->type = type; in efx_tc_flower_allocate_counter()
93 rc = efx_mae_allocate_counter(efx, cnt); in efx_tc_flower_allocate_counter()
96 rc = rhashtable_insert_fast(&efx->tc->counter_ht, &cnt->linkage, in efx_tc_flower_allocate_counter()
100 return cnt; in efx_tc_flower_allocate_counter()
107 rc2 = efx_mae_free_counter(efx, cnt); in efx_tc_flower_allocate_counter()
111 cnt->fw_id, rc2); in efx_tc_flower_allocate_counter()
113 kfree(cnt); in efx_tc_flower_allocate_counter()
118 struct efx_tc_counter *cnt) in efx_tc_flower_release_counter() argument
122 rhashtable_remove_fast(&efx->tc->counter_ht, &cnt->linkage, in efx_tc_flower_release_counter()
124 rc = efx_mae_free_counter(efx, cnt); in efx_tc_flower_release_counter()
128 cnt->fw_id, rc); in efx_tc_flower_release_counter()
136 EFX_WARN_ON_PARANOID(spin_is_locked(&cnt->lock)); in efx_tc_flower_release_counter()
137 kfree(cnt); in efx_tc_flower_release_counter()
161 efx_tc_flower_release_counter(efx, ctr->cnt); in efx_tc_flower_put_counter_index()
170 struct efx_tc_counter *cnt; in efx_tc_flower_get_counter_index() local
187 cnt = efx_tc_flower_allocate_counter(efx, type); in efx_tc_flower_get_counter_index()
188 if (IS_ERR(cnt)) { in efx_tc_flower_get_counter_index()
193 return (void *)cnt; /* it's an ERR_PTR */ in efx_tc_flower_get_counter_index()
195 ctr->cnt = cnt; in efx_tc_flower_get_counter_index()
269 struct efx_tc_counter *cnt; in efx_tc_counter_update() local
272 cnt = efx_tc_flower_find_counter_by_fw_id(efx, counter_type, counter_idx); in efx_tc_counter_update()
273 if (!cnt) { in efx_tc_counter_update()
285 spin_lock_bh(&cnt->lock); in efx_tc_counter_update()
286 if ((s32)mark - (s32)cnt->gen < 0) { in efx_tc_counter_update()
298 cnt->gen = mark; in efx_tc_counter_update()
300 cnt->packets += packets; in efx_tc_counter_update()
301 cnt->bytes += bytes; in efx_tc_counter_update()
302 cnt->touched = jiffies; in efx_tc_counter_update()
304 spin_unlock_bh(&cnt->lock); in efx_tc_counter_update()