aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-11-04 16:20:33 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-04 16:20:33 -0500
commit5a6e55c461db3364aa5be919101db972bc859133 (patch)
treee43baf0db805f6f49f0c335fd5e868d7afc3946d /include/linux
parent3b4c5cbf42bda976ab70354e7786a0808265d9d5 (diff)
parent146f3ef4a193f2e8cc826bed01a635861287df63 (diff)
Merge branch 'mlx4'
Or Gerlitz says: ==================== Mellanox driver updates This patch set from Jack Morgenstein does the following: 1. Fix MAC/VLAN SRIOV implementation, and add wrapper functions for VLAN allocation and de-allocation (patches 1-6). 2. Implements resource quotas when running under SRIOV (patches 7-10). Patch 7 is a small bug fix, and patches 8-10 implement the quotas. Quotas are implemented per resource type for VFs and the PF, to prevent any entity from simply grabbing all the resources for itself and leaving the other entities unable to obtain such resources. The series is against net-next commit ba48650 "ipv6: remove the unnecessary statement in find_match()" changes from V0: - dropped the 1st patch which needs to go to -stable and hence through net, not net-next ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/device.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 9ad0c18495ad..f6f59271f857 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -54,6 +54,7 @@ enum {
54 MLX4_FLAG_MASTER = 1 << 2, 54 MLX4_FLAG_MASTER = 1 << 2,
55 MLX4_FLAG_SLAVE = 1 << 3, 55 MLX4_FLAG_SLAVE = 1 << 3,
56 MLX4_FLAG_SRIOV = 1 << 4, 56 MLX4_FLAG_SRIOV = 1 << 4,
57 MLX4_FLAG_OLD_REG_MAC = 1 << 6,
57}; 58};
58 59
59enum { 60enum {
@@ -640,12 +641,23 @@ struct mlx4_counter {
640 __be64 tx_bytes; 641 __be64 tx_bytes;
641}; 642};
642 643
644struct 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
643struct mlx4_dev { 654struct mlx4_dev {
644 struct pci_dev *pdev; 655 struct pci_dev *pdev;
645 unsigned long flags; 656 unsigned long flags;
646 unsigned long num_slaves; 657 unsigned long num_slaves;
647 struct mlx4_caps caps; 658 struct mlx4_caps caps;
648 struct mlx4_phys_caps phys_caps; 659 struct mlx4_phys_caps phys_caps;
660 struct mlx4_quotas quotas;
649 struct radix_tree_root qp_table_tree; 661 struct radix_tree_root qp_table_tree;
650 u8 rev_id; 662 u8 rev_id;
651 char board_id[MLX4_BOARD_ID_LEN]; 663 char board_id[MLX4_BOARD_ID_LEN];
@@ -771,6 +783,12 @@ static inline int mlx4_is_master(struct mlx4_dev *dev)
771 return dev->flags & MLX4_FLAG_MASTER; 783 return dev->flags & MLX4_FLAG_MASTER;
772} 784}
773 785
786static 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
774static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) 792static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn)
775{ 793{
776 return (qpn < dev->phys_caps.base_sqpn + 8 + 794 return (qpn < dev->phys_caps.base_sqpn + 8 +
@@ -1078,7 +1096,7 @@ int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
1078 u8 *pg, u16 *ratelimit); 1096 u8 *pg, u16 *ratelimit);
1079int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 1097int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
1080int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 1098int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
1081void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 1099void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan);
1082 1100
1083int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list, 1101int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list,
1084 int npages, u64 iova, u32 *lkey, u32 *rkey); 1102 int npages, u64 iova, u32 *lkey, u32 *rkey);