diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mlx4/device.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index e2e92885bdc1..f6f59271f857 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -641,12 +641,23 @@ struct mlx4_counter { | |||
| 641 | __be64 tx_bytes; | 641 | __be64 tx_bytes; |
| 642 | }; | 642 | }; |
| 643 | 643 | ||
| 644 | struct mlx4_quotas { | ||
| 645 | int qp; | ||
| 646 | int cq; | ||
| 647 | int srq; | ||
| 648 | int mpt; | ||
| 649 | int mtt; | ||
| 650 | int counter; | ||
| 651 | int xrcd; | ||
| 652 | }; | ||
| 653 | |||
| 644 | struct mlx4_dev { | 654 | struct mlx4_dev { |
| 645 | struct pci_dev *pdev; | 655 | struct pci_dev *pdev; |
| 646 | unsigned long flags; | 656 | unsigned long flags; |
| 647 | unsigned long num_slaves; | 657 | unsigned long num_slaves; |
| 648 | struct mlx4_caps caps; | 658 | struct mlx4_caps caps; |
| 649 | struct mlx4_phys_caps phys_caps; | 659 | struct mlx4_phys_caps phys_caps; |
| 660 | struct mlx4_quotas quotas; | ||
| 650 | struct radix_tree_root qp_table_tree; | 661 | struct radix_tree_root qp_table_tree; |
| 651 | u8 rev_id; | 662 | u8 rev_id; |
| 652 | char board_id[MLX4_BOARD_ID_LEN]; | 663 | char board_id[MLX4_BOARD_ID_LEN]; |
| @@ -772,6 +783,12 @@ static inline int mlx4_is_master(struct mlx4_dev *dev) | |||
| 772 | return dev->flags & MLX4_FLAG_MASTER; | 783 | return dev->flags & MLX4_FLAG_MASTER; |
| 773 | } | 784 | } |
| 774 | 785 | ||
| 786 | static inline int mlx4_num_reserved_sqps(struct mlx4_dev *dev) | ||
| 787 | { | ||
| 788 | return dev->phys_caps.base_sqpn + 8 + | ||
| 789 | 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev); | ||
| 790 | } | ||
| 791 | |||
| 775 | static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) | 792 | static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) |
| 776 | { | 793 | { |
| 777 | return (qpn < dev->phys_caps.base_sqpn + 8 + | 794 | return (qpn < dev->phys_caps.base_sqpn + 8 + |
