Lines Matching refs:mp

127 	struct fc_exch_mgr *mp;  member
323 struct fc_exch_mgr *mp; in fc_exch_release() local
326 mp = ep->em; in fc_exch_release()
330 mempool_free(ep, mp->ep_pool); in fc_exch_release()
802 struct fc_exch_mgr *mp) in fc_exch_em_alloc() argument
810 ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC); in fc_exch_em_alloc()
812 atomic_inc(&mp->stats.no_free_exch); in fc_exch_em_alloc()
818 pool = per_cpu_ptr(mp->pool, cpu); in fc_exch_em_alloc()
837 index = index == mp->pool_max_index ? 0 : index + 1; in fc_exch_em_alloc()
841 pool->next_index = index == mp->pool_max_index ? 0 : index + 1; in fc_exch_em_alloc()
861 ep->oxid = ep->xid = (index << fc_cpu_order | cpu) + mp->min_xid; in fc_exch_em_alloc()
862 ep->em = mp; in fc_exch_em_alloc()
867 ep->class = mp->class; in fc_exch_em_alloc()
875 atomic_inc(&mp->stats.no_free_exch_xid); in fc_exch_em_alloc()
876 mempool_free(ep, mp->ep_pool); in fc_exch_em_alloc()
898 return fc_exch_em_alloc(lport, ema->mp); in fc_exch_alloc()
907 static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid) in fc_exch_find() argument
912 if ((xid >= mp->min_xid) && (xid <= mp->max_xid)) { in fc_exch_find()
913 pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask); in fc_exch_find()
915 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order); in fc_exch_find()
956 struct fc_exch_mgr *mp, in fc_exch_resp() argument
1004 struct fc_exch_mgr *mp, in fc_seq_lookup_recip() argument
1022 ep = fc_exch_find(mp, xid); in fc_seq_lookup_recip()
1024 atomic_inc(&mp->stats.xid_not_found); in fc_seq_lookup_recip()
1051 ep = fc_exch_find(mp, xid); in fc_seq_lookup_recip()
1054 atomic_inc(&mp->stats.xid_busy); in fc_seq_lookup_recip()
1058 ep = fc_exch_resp(lport, mp, fp); in fc_seq_lookup_recip()
1065 atomic_inc(&mp->stats.xid_not_found); in fc_seq_lookup_recip()
1083 atomic_inc(&mp->stats.seq_not_found); in fc_seq_lookup_recip()
1133 static struct fc_seq *fc_seq_lookup_orig(struct fc_exch_mgr *mp, in fc_seq_lookup_orig() argument
1145 ep = fc_exch_find(mp, xid); in fc_seq_lookup_orig()
1438 fc_seq_lookup_recip(lport, ema->mp, fp) == FC_RJT_NONE) in fc_seq_assign()
1461 static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp, in fc_exch_recv_req() argument
1488 reject = fc_seq_lookup_recip(lport, mp, fp); in fc_exch_recv_req()
1523 static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_seq_resp() argument
1532 ep = fc_exch_find(mp, ntohs(fh->fh_ox_id)); in fc_exch_recv_seq_resp()
1534 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1538 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1544 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1549 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_seq_resp()
1558 atomic_inc(&mp->stats.seq_not_found); in fc_exch_recv_seq_resp()
1614 static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_resp() argument
1618 sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */ in fc_exch_recv_resp()
1621 atomic_inc(&mp->stats.xid_not_found); in fc_exch_recv_resp()
1623 atomic_inc(&mp->stats.non_bls_resp); in fc_exch_recv_resp()
1712 static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp) in fc_exch_recv_bls() argument
1722 ep = fc_exch_find(mp, (f_ctl & FC_FC_EX_CTX) ? in fc_exch_recv_bls()
1917 per_cpu_ptr(ema->mp->pool, cpu), in fc_exch_mgr_reset()
1935 if (ema->mp->min_xid <= xid && xid <= ema->mp->max_xid) in fc_exch_lookup()
1936 return fc_exch_find(ema->mp, xid); in fc_exch_lookup()
2258 struct fc_exch_mgr *mp; in fc_exch_update_stats() local
2263 mp = ema->mp; in fc_exch_update_stats()
2264 st->fc_no_free_exch += atomic_read(&mp->stats.no_free_exch); in fc_exch_update_stats()
2266 atomic_read(&mp->stats.no_free_exch_xid); in fc_exch_update_stats()
2267 st->fc_xid_not_found += atomic_read(&mp->stats.xid_not_found); in fc_exch_update_stats()
2268 st->fc_xid_busy += atomic_read(&mp->stats.xid_busy); in fc_exch_update_stats()
2269 st->fc_seq_not_found += atomic_read(&mp->stats.seq_not_found); in fc_exch_update_stats()
2270 st->fc_non_bls_resp += atomic_read(&mp->stats.non_bls_resp); in fc_exch_update_stats()
2282 struct fc_exch_mgr *mp, in fc_exch_mgr_add() argument
2291 ema->mp = mp; in fc_exch_mgr_add()
2295 kref_get(&mp->kref); in fc_exch_mgr_add()
2306 struct fc_exch_mgr *mp = container_of(kref, struct fc_exch_mgr, kref); in fc_exch_mgr_destroy() local
2308 mempool_destroy(mp->ep_pool); in fc_exch_mgr_destroy()
2309 free_percpu(mp->pool); in fc_exch_mgr_destroy()
2310 kfree(mp); in fc_exch_mgr_destroy()
2321 kref_put(&ema->mp->kref, fc_exch_mgr_destroy); in fc_exch_mgr_del()
2336 if (!fc_exch_mgr_add(dst, ema->mp, ema->match)) in fc_exch_mgr_list_clone()
2360 struct fc_exch_mgr *mp; in fc_exch_mgr_alloc() local
2376 mp = kzalloc(sizeof(struct fc_exch_mgr), GFP_ATOMIC); in fc_exch_mgr_alloc()
2377 if (!mp) in fc_exch_mgr_alloc()
2380 mp->class = class; in fc_exch_mgr_alloc()
2382 mp->min_xid = min_xid; in fc_exch_mgr_alloc()
2388 mp->max_xid = pool_exch_range * (fc_cpu_mask + 1) + in fc_exch_mgr_alloc()
2391 mp->max_xid = max_xid; in fc_exch_mgr_alloc()
2392 pool_exch_range = (mp->max_xid - mp->min_xid + 1) / in fc_exch_mgr_alloc()
2396 mp->ep_pool = mempool_create_slab_pool(2, fc_em_cachep); in fc_exch_mgr_alloc()
2397 if (!mp->ep_pool) in fc_exch_mgr_alloc()
2405 mp->pool_max_index = pool_exch_range - 1; in fc_exch_mgr_alloc()
2411 mp->pool = __alloc_percpu(pool_size, __alignof__(struct fc_exch_pool)); in fc_exch_mgr_alloc()
2412 if (!mp->pool) in fc_exch_mgr_alloc()
2415 pool = per_cpu_ptr(mp->pool, cpu); in fc_exch_mgr_alloc()
2423 kref_init(&mp->kref); in fc_exch_mgr_alloc()
2424 if (!fc_exch_mgr_add(lport, mp, match)) { in fc_exch_mgr_alloc()
2425 free_percpu(mp->pool); in fc_exch_mgr_alloc()
2434 kref_put(&mp->kref, fc_exch_mgr_destroy); in fc_exch_mgr_alloc()
2435 return mp; in fc_exch_mgr_alloc()
2438 mempool_destroy(mp->ep_pool); in fc_exch_mgr_alloc()
2440 kfree(mp); in fc_exch_mgr_alloc()
2483 if ((xid >= ema->mp->min_xid) && in fc_find_ema()
2484 (xid <= ema->mp->max_xid)) in fc_find_ema()
2531 fc_exch_recv_bls(ema->mp, fp); in fc_exch_recv()
2534 fc_exch_recv_seq_resp(ema->mp, fp); in fc_exch_recv()
2536 fc_exch_recv_resp(ema->mp, fp); in fc_exch_recv()
2538 fc_exch_recv_req(lport, ema->mp, fp); in fc_exch_recv()