X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=include%2Flinux%2Fmlx4%2Fdevice.h;h=9803fd5d3dbaaf7a0d6cb40739dd4f8b010678b4;hb=54679e148287f0ca1bdd09264c908bacb9f19b3f;hp=6e1b0f973a03511b398154a5d42f3a9174b9268a;hpb=5b799dde3159284fdee8d60f535e2753a86dbb3f;p=cascardo%2Flinux.git diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 6e1b0f973a03..9803fd5d3dba 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -54,7 +54,8 @@ enum { }; enum { - MLX4_MAX_PORTS = 2 + MLX4_MAX_PORTS = 2, + MLX4_MAX_PORT_PKEYS = 128 }; /* base qkey for use in sriov tunnel-qp/proxy-qp communication. @@ -389,6 +390,7 @@ struct mlx4_caps { enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; u32 max_counters; u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; + u16 sqp_demux; }; struct mlx4_buf_list { @@ -692,7 +694,18 @@ static inline int mlx4_is_master(struct mlx4_dev *dev) static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) { - return (qpn < dev->caps.sqp_start + 8); + return (qpn < dev->caps.base_sqpn + 8 + + 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev)); +} + +static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn) +{ + int base = dev->caps.sqp_start + slave * 8; + + if (qpn >= base && qpn < base + 8) + return 1; + + return 0; } static inline int mlx4_is_mfunc(struct mlx4_dev *dev) @@ -927,6 +940,9 @@ int mlx4_flow_attach(struct mlx4_dev *dev, struct mlx4_net_trans_rule *rule, u64 *reg_id); int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); +void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port, + int i, int val); + int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); #endif /* MLX4_DEVICE_H */