Lines Matching defs:mp

120  * @mp:	      Exchange Manager associated with this anchor
131 struct fc_exch_mgr *mp;
330 struct fc_exch_mgr *mp;
333 mp = ep->em;
337 mempool_free(ep, mp->ep_pool);
423 fc_exch_release(ep); /* drop hold for exch in mp */
707 * @mp: The exchange manager that will allocate the exchange
712 struct fc_exch_mgr *mp)
720 ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC);
722 atomic_inc(&mp->stats.no_free_exch);
728 pool = per_cpu_ptr(mp->pool, cpu);
747 index = index == mp->pool_max_index ? 0 : index + 1;
751 pool->next_index = index == mp->pool_max_index ? 0 : index + 1;
753 fc_exch_hold(ep); /* hold for exch in mp */
771 ep->oxid = ep->xid = (index << fc_cpu_order | cpu) + mp->min_xid;
772 ep->em = mp;
777 ep->class = mp->class;
783 atomic_inc(&mp->stats.no_free_exch_xid);
784 mempool_free(ep, mp->ep_pool);
806 return fc_exch_em_alloc(lport, ema->mp);
812 * @mp: The exchange manager to lookup the exchange from
815 static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid)
820 if ((xid >= mp->min_xid) && (xid <= mp->max_xid)) {
821 pool = per_cpu_ptr(mp->pool, xid & fc_cpu_mask);
823 ep = fc_exch_ptr_get(pool, (xid - mp->min_xid) >> fc_cpu_order);
852 * @mp: The exchange manager to allocate the exchange from
858 struct fc_exch_mgr *mp,
899 * @mp: The Exchange Manager to lookup the exchange from
906 struct fc_exch_mgr *mp,
924 ep = fc_exch_find(mp, xid);
926 atomic_inc(&mp->stats.xid_not_found);
953 ep = fc_exch_find(mp, xid);
956 atomic_inc(&mp->stats.xid_busy);
960 ep = fc_exch_resp(lport, mp, fp);
967 atomic_inc(&mp->stats.xid_not_found);
984 atomic_inc(&mp->stats.seq_not_found);
1028 * @mp: The Exchange Manager to lookup the exchange from
1033 static struct fc_seq *fc_seq_lookup_orig(struct fc_exch_mgr *mp,
1045 ep = fc_exch_find(mp, xid);
1334 fc_seq_lookup_recip(lport, ema->mp, fp) == FC_RJT_NONE)
1351 * @mp: The EM that the exchange is on
1357 static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp,
1384 reject = fc_seq_lookup_recip(lport, mp, fp);
1418 * @mp: The EM that the exchange is on
1421 static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
1432 ep = fc_exch_find(mp, ntohs(fh->fh_ox_id));
1434 atomic_inc(&mp->stats.xid_not_found);
1438 atomic_inc(&mp->stats.xid_not_found);
1444 atomic_inc(&mp->stats.xid_not_found);
1449 atomic_inc(&mp->stats.xid_not_found);
1458 atomic_inc(&mp->stats.seq_not_found);
1512 * @mp: The EM that the exchange is on
1515 static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
1519 sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */
1522 atomic_inc(&mp->stats.xid_not_found);
1524 atomic_inc(&mp->stats.non_bls_resp);
1612 * @mp: The EM that the exchange is on
1618 static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp)
1628 ep = fc_exch_find(mp, (f_ctl & FC_FC_EX_CTX) ?
1823 per_cpu_ptr(ema->mp->pool, cpu),
1841 if (ema->mp->min_xid <= xid && xid <= ema->mp->max_xid)
1842 return fc_exch_find(ema->mp, xid);
2161 * @mp: The exchange manager to be added to the local port
2165 struct fc_exch_mgr *mp,
2174 ema->mp = mp;
2178 kref_get(&mp->kref);
2189 struct fc_exch_mgr *mp = container_of(kref, struct fc_exch_mgr, kref);
2191 mempool_destroy(mp->ep_pool);
2192 free_percpu(mp->pool);
2193 kfree(mp);
2204 kref_put(&ema->mp->kref, fc_exch_mgr_destroy);
2219 if (!fc_exch_mgr_add(dst, ema->mp, ema->match))
2243 struct fc_exch_mgr *mp;
2259 mp = kzalloc(sizeof(struct fc_exch_mgr), GFP_ATOMIC);
2260 if (!mp)
2263 mp->class = class;
2265 mp->min_xid = min_xid;
2271 mp->max_xid = pool_exch_range * (fc_cpu_mask + 1) +
2274 mp->max_xid = max_xid;
2275 pool_exch_range = (mp->max_xid - mp->min_xid + 1) /
2279 mp->ep_pool = mempool_create_slab_pool(2, fc_em_cachep);
2280 if (!mp->ep_pool)
2288 mp->pool_max_index = pool_exch_range - 1;
2294 mp->pool = __alloc_percpu(pool_size, __alignof__(struct fc_exch_pool));
2295 if (!mp->pool)
2298 pool = per_cpu_ptr(mp->pool, cpu);
2306 kref_init(&mp->kref);
2307 if (!fc_exch_mgr_add(lport, mp, match)) {
2308 free_percpu(mp->pool);
2313 * Above kref_init() sets mp->kref to 1 and then
2314 * call to fc_exch_mgr_add incremented mp->kref again,
2317 kref_put(&mp->kref, fc_exch_mgr_destroy);
2318 return mp;
2321 mempool_destroy(mp->ep_pool);
2323 kfree(mp);
2366 if ((xid >= ema->mp->min_xid) &&
2367 (xid <= ema->mp->max_xid))
2414 fc_exch_recv_bls(ema->mp, fp);
2417 fc_exch_recv_seq_resp(ema->mp, fp);
2419 fc_exch_recv_resp(ema->mp, fp);
2421 fc_exch_recv_req(lport, ema->mp, fp);