diff options
Diffstat (limited to 'include/linux/mlx5/driver.h')
| -rw-r--r-- | include/linux/mlx5/driver.h | 71 | 
1 files changed, 34 insertions, 37 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 7a452716de4b..31460eeb6fe0 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -133,6 +133,7 @@ enum {  	MLX5_REG_PVLC		 = 0x500f,  	MLX5_REG_PCMR		 = 0x5041,  	MLX5_REG_PMLP		 = 0x5002, +	MLX5_REG_PPLM		 = 0x5023,  	MLX5_REG_PCAM		 = 0x507f,  	MLX5_REG_NODE_DESC	 = 0x6001,  	MLX5_REG_HOST_ENDIANNESS = 0x7004, @@ -163,10 +164,7 @@ enum mlx5_dcbx_oper_mode {  };  enum mlx5_dct_atomic_mode { -	MLX5_ATOMIC_MODE_DCT_OFF        = 20, -	MLX5_ATOMIC_MODE_DCT_NONE       = 0 << MLX5_ATOMIC_MODE_DCT_OFF, -	MLX5_ATOMIC_MODE_DCT_IB_COMP    = 1 << MLX5_ATOMIC_MODE_DCT_OFF, -	MLX5_ATOMIC_MODE_DCT_CX         = 2 << MLX5_ATOMIC_MODE_DCT_OFF, +	MLX5_ATOMIC_MODE_DCT_CX         = 2,  };  enum { @@ -360,10 +358,10 @@ struct mlx5_frag_buf {  };  struct mlx5_frag_buf_ctrl { -	struct mlx5_frag_buf	frag_buf; +	struct mlx5_buf_list   *frags;  	u32			sz_m1; -	u32			frag_sz_m1; -	u32			strides_offset; +	u16			frag_sz_m1; +	u16			strides_offset;  	u8			log_sz;  	u8			log_stride;  	u8			log_frag_strides; @@ -477,6 +475,7 @@ struct mlx5_core_srq {  	atomic_t		refcount;  	struct completion	free; +	u16		uid;  };  struct mlx5_eq_table { @@ -583,10 +582,11 @@ struct mlx5_irq_info {  };  struct mlx5_fc_stats { -	struct rb_root counters; -	struct list_head addlist; -	/* protect addlist add/splice operations */ -	spinlock_t addlist_lock; +	spinlock_t counters_idr_lock; /* protects counters_idr */ +	struct idr counters_idr; +	struct list_head counters; +	struct llist_head addlist; +	struct llist_head dellist;  	struct workqueue_struct *wq;  	struct delayed_work work; @@ -804,7 +804,7 @@ struct mlx5_pps {  };  struct mlx5_clock { -	rwlock_t                   lock; +	seqlock_t                  lock;  	struct cyclecounter        cycles;  	struct timecounter         tc;  	struct hwtstamp_config     hwtstamp_config; @@ -837,6 +837,7 @@ struct mlx5_core_dev {  		u32 fpga[MLX5_ST_SZ_DW(fpga_cap)];  		u32 qcam[MLX5_ST_SZ_DW(qcam_reg)];  	} caps; +	u64			sys_image_guid;  	phys_addr_t		iseg_base;  	struct mlx5_init_seg __iomem *iseg;  	enum mlx5_device_state	state; @@ -994,10 +995,12 @@ static inline u32 mlx5_base_mkey(const u32 key)  	return key & 0xffffff00u;  } -static inline void mlx5_fill_fbc_offset(u8 log_stride, u8 log_sz, -					u32 strides_offset, +static inline void mlx5_init_fbc_offset(struct mlx5_buf_list *frags, +					u8 log_stride, u8 log_sz, +					u16 strides_offset,  					struct mlx5_frag_buf_ctrl *fbc)  { +	fbc->frags      = frags;  	fbc->log_stride = log_stride;  	fbc->log_sz     = log_sz;  	fbc->sz_m1	= (1 << fbc->log_sz) - 1; @@ -1006,18 +1009,11 @@ static inline void mlx5_fill_fbc_offset(u8 log_stride, u8 log_sz,  	fbc->strides_offset = strides_offset;  } -static inline void mlx5_fill_fbc(u8 log_stride, u8 log_sz, +static inline void mlx5_init_fbc(struct mlx5_buf_list *frags, +				 u8 log_stride, u8 log_sz,  				 struct mlx5_frag_buf_ctrl *fbc)  { -	mlx5_fill_fbc_offset(log_stride, log_sz, 0, fbc); -} - -static inline void mlx5_core_init_cq_frag_buf(struct mlx5_frag_buf_ctrl *fbc, -					      void *cqc) -{ -	mlx5_fill_fbc(6 + MLX5_GET(cqc, cqc, cqe_sz), -		      MLX5_GET(cqc, cqc, log_cq_size), -		      fbc); +	mlx5_init_fbc_offset(frags, log_stride, log_sz, 0, fbc);  }  static inline void *mlx5_frag_buf_get_wqe(struct mlx5_frag_buf_ctrl *fbc, @@ -1028,8 +1024,15 @@ static inline void *mlx5_frag_buf_get_wqe(struct mlx5_frag_buf_ctrl *fbc,  	ix  += fbc->strides_offset;  	frag = ix >> fbc->log_frag_strides; -	return fbc->frag_buf.frags[frag].buf + -		((fbc->frag_sz_m1 & ix) << fbc->log_stride); +	return fbc->frags[frag].buf + ((fbc->frag_sz_m1 & ix) << fbc->log_stride); +} + +static inline u32 +mlx5_frag_buf_get_idx_last_contig_stride(struct mlx5_frag_buf_ctrl *fbc, u32 ix) +{ +	u32 last_frag_stride_idx = (ix + fbc->strides_offset) | fbc->frag_sz_m1; + +	return min_t(u32, last_frag_stride_idx - fbc->strides_offset, fbc->sz_m1);  }  int mlx5_cmd_init(struct mlx5_core_dev *dev); @@ -1052,7 +1055,7 @@ int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn);  void mlx5_health_cleanup(struct mlx5_core_dev *dev);  int mlx5_health_init(struct mlx5_core_dev *dev);  void mlx5_start_health_poll(struct mlx5_core_dev *dev); -void mlx5_stop_health_poll(struct mlx5_core_dev *dev); +void mlx5_stop_health_poll(struct mlx5_core_dev *dev, bool disable_health);  void mlx5_drain_health_wq(struct mlx5_core_dev *dev);  void mlx5_trigger_health_work(struct mlx5_core_dev *dev);  void mlx5_drain_health_recovery(struct mlx5_core_dev *dev); @@ -1226,21 +1229,15 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev,  struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);  void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up); -#ifndef CONFIG_MLX5_CORE_IPOIB -static inline -struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev, -					  struct ib_device *ibdev, -					  const char *name, -					  void (*setup)(struct net_device *)) -{ -	return ERR_PTR(-EOPNOTSUPP); -} -#else +#ifdef CONFIG_MLX5_CORE_IPOIB  struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,  					  struct ib_device *ibdev,  					  const char *name,  					  void (*setup)(struct net_device *));  #endif /* CONFIG_MLX5_CORE_IPOIB */ +int mlx5_rdma_rn_get_params(struct mlx5_core_dev *mdev, +			    struct ib_device *device, +			    struct rdma_netdev_alloc_params *params);  struct mlx5_profile {  	u64	mask;  | 
