Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband updates from Roland Dreier: "First batch of InfiniBand/RDMA changes for the 3.7 merge window: - mlx4 IB support for SR-IOV - A couple of SRP initiator fixes - Batch of nes hardware driver fixes - Fix for long-standing use-after-free crash in IPoIB - Other miscellaneous fixes" This merge also removes a new use of __cancel_delayed_work(), and replaces it with the regular cancel_delayed_work() that is now irq-safe thanks to the workqueue updates. That said, I suspect the sequence in question should probably use "mod_delayed_work()". I just did the minimal "don't use deprecated functions" fixup, though. * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (45 commits) IB/qib: Fix local access validation for user MRs mlx4_core: Disable SENSE_PORT for multifunction devices mlx4_core: Clean up enabling of SENSE_PORT for older (ConnectX-1/-2) HCAs mlx4_core: Stash PCI ID driver_data in mlx4_priv structure IB/srp: Avoid having aborted requests hang IB/srp: Fix use-after-free in srp_reset_req() IB/qib: Add a qib driver version RDMA/nes: Fix compilation error when nes_debug is enabled RDMA/nes: Print hardware resource type RDMA/nes: Fix for crash when TX checksum offload is off RDMA/nes: Cosmetic changes RDMA/nes: Fix for incorrect MSS when TSO is on RDMA/nes: Fix incorrect resolving of the loopback MAC address mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem mlx4_core: Trivial cleanups to driver log messages mlx4_core: Trivial readability fix: "0X30" -> "0x30" IB/mlx4: Create paravirt contexts for VFs when master IB driver initializes mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations mlx4: Paravirtualize Node Guids for slaves mlx4: Activate SR-IOV mode for IB ...
This commit is contained in:
@@ -54,7 +54,13 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_MAX_PORTS = 2
|
||||
MLX4_PORT_CAP_IS_SM = 1 << 1,
|
||||
MLX4_PORT_CAP_DEV_MGMT_SUP = 1 << 19,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_MAX_PORTS = 2,
|
||||
MLX4_MAX_PORT_PKEYS = 128
|
||||
};
|
||||
|
||||
/* base qkey for use in sriov tunnel-qp/proxy-qp communication.
|
||||
@@ -191,6 +197,25 @@ enum {
|
||||
MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0,
|
||||
};
|
||||
|
||||
enum slave_port_state {
|
||||
SLAVE_PORT_DOWN = 0,
|
||||
SLAVE_PENDING_UP,
|
||||
SLAVE_PORT_UP,
|
||||
};
|
||||
|
||||
enum slave_port_gen_event {
|
||||
SLAVE_PORT_GEN_EVENT_DOWN = 0,
|
||||
SLAVE_PORT_GEN_EVENT_UP,
|
||||
SLAVE_PORT_GEN_EVENT_NONE,
|
||||
};
|
||||
|
||||
enum slave_port_state_event {
|
||||
MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN,
|
||||
MLX4_PORT_STATE_DEV_EVENT_PORT_UP,
|
||||
MLX4_PORT_STATE_IB_PORT_STATE_EVENT_GID_VALID,
|
||||
MLX4_PORT_STATE_IB_EVENT_GID_INVALID,
|
||||
};
|
||||
|
||||
enum {
|
||||
MLX4_PERM_LOCAL_READ = 1 << 10,
|
||||
MLX4_PERM_LOCAL_WRITE = 1 << 11,
|
||||
@@ -303,6 +328,9 @@ struct mlx4_phys_caps {
|
||||
u32 gid_phys_table_len[MLX4_MAX_PORTS + 1];
|
||||
u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1];
|
||||
u32 num_phys_eqs;
|
||||
u32 base_sqpn;
|
||||
u32 base_proxy_sqpn;
|
||||
u32 base_tunnel_sqpn;
|
||||
};
|
||||
|
||||
struct mlx4_caps {
|
||||
@@ -333,9 +361,10 @@ struct mlx4_caps {
|
||||
int max_rq_desc_sz;
|
||||
int max_qp_init_rdma;
|
||||
int max_qp_dest_rdma;
|
||||
int sqp_start;
|
||||
u32 base_sqpn;
|
||||
u32 base_tunnel_sqpn;
|
||||
u32 *qp0_proxy;
|
||||
u32 *qp1_proxy;
|
||||
u32 *qp0_tunnel;
|
||||
u32 *qp1_tunnel;
|
||||
int num_srqs;
|
||||
int max_srq_wqes;
|
||||
int max_srq_sge;
|
||||
@@ -389,6 +418,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 {
|
||||
@@ -671,6 +701,10 @@ struct mlx4_init_port_param {
|
||||
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
|
||||
if ((type) == (dev)->caps.port_mask[(port)])
|
||||
|
||||
#define mlx4_foreach_non_ib_transport_port(port, dev) \
|
||||
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
|
||||
if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB))
|
||||
|
||||
#define mlx4_foreach_ib_transport_port(port, dev) \
|
||||
for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
|
||||
if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
|
||||
@@ -692,7 +726,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->phys_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 guest_proxy_base = dev->phys_caps.base_proxy_sqpn + slave * 8;
|
||||
|
||||
if (qpn >= guest_proxy_base && qpn < guest_proxy_base + 8)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int mlx4_is_mfunc(struct mlx4_dev *dev)
|
||||
@@ -927,6 +972,20 @@ 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);
|
||||
|
||||
int mlx4_is_slave_active(struct mlx4_dev *dev, int slave);
|
||||
int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port);
|
||||
int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port);
|
||||
int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr);
|
||||
int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change);
|
||||
enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, u8 port);
|
||||
int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int event, enum slave_port_gen_event *gen_event);
|
||||
|
||||
void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid);
|
||||
__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave);
|
||||
|
||||
#endif /* MLX4_DEVICE_H */
|
||||
|
||||
@@ -45,6 +45,8 @@ enum mlx4_dev_event {
|
||||
MLX4_DEV_EVENT_PORT_DOWN,
|
||||
MLX4_DEV_EVENT_PORT_REINIT,
|
||||
MLX4_DEV_EVENT_PORT_MGMT_CHANGE,
|
||||
MLX4_DEV_EVENT_SLAVE_INIT,
|
||||
MLX4_DEV_EVENT_SLAVE_SHUTDOWN,
|
||||
};
|
||||
|
||||
struct mlx4_interface {
|
||||
|
||||
@@ -126,7 +126,8 @@ struct mlx4_rss_context {
|
||||
|
||||
struct mlx4_qp_path {
|
||||
u8 fl;
|
||||
u8 reserved1[2];
|
||||
u8 reserved1[1];
|
||||
u8 disable_pkey_check;
|
||||
u8 pkey_index;
|
||||
u8 counter_index;
|
||||
u8 grh_mylmc;
|
||||
|
||||
Reference in New Issue
Block a user