• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/mlx4/mlx4_core/

Lines Matching defs:res_alloc

310 	struct resource_allocator *res_alloc =
311 &priv->mfunc.master.res_tracker.res_alloc[res_type];
319 spin_lock(&res_alloc->alloc_lock);
321 res_alloc->allocated[(port - 1) *
323 res_alloc->allocated[slave];
324 free = (port > 0) ? res_alloc->res_port_free[port - 1] :
325 res_alloc->res_free;
326 reserved = (port > 0) ? res_alloc->res_port_rsvd[port - 1] :
327 res_alloc->res_reserved;
328 guaranteed = res_alloc->guaranteed[slave];
330 if (allocated + count > res_alloc->quota[slave]) {
333 allocated, res_alloc->quota[slave]);
360 res_alloc->allocated[(port - 1) *
362 res_alloc->res_port_free[port - 1] -= count;
363 res_alloc->res_port_rsvd[port - 1] -= from_rsvd;
365 res_alloc->allocated[slave] += count;
366 res_alloc->res_free -= count;
367 res_alloc->res_reserved -= from_rsvd;
372 spin_unlock(&res_alloc->alloc_lock);
381 struct resource_allocator *res_alloc =
382 &priv->mfunc.master.res_tracker.res_alloc[res_type];
388 spin_lock(&res_alloc->alloc_lock);
391 res_alloc->allocated[(port - 1) *
393 res_alloc->allocated[slave];
394 guaranteed = res_alloc->guaranteed[slave];
407 res_alloc->allocated[(port - 1) *
409 res_alloc->res_port_free[port - 1] += count;
410 res_alloc->res_port_rsvd[port - 1] += from_rsvd;
412 res_alloc->allocated[slave] -= count;
413 res_alloc->res_free += count;
414 res_alloc->res_reserved += from_rsvd;
417 spin_unlock(&res_alloc->alloc_lock);
422 struct resource_allocator *res_alloc,
426 res_alloc->guaranteed[vf] = num_instances /
428 res_alloc->quota[vf] = (num_instances / 2) + res_alloc->guaranteed[vf];
430 res_alloc->res_free = num_instances;
433 res_alloc->res_free += dev->caps.reserved_mtts;
434 res_alloc->guaranteed[vf] += dev->caps.reserved_mtts;
435 res_alloc->quota[vf] += dev->caps.reserved_mtts;
461 priv->mfunc.master.res_tracker.res_alloc[RES_QP].quota[pf];
463 priv->mfunc.master.res_tracker.res_alloc[RES_CQ].quota[pf];
465 priv->mfunc.master.res_tracker.res_alloc[RES_SRQ].quota[pf];
467 priv->mfunc.master.res_tracker.res_alloc[RES_MTT].quota[pf];
469 priv->mfunc.master.res_tracker.res_alloc[RES_MPT].quota[pf];
506 struct resource_allocator *res_alloc =
507 &priv->mfunc.master.res_tracker.res_alloc[i];
508 res_alloc->quota = kmalloc((dev->persist->num_vfs + 1) *
510 res_alloc->guaranteed = kmalloc((dev->persist->num_vfs + 1) *
513 res_alloc->allocated = kzalloc(MLX4_MAX_PORTS *
518 res_alloc->allocated = kzalloc((dev->persist->
523 res_alloc->res_free = dev->caps.max_counters - 1;
525 if (!res_alloc->quota || !res_alloc->guaranteed ||
526 !res_alloc->allocated)
529 spin_lock_init(&res_alloc->alloc_lock);
535 initialize_res_quotas(dev, res_alloc, RES_QP,
541 initialize_res_quotas(dev, res_alloc, RES_CQ,
546 initialize_res_quotas(dev, res_alloc, RES_SRQ,
551 initialize_res_quotas(dev, res_alloc, RES_MPT,
556 initialize_res_quotas(dev, res_alloc, RES_MTT,
576 res_alloc->quota[t] =
579 res_alloc->guaranteed[t] = 2;
581 res_alloc->res_port_free[j] =
584 res_alloc->quota[t] = MLX4_MAX_MAC_NUM;
585 res_alloc->guaranteed[t] = 2;
590 res_alloc->quota[t] = MLX4_MAX_VLAN_NUM;
591 res_alloc->guaranteed[t] = MLX4_MAX_VLAN_NUM / 2;
593 res_alloc->res_port_free[j] =
594 res_alloc->quota[t];
596 res_alloc->quota[t] = MLX4_MAX_VLAN_NUM / 2;
597 res_alloc->guaranteed[t] = 0;
601 res_alloc->quota[t] = dev->caps.max_counters;
603 res_alloc->guaranteed[t] =
607 res_alloc->guaranteed[t] =
611 res_alloc->guaranteed[t] = 0;
612 res_alloc->res_free -= res_alloc->guaranteed[t];
620 res_alloc->res_port_rsvd[j] +=
621 res_alloc->guaranteed[t];
623 res_alloc->res_reserved += res_alloc->guaranteed[t];
632 kfree(priv->mfunc.master.res_tracker.res_alloc[i].allocated);
633 priv->mfunc.master.res_tracker.res_alloc[i].allocated = NULL;
634 kfree(priv->mfunc.master.res_tracker.res_alloc[i].guaranteed);
635 priv->mfunc.master.res_tracker.res_alloc[i].guaranteed = NULL;
636 kfree(priv->mfunc.master.res_tracker.res_alloc[i].quota);
637 priv->mfunc.master.res_tracker.res_alloc[i].quota = NULL;
665 kfree(priv->mfunc.master.res_tracker.res_alloc[i].allocated);
666 priv->mfunc.master.res_tracker.res_alloc[i].allocated = NULL;
667 kfree(priv->mfunc.master.res_tracker.res_alloc[i].guaranteed);
668 priv->mfunc.master.res_tracker.res_alloc[i].guaranteed = NULL;
669 kfree(priv->mfunc.master.res_tracker.res_alloc[i].quota);
670 priv->mfunc.master.res_tracker.res_alloc[i].quota = NULL;