Lines Matching refs:mp

117 	struct fc_exch_mgr *mp;  member
313 struct fc_exch_mgr *mp; in fc_exch_release() local
316 mp = ep->em; in fc_exch_release()
320 mempool_free(ep, mp->ep_pool); in fc_exch_release()
813 struct fc_exch_mgr *mp) in fc_exch_em_alloc() argument
821 ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC); in fc_exch_em_alloc()
823 atomic_inc(&mp->stats.no_free_exch); in fc_exch_em_alloc()
829 pool = per_cpu_ptr(mp->pool, cpu); in fc_exch_em_alloc()
851 index = index == mp->pool_max_index ? 0 : index + 1; in fc_exch_em_alloc()
855 pool->next_index = index == mp->pool_max_index ? 0 : index + 1; in fc_exch_em_alloc()
875 ep->oxid = ep->xid = (index << fc_cpu_order | cpu) + mp->min_xid; in fc_exch_em_alloc()
876 ep->em = mp; in fc_exch_em_alloc()
881 ep->class = mp->class; in fc_exch_em_alloc()
889 atomic_inc(&mp->stats.no_free_exch_xid); in fc_exch_em_alloc()
890 mempool_free(ep, mp->ep_pool); in fc_exch_em_alloc()
913 ep = fc_exch_em_alloc(lport, ema->mp); in fc_exch_alloc()
926 static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid) in fc_exch_find() argument
928 struct fc_lport *lport = mp->lport; in fc_exch_find()
942 if ((xid >= mp->min_xid) && (xid <= mp->max_xid)) { in fc_exch_find()
943 pool = per_cpu_ptr(mp->pool, cpu); in fc_exch_find()
945 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order); in fc_exch_find()
991 struct fc_exch_mgr *mp, in fc_exch_resp() argument
1039 struct fc_exch_mgr *mp, in fc_seq_lookup_recip() argument
1057 ep = fc_exch_find(mp, xid); in fc_seq_lookup_recip()
1059 atomic_inc(&mp->stats.xid_not_found); in fc_seq_lookup_recip()
1086 ep = fc_exch_find(mp, xid); in fc_seq_lookup_recip()
1089 atomic_inc(&mp->stats.xid_busy); in fc_seq_lookup_recip()
1093 ep = fc_exch_resp(lport, mp, fp); in fc_seq_lookup_recip()
1100 atomic_inc(&mp->stats.xid_not_found); in fc_seq_lookup_recip()
1118 atomic_inc(&mp->stats.seq_not_found); in fc_seq_lookup_recip()
1168 static struct fc_seq *fc_seq_lookup_orig(struct fc_exch_mgr *mp, in fc_seq_lookup_orig() argument
1180 ep = fc_exch_find(mp, xid); in fc_seq_lookup_orig()
1484 fc_seq_lookup_recip(lport, ema->mp, fp) == FC_RJT_NONE) in fc_seq_assign()
1509 static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp, in fc_exch_recv_req() argument
1536 reject = fc_seq_lookup_recip(lport, mp, fp); in fc_exch_recv_req()
1571 static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_seq_resp() argument
1580 ep = fc_exch_find(mp, ntohs(fh->fh_ox_id)); in fc_exch_recv_seq_resp()
1582 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1586 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1592 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1597 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1665 static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_resp() argument
1669 sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */ in fc_exch_recv_resp()
1672 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_resp()
1674 atomic_inc(&mp->stats.non_bls_resp); in fc_exch_recv_resp()
1764 static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_bls() argument
1774 ep = fc_exch_find(mp, (f_ctl & FC_FC_EX_CTX) ? in fc_exch_recv_bls()
1987 per_cpu_ptr(ema->mp->pool, cpu), in fc_exch_mgr_reset()
2005 if (ema->mp->min_xid <= xid && xid <= ema->mp->max_xid) in fc_exch_lookup()
2006 return fc_exch_find(ema->mp, xid); in fc_exch_lookup()
2365 struct fc_exch_mgr *mp; in fc_exch_update_stats() local
2370 mp = ema->mp; in fc_exch_update_stats()
2371 st->fc_no_free_exch += atomic_read(&mp->stats.no_free_exch); in fc_exch_update_stats()
2373 atomic_read(&mp->stats.no_free_exch_xid); in fc_exch_update_stats()
2374 st->fc_xid_not_found += atomic_read(&mp->stats.xid_not_found); in fc_exch_update_stats()
2375 st->fc_xid_busy += atomic_read(&mp->stats.xid_busy); in fc_exch_update_stats()
2376 st->fc_seq_not_found += atomic_read(&mp->stats.seq_not_found); in fc_exch_update_stats()
2377 st->fc_non_bls_resp += atomic_read(&mp->stats.non_bls_resp); in fc_exch_update_stats()
2389 struct fc_exch_mgr *mp, in fc_exch_mgr_add() argument
2398 ema->mp = mp; in fc_exch_mgr_add()
2402 kref_get(&mp->kref); in fc_exch_mgr_add()
2413 struct fc_exch_mgr *mp = container_of(kref, struct fc_exch_mgr, kref); in fc_exch_mgr_destroy() local
2415 mempool_destroy(mp->ep_pool); in fc_exch_mgr_destroy()
2416 free_percpu(mp->pool); in fc_exch_mgr_destroy()
2417 kfree(mp); in fc_exch_mgr_destroy()
2428 kref_put(&ema->mp->kref, fc_exch_mgr_destroy); in fc_exch_mgr_del()
2443 if (!fc_exch_mgr_add(dst, ema->mp, ema->match)) in fc_exch_mgr_list_clone()
2467 struct fc_exch_mgr *mp; in fc_exch_mgr_alloc() local
2483 mp = kzalloc(sizeof(struct fc_exch_mgr), GFP_ATOMIC); in fc_exch_mgr_alloc()
2484 if (!mp) in fc_exch_mgr_alloc()
2487 mp->class = class; in fc_exch_mgr_alloc()
2488 mp->lport = lport; in fc_exch_mgr_alloc()
2490 mp->min_xid = min_xid; in fc_exch_mgr_alloc()
2496 mp->max_xid = pool_exch_range * (fc_cpu_mask + 1) + in fc_exch_mgr_alloc()
2499 mp->max_xid = max_xid; in fc_exch_mgr_alloc()
2500 pool_exch_range = (mp->max_xid - mp->min_xid + 1) / in fc_exch_mgr_alloc()
2504 mp->ep_pool = mempool_create_slab_pool(2, fc_em_cachep); in fc_exch_mgr_alloc()
2505 if (!mp->ep_pool) in fc_exch_mgr_alloc()
2513 mp->pool_max_index = pool_exch_range - 1; in fc_exch_mgr_alloc()
2519 mp->pool = __alloc_percpu(pool_size, __alignof__(struct fc_exch_pool)); in fc_exch_mgr_alloc()
2520 if (!mp->pool) in fc_exch_mgr_alloc()
2523 pool = per_cpu_ptr(mp->pool, cpu); in fc_exch_mgr_alloc()
2531 kref_init(&mp->kref); in fc_exch_mgr_alloc()
2532 if (!fc_exch_mgr_add(lport, mp, match)) { in fc_exch_mgr_alloc()
2533 free_percpu(mp->pool); in fc_exch_mgr_alloc()
2542 kref_put(&mp->kref, fc_exch_mgr_destroy); in fc_exch_mgr_alloc()
2543 return mp; in fc_exch_mgr_alloc()
2546 mempool_destroy(mp->ep_pool); in fc_exch_mgr_alloc()
2548 kfree(mp); in fc_exch_mgr_alloc()
2591 if ((xid >= ema->mp->min_xid) && in fc_find_ema()
2592 (xid <= ema->mp->max_xid)) in fc_find_ema()
2639 fc_exch_recv_bls(ema->mp, fp); in fc_exch_recv()
2642 fc_exch_recv_seq_resp(ema->mp, fp); in fc_exch_recv()
2644 fc_exch_recv_resp(ema->mp, fp); in fc_exch_recv()
2646 fc_exch_recv_req(lport, ema->mp, fp); in fc_exch_recv()