diff options
Diffstat (limited to 'include/linux/mlx5')
| -rw-r--r-- | include/linux/mlx5/cq.h | 12 | ||||
| -rw-r--r-- | include/linux/mlx5/device.h | 24 | ||||
| -rw-r--r-- | include/linux/mlx5/driver.h | 258 | ||||
| -rw-r--r-- | include/linux/mlx5/eq.h | 72 | ||||
| -rw-r--r-- | include/linux/mlx5/fs.h | 8 | ||||
| -rw-r--r-- | include/linux/mlx5/mlx5_ifc.h | 233 | ||||
| -rw-r--r-- | include/linux/mlx5/port.h | 3 | ||||
| -rw-r--r-- | include/linux/mlx5/qp.h | 5 | ||||
| -rw-r--r-- | include/linux/mlx5/srq.h | 72 | ||||
| -rw-r--r-- | include/linux/mlx5/transobj.h | 11 | 
10 files changed, 339 insertions, 359 deletions
| diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h index 31a750570c38..612c8c2f2466 100644 --- a/include/linux/mlx5/cq.h +++ b/include/linux/mlx5/cq.h @@ -60,7 +60,7 @@ struct mlx5_core_cq {  	} tasklet_ctx;  	int			reset_notify_added;  	struct list_head	reset_notify; -	struct mlx5_eq		*eq; +	struct mlx5_eq_comp	*eq;  	u16 uid;  }; @@ -125,9 +125,9 @@ struct mlx5_cq_modify_params {  };  enum { -	CQE_SIZE_64 = 0, -	CQE_SIZE_128 = 1, -	CQE_SIZE_128_PAD = 2, +	CQE_STRIDE_64 = 0, +	CQE_STRIDE_128 = 1, +	CQE_STRIDE_128_PAD = 2,  };  #define MLX5_MAX_CQ_PERIOD (BIT(__mlx5_bit_sz(cqc, cq_period)) - 1) @@ -135,8 +135,8 @@ enum {  static inline int cqe_sz_to_mlx_sz(u8 size, int padding_128_en)  { -	return padding_128_en ? CQE_SIZE_128_PAD : -				size == 64 ? CQE_SIZE_64 : CQE_SIZE_128; +	return padding_128_en ? CQE_STRIDE_128_PAD : +				size == 64 ? CQE_STRIDE_64 : CQE_STRIDE_128;  }  static inline void mlx5_cq_set_ci(struct mlx5_core_cq *cq) diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index b4c0457fbebd..8c4a820bd4c1 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -212,6 +212,13 @@ enum {  	MLX5_PFAULT_SUBTYPE_RDMA = 1,  }; +enum wqe_page_fault_type { +	MLX5_WQE_PF_TYPE_RMP = 0, +	MLX5_WQE_PF_TYPE_REQ_SEND_OR_WRITE = 1, +	MLX5_WQE_PF_TYPE_RESP = 2, +	MLX5_WQE_PF_TYPE_REQ_READ_OR_ATOMIC = 3, +}; +  enum {  	MLX5_PERM_LOCAL_READ	= 1 << 2,  	MLX5_PERM_LOCAL_WRITE	= 1 << 3, @@ -294,9 +301,15 @@ enum {  	MLX5_EVENT_QUEUE_TYPE_DCT = 6,  }; +/* mlx5 components can subscribe to any one of these events via + * mlx5_eq_notifier_register API. + */  enum mlx5_event { +	/* Special value to subscribe to any event */ +	MLX5_EVENT_TYPE_NOTIFY_ANY	   = 0x0, +	/* HW events enum start: comp events are not subscribable */  	MLX5_EVENT_TYPE_COMP		   = 0x0, - +	/* HW Async events enum start: subscribable events */  	MLX5_EVENT_TYPE_PATH_MIG	   = 0x01,  	MLX5_EVENT_TYPE_COMM_EST	   = 0x02,  	MLX5_EVENT_TYPE_SQ_DRAINED	   = 0x03, @@ -317,6 +330,7 @@ enum mlx5_event {  	MLX5_EVENT_TYPE_TEMP_WARN_EVENT    = 0x17,  	MLX5_EVENT_TYPE_REMOTE_CONFIG	   = 0x19,  	MLX5_EVENT_TYPE_GENERAL_EVENT	   = 0x22, +	MLX5_EVENT_TYPE_MONITOR_COUNTER    = 0x24,  	MLX5_EVENT_TYPE_PPS_EVENT          = 0x25,  	MLX5_EVENT_TYPE_DB_BF_CONGESTION   = 0x1a, @@ -334,6 +348,8 @@ enum mlx5_event {  	MLX5_EVENT_TYPE_FPGA_QP_ERROR      = 0x21,  	MLX5_EVENT_TYPE_DEVICE_TRACER      = 0x26, + +	MLX5_EVENT_TYPE_MAX                = MLX5_EVENT_TYPE_DEVICE_TRACER + 1,  };  enum { @@ -405,6 +421,7 @@ enum {  	MLX5_OPCODE_ATOMIC_MASKED_FA	= 0x15,  	MLX5_OPCODE_BIND_MW		= 0x18,  	MLX5_OPCODE_CONFIG_CMD		= 0x1f, +	MLX5_OPCODE_ENHANCED_MPSW	= 0x29,  	MLX5_RECV_OPCODE_RDMA_WRITE_IMM	= 0x00,  	MLX5_RECV_OPCODE_SEND		= 0x01, @@ -766,6 +783,11 @@ static inline u8 mlx5_get_cqe_format(struct mlx5_cqe64 *cqe)  	return (cqe->op_own >> 2) & 0x3;  } +static inline u8 get_cqe_opcode(struct mlx5_cqe64 *cqe) +{ +	return cqe->op_own >> 4; +} +  static inline u8 get_cqe_lro_tcppsh(struct mlx5_cqe64 *cqe)  {  	return (cqe->lro_tcppsh_abort_dupack >> 6) & 1; diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index aa5963b5d38e..54299251d40d 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -46,10 +46,11 @@  #include <linux/mempool.h>  #include <linux/interrupt.h>  #include <linux/idr.h> +#include <linux/notifier.h>  #include <linux/mlx5/device.h>  #include <linux/mlx5/doorbell.h> -#include <linux/mlx5/srq.h> +#include <linux/mlx5/eq.h>  #include <linux/timecounter.h>  #include <linux/ptp_clock_kernel.h> @@ -85,18 +86,6 @@ enum {  };  enum { -	MLX5_EQ_VEC_PAGES	 = 0, -	MLX5_EQ_VEC_CMD		 = 1, -	MLX5_EQ_VEC_ASYNC	 = 2, -	MLX5_EQ_VEC_PFAULT	 = 3, -	MLX5_EQ_VEC_COMP_BASE, -}; - -enum { -	MLX5_MAX_IRQ_NAME	= 32 -}; - -enum {  	MLX5_ATOMIC_MODE_OFFSET = 16,  	MLX5_ATOMIC_MODE_IB_COMP = 1,  	MLX5_ATOMIC_MODE_CX = 2, @@ -205,16 +194,7 @@ struct mlx5_rsc_debug {  };  enum mlx5_dev_event { -	MLX5_DEV_EVENT_SYS_ERROR, -	MLX5_DEV_EVENT_PORT_UP, -	MLX5_DEV_EVENT_PORT_DOWN, -	MLX5_DEV_EVENT_PORT_INITIALIZED, -	MLX5_DEV_EVENT_LID_CHANGE, -	MLX5_DEV_EVENT_PKEY_CHANGE, -	MLX5_DEV_EVENT_GUID_CHANGE, -	MLX5_DEV_EVENT_CLIENT_REREG, -	MLX5_DEV_EVENT_PPS, -	MLX5_DEV_EVENT_DELAY_DROP_TIMEOUT, +	MLX5_DEV_EVENT_SYS_ERROR = 128, /* 0 - 127 are FW events */  };  enum mlx5_port_status { @@ -222,14 +202,6 @@ enum mlx5_port_status {  	MLX5_PORT_DOWN      = 2,  }; -enum mlx5_eq_type { -	MLX5_EQ_TYPE_COMP, -	MLX5_EQ_TYPE_ASYNC, -#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING -	MLX5_EQ_TYPE_PF, -#endif -}; -  struct mlx5_bfreg_info {  	u32		       *sys_pages;  	int			num_low_latency_bfregs; @@ -297,6 +269,8 @@ struct mlx5_cmd_stats {  };  struct mlx5_cmd { +	struct mlx5_nb    nb; +  	void	       *cmd_alloc_buf;  	dma_addr_t	alloc_dma;  	int		alloc_size; @@ -366,51 +340,6 @@ struct mlx5_frag_buf_ctrl {  	u8			log_frag_strides;  }; -struct mlx5_eq_tasklet { -	struct list_head list; -	struct list_head process_list; -	struct tasklet_struct task; -	/* lock on completion tasklet list */ -	spinlock_t lock; -}; - -struct mlx5_eq_pagefault { -	struct work_struct       work; -	/* Pagefaults lock */ -	spinlock_t		 lock; -	struct workqueue_struct *wq; -	mempool_t		*pool; -}; - -struct mlx5_cq_table { -	/* protect radix tree */ -	spinlock_t		lock; -	struct radix_tree_root	tree; -}; - -struct mlx5_eq { -	struct mlx5_core_dev   *dev; -	struct mlx5_cq_table	cq_table; -	__be32 __iomem	       *doorbell; -	u32			cons_index; -	struct mlx5_frag_buf	buf; -	int			size; -	unsigned int		irqn; -	u8			eqn; -	int			nent; -	u64			mask; -	struct list_head	list; -	int			index; -	struct mlx5_rsc_debug	*dbg; -	enum mlx5_eq_type	type; -	union { -		struct mlx5_eq_tasklet   tasklet_ctx; -#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING -		struct mlx5_eq_pagefault pf_ctx; -#endif -	}; -}; -  struct mlx5_core_psv {  	u32	psv_idx;  	struct psv_layout { @@ -463,36 +392,6 @@ struct mlx5_core_rsc_common {  	struct completion	free;  }; -struct mlx5_core_srq { -	struct mlx5_core_rsc_common	common; /* must be first */ -	u32		srqn; -	int		max; -	size_t		max_gs; -	size_t		max_avail_gather; -	int		wqe_shift; -	void (*event)	(struct mlx5_core_srq *, enum mlx5_event); - -	atomic_t		refcount; -	struct completion	free; -	u16		uid; -}; - -struct mlx5_eq_table { -	void __iomem	       *update_ci; -	void __iomem	       *update_arm_ci; -	struct list_head	comp_eqs_list; -	struct mlx5_eq		pages_eq; -	struct mlx5_eq		async_eq; -	struct mlx5_eq		cmd_eq; -#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING -	struct mlx5_eq		pfault_eq; -#endif -	int			num_comp_vectors; -	/* protect EQs list -	 */ -	spinlock_t		lock; -}; -  struct mlx5_uars_page {  	void __iomem	       *map;  	bool			wc; @@ -542,13 +441,8 @@ struct mlx5_core_health {  };  struct mlx5_qp_table { -	/* protect radix tree -	 */ -	spinlock_t		lock; -	struct radix_tree_root	tree; -}; +	struct notifier_block   nb; -struct mlx5_srq_table {  	/* protect radix tree  	 */  	spinlock_t		lock; @@ -575,11 +469,6 @@ struct mlx5_core_sriov {  	int			enabled_vfs;  }; -struct mlx5_irq_info { -	cpumask_var_t mask; -	char name[MLX5_MAX_IRQ_NAME]; -}; -  struct mlx5_fc_stats {  	spinlock_t counters_idr_lock; /* protects counters_idr */  	struct idr counters_idr; @@ -593,10 +482,12 @@ struct mlx5_fc_stats {  	unsigned long sampling_interval; /* jiffies */  }; +struct mlx5_events;  struct mlx5_mpfs;  struct mlx5_eswitch;  struct mlx5_lag; -struct mlx5_pagefault; +struct mlx5_devcom; +struct mlx5_eq_table;  struct mlx5_rate_limit {  	u32			rate; @@ -619,37 +510,12 @@ struct mlx5_rl_table {  	struct mlx5_rl_entry   *rl_entry;  }; -enum port_module_event_status_type { -	MLX5_MODULE_STATUS_PLUGGED   = 0x1, -	MLX5_MODULE_STATUS_UNPLUGGED = 0x2, -	MLX5_MODULE_STATUS_ERROR     = 0x3, -	MLX5_MODULE_STATUS_NUM       = 0x3, -}; - -enum  port_module_event_error_type { -	MLX5_MODULE_EVENT_ERROR_POWER_BUDGET_EXCEEDED, -	MLX5_MODULE_EVENT_ERROR_LONG_RANGE_FOR_NON_MLNX_CABLE_MODULE, -	MLX5_MODULE_EVENT_ERROR_BUS_STUCK, -	MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT, -	MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST, -	MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER, -	MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE, -	MLX5_MODULE_EVENT_ERROR_BAD_CABLE, -	MLX5_MODULE_EVENT_ERROR_UNKNOWN, -	MLX5_MODULE_EVENT_ERROR_NUM, -}; - -struct mlx5_port_module_event_stats { -	u64 status_counters[MLX5_MODULE_STATUS_NUM]; -	u64 error_counters[MLX5_MODULE_EVENT_ERROR_NUM]; -}; -  struct mlx5_priv {  	char			name[MLX5_MAX_NAME_LEN]; -	struct mlx5_eq_table	eq_table; -	struct mlx5_irq_info	*irq_info; +	struct mlx5_eq_table	*eq_table;  	/* pages stuff */ +	struct mlx5_nb          pg_nb;  	struct workqueue_struct *pg_wq;  	struct rb_root		page_root;  	int			fw_pages; @@ -659,8 +525,6 @@ struct mlx5_priv {  	struct mlx5_core_health health; -	struct mlx5_srq_table	srq_table; -  	/* start: qp staff */  	struct mlx5_qp_table	qp_table;  	struct dentry	       *qp_debugfs; @@ -690,28 +554,18 @@ struct mlx5_priv {  	struct list_head        dev_list;  	struct list_head        ctx_list;  	spinlock_t              ctx_lock; - -	struct list_head	waiting_events_list; -	bool			is_accum_events; +	struct mlx5_events      *events;  	struct mlx5_flow_steering *steering;  	struct mlx5_mpfs        *mpfs;  	struct mlx5_eswitch     *eswitch;  	struct mlx5_core_sriov	sriov;  	struct mlx5_lag		*lag; +	struct mlx5_devcom	*devcom;  	unsigned long		pci_dev_data;  	struct mlx5_fc_stats		fc_stats;  	struct mlx5_rl_table            rl_table; -	struct mlx5_port_module_event_stats  pme_stats; - -#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING -	void		      (*pfault)(struct mlx5_core_dev *dev, -					void *context, -					struct mlx5_pagefault *pfault); -	void		       *pfault_ctx; -	struct srcu_struct      pfault_srcu; -#endif  	struct mlx5_bfreg_data		bfregs;  	struct mlx5_uars_page	       *uar;  }; @@ -736,44 +590,6 @@ enum mlx5_pagefault_type_flags {  	MLX5_PFAULT_RDMA      = 1 << 2,  }; -/* Contains the details of a pagefault. */ -struct mlx5_pagefault { -	u32			bytes_committed; -	u32			token; -	u8			event_subtype; -	u8			type; -	union { -		/* Initiator or send message responder pagefault details. */ -		struct { -			/* Received packet size, only valid for responders. */ -			u32	packet_size; -			/* -			 * Number of resource holding WQE, depends on type. -			 */ -			u32	wq_num; -			/* -			 * WQE index. Refers to either the send queue or -			 * receive queue, according to event_subtype. -			 */ -			u16	wqe_index; -		} wqe; -		/* RDMA responder pagefault details */ -		struct { -			u32	r_key; -			/* -			 * Received packet size, minimal size page fault -			 * resolution required for forward progress. -			 */ -			u32	packet_size; -			u32	rdma_op_len; -			u64	rdma_va; -		} rdma; -	}; - -	struct mlx5_eq	       *eq; -	struct work_struct	work; -}; -  struct mlx5_td {  	struct list_head tirs_list;  	u32              tdn; @@ -803,6 +619,8 @@ struct mlx5_pps {  };  struct mlx5_clock { +	struct mlx5_core_dev      *mdev; +	struct mlx5_nb             pps_nb;  	seqlock_t                  lock;  	struct cyclecounter        cycles;  	struct timecounter         tc; @@ -810,7 +628,6 @@ struct mlx5_clock {  	u32                        nominal_c_mult;  	unsigned long              overflow_period;  	struct delayed_work        overflow_work; -	struct mlx5_core_dev      *mdev;  	struct ptp_clock          *ptp;  	struct ptp_clock_info      ptp_info;  	struct mlx5_pps            pps_info; @@ -843,9 +660,6 @@ struct mlx5_core_dev {  	/* sync interface state */  	struct mutex		intf_state_mutex;  	unsigned long		intf_state; -	void			(*event) (struct mlx5_core_dev *dev, -					  enum mlx5_dev_event event, -					  unsigned long param);  	struct mlx5_priv	priv;  	struct mlx5_profile	*profile;  	atomic_t		num_qps; @@ -859,9 +673,6 @@ struct mlx5_core_dev {  #ifdef CONFIG_MLX5_FPGA  	struct mlx5_fpga_device *fpga;  #endif -#ifdef CONFIG_RFS_ACCEL -	struct cpu_rmap         *rmap; -#endif  	struct mlx5_clock        clock;  	struct mlx5_ib_clock_info  *clock_info;  	struct page             *clock_info_page; @@ -940,8 +751,8 @@ struct mlx5_hca_vport_context {  	u64			node_guid;  	u32			cap_mask1;  	u32			cap_mask1_perm; -	u32			cap_mask2; -	u32			cap_mask2_perm; +	u16			cap_mask2; +	u16			cap_mask2_perm;  	u16			lid;  	u8			init_type_reply; /* bitmask: see ib spec 14.2.5.6 InitTypeReply */  	u8			lmc; @@ -1070,13 +881,6 @@ struct mlx5_cmd_mailbox *mlx5_alloc_cmd_mailbox_chain(struct mlx5_core_dev *dev,  						      gfp_t flags, int npages);  void mlx5_free_cmd_mailbox_chain(struct mlx5_core_dev *dev,  				 struct mlx5_cmd_mailbox *head); -int mlx5_core_create_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, -			 struct mlx5_srq_attr *in); -int mlx5_core_destroy_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq); -int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, -			struct mlx5_srq_attr *out); -int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, -		      u16 lwm, int is_srq);  void mlx5_init_mkey_table(struct mlx5_core_dev *dev);  void mlx5_cleanup_mkey_table(struct mlx5_core_dev *dev);  int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev, @@ -1095,9 +899,9 @@ int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn);  int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn);  int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,  		      u16 opmod, u8 port); -void mlx5_pagealloc_init(struct mlx5_core_dev *dev); +int mlx5_pagealloc_init(struct mlx5_core_dev *dev);  void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); -int mlx5_pagealloc_start(struct mlx5_core_dev *dev); +void mlx5_pagealloc_start(struct mlx5_core_dev *dev);  void mlx5_pagealloc_stop(struct mlx5_core_dev *dev);  void mlx5_core_req_pages_handler(struct mlx5_core_dev *dev, u16 func_id,  				 s32 npages); @@ -1108,9 +912,6 @@ void mlx5_unregister_debugfs(void);  void mlx5_fill_page_array(struct mlx5_frag_buf *buf, __be64 *pas);  void mlx5_fill_page_frag_array(struct mlx5_frag_buf *frag_buf, __be64 *pas); -void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type); -void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); -struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn);  int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,  		    unsigned int *irqn);  int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); @@ -1155,6 +956,9 @@ int mlx5_alloc_bfreg(struct mlx5_core_dev *mdev, struct mlx5_sq_bfreg *bfreg,  		     bool map_wc, bool fast_path);  void mlx5_free_bfreg(struct mlx5_core_dev *mdev, struct mlx5_sq_bfreg *bfreg); +unsigned int mlx5_comp_vectors_count(struct mlx5_core_dev *dev); +struct cpumask * +mlx5_comp_irq_get_affinity_mask(struct mlx5_core_dev *dev, int vector);  unsigned int mlx5_core_reserved_gids_count(struct mlx5_core_dev *dev);  int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index,  			   u8 roce_version, u8 roce_l3_type, const u8 *gid, @@ -1202,23 +1006,21 @@ struct mlx5_interface {  	void			(*remove)(struct mlx5_core_dev *dev, void *context);  	int			(*attach)(struct mlx5_core_dev *dev, void *context);  	void			(*detach)(struct mlx5_core_dev *dev, void *context); -	void			(*event)(struct mlx5_core_dev *dev, void *context, -					 enum mlx5_dev_event event, unsigned long param); -	void			(*pfault)(struct mlx5_core_dev *dev, -					  void *context, -					  struct mlx5_pagefault *pfault); -	void *                  (*get_dev)(void *context);  	int			protocol;  	struct list_head	list;  }; -void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol);  int mlx5_register_interface(struct mlx5_interface *intf);  void mlx5_unregister_interface(struct mlx5_interface *intf); +int mlx5_notifier_register(struct mlx5_core_dev *dev, struct notifier_block *nb); +int mlx5_notifier_unregister(struct mlx5_core_dev *dev, struct notifier_block *nb); +  int mlx5_core_query_vendor_id(struct mlx5_core_dev *mdev, u32 *vendor_id);  int mlx5_cmd_create_vport_lag(struct mlx5_core_dev *dev);  int mlx5_cmd_destroy_vport_lag(struct mlx5_core_dev *dev); +bool mlx5_lag_is_roce(struct mlx5_core_dev *dev); +bool mlx5_lag_is_sriov(struct mlx5_core_dev *dev);  bool mlx5_lag_is_active(struct mlx5_core_dev *dev);  struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev);  int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, @@ -1306,10 +1108,4 @@ enum {  	MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32,  }; -static inline const struct cpumask * -mlx5_get_vector_affinity_hint(struct mlx5_core_dev *dev, int vector) -{ -	return dev->priv.irq_info[vector].mask; -} -  #endif /* MLX5_DRIVER_H */ diff --git a/include/linux/mlx5/eq.h b/include/linux/mlx5/eq.h new file mode 100644 index 000000000000..00045cc4ea11 --- /dev/null +++ b/include/linux/mlx5/eq.h @@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ +/* Copyright (c) 2018 Mellanox Technologies. */ + +#ifndef MLX5_CORE_EQ_H +#define MLX5_CORE_EQ_H + +enum { +	MLX5_EQ_PAGEREQ_IDX        = 0, +	MLX5_EQ_CMD_IDX            = 1, +	MLX5_EQ_ASYNC_IDX          = 2, +	/* reserved to be used by mlx5_core ulps (mlx5e/mlx5_ib) */ +	MLX5_EQ_PFAULT_IDX         = 3, +	MLX5_EQ_MAX_ASYNC_EQS, +	/* completion eqs vector indices start here */ +	MLX5_EQ_VEC_COMP_BASE = MLX5_EQ_MAX_ASYNC_EQS, +}; + +#define MLX5_NUM_CMD_EQE   (32) +#define MLX5_NUM_ASYNC_EQE (0x1000) +#define MLX5_NUM_SPARE_EQE (0x80) + +struct mlx5_eq; +struct mlx5_core_dev; + +struct mlx5_eq_param { +	u8             index; +	int            nent; +	u64            mask; +	void          *context; +	irq_handler_t  handler; +}; + +struct mlx5_eq * +mlx5_eq_create_generic(struct mlx5_core_dev *dev, const char *name, +		       struct mlx5_eq_param *param); +int +mlx5_eq_destroy_generic(struct mlx5_core_dev *dev, struct mlx5_eq *eq); + +struct mlx5_eqe *mlx5_eq_get_eqe(struct mlx5_eq *eq, u32 cc); +void mlx5_eq_update_ci(struct mlx5_eq *eq, u32 cc, bool arm); + +/* The HCA will think the queue has overflowed if we + * don't tell it we've been processing events.  We + * create EQs with MLX5_NUM_SPARE_EQE extra entries, + * so we must update our consumer index at + * least that often. + * + * mlx5_eq_update_cc must be called on every EQE @EQ irq handler + */ +static inline u32 mlx5_eq_update_cc(struct mlx5_eq *eq, u32 cc) +{ +	if (unlikely(cc >= MLX5_NUM_SPARE_EQE)) { +		mlx5_eq_update_ci(eq, cc, 0); +		cc = 0; +	} +	return cc; +} + +struct mlx5_nb { +	struct notifier_block nb; +	u8 event_type; +}; + +#define mlx5_nb_cof(ptr, type, member) \ +	(container_of(container_of(ptr, struct mlx5_nb, nb), type, member)) + +#define MLX5_NB_INIT(name, handler, event) do {              \ +	(name)->nb.notifier_call = handler;                  \ +	(name)->event_type = MLX5_EVENT_TYPE_##event;        \ +} while (0) + +#endif /* MLX5_CORE_EQ_H */ diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h index 5660f07d3be0..9df51da04621 100644 --- a/include/linux/mlx5/fs.h +++ b/include/linux/mlx5/fs.h @@ -86,6 +86,11 @@ struct mlx5_flow_spec {  	u32  match_value[MLX5_ST_SZ_DW(fte_match_param)];  }; +enum { +	MLX5_FLOW_DEST_VPORT_VHCA_ID      = BIT(0), +	MLX5_FLOW_DEST_VPORT_REFORMAT_ID  = BIT(1), +}; +  struct mlx5_flow_destination {  	enum mlx5_flow_destination_type	type;  	union { @@ -96,7 +101,8 @@ struct mlx5_flow_destination {  		struct {  			u16		num;  			u16		vhca_id; -			bool		vhca_id_valid; +			u32		reformat_id; +			u8		flags;  		} vport;  	};  }; diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 4e77bfe0b580..35fe5217b244 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -76,13 +76,7 @@ enum {  };  enum { -	MLX5_GENERAL_OBJ_TYPES_CAP_UCTX = (1ULL << 4), -	MLX5_GENERAL_OBJ_TYPES_CAP_UMEM = (1ULL << 5), -}; - -enum { -	MLX5_OBJ_TYPE_UCTX = 0x0004, -	MLX5_OBJ_TYPE_UMEM = 0x0005, +	MLX5_SHARED_RESOURCE_UID = 0xffff,  };  enum { @@ -144,6 +138,9 @@ enum {  	MLX5_CMD_OP_DESTROY_XRQ                   = 0x718,  	MLX5_CMD_OP_QUERY_XRQ                     = 0x719,  	MLX5_CMD_OP_ARM_XRQ                       = 0x71a, +	MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY     = 0x725, +	MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY       = 0x726, +	MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS        = 0x727,  	MLX5_CMD_OP_QUERY_VPORT_STATE             = 0x750,  	MLX5_CMD_OP_MODIFY_VPORT_STATE            = 0x751,  	MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT       = 0x752, @@ -161,6 +158,8 @@ enum {  	MLX5_CMD_OP_ALLOC_Q_COUNTER               = 0x771,  	MLX5_CMD_OP_DEALLOC_Q_COUNTER             = 0x772,  	MLX5_CMD_OP_QUERY_Q_COUNTER               = 0x773, +	MLX5_CMD_OP_SET_MONITOR_COUNTER           = 0x774, +	MLX5_CMD_OP_ARM_MONITOR_COUNTER           = 0x775,  	MLX5_CMD_OP_SET_PP_RATE_LIMIT             = 0x780,  	MLX5_CMD_OP_QUERY_RATE_LIMIT              = 0x781,  	MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT      = 0x782, @@ -245,6 +244,7 @@ enum {  	MLX5_CMD_OP_MODIFY_FLOW_TABLE             = 0x93c,  	MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT = 0x93d,  	MLX5_CMD_OP_DEALLOC_PACKET_REFORMAT_CONTEXT = 0x93e, +	MLX5_CMD_OP_QUERY_PACKET_REFORMAT_CONTEXT = 0x93f,  	MLX5_CMD_OP_ALLOC_MODIFY_HEADER_CONTEXT   = 0x940,  	MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT = 0x941,  	MLX5_CMD_OP_QUERY_MODIFY_HEADER_CONTEXT   = 0x942, @@ -257,9 +257,19 @@ enum {  	MLX5_CMD_OP_MODIFY_GENERAL_OBJECT         = 0xa01,  	MLX5_CMD_OP_QUERY_GENERAL_OBJECT          = 0xa02,  	MLX5_CMD_OP_DESTROY_GENERAL_OBJECT        = 0xa03, +	MLX5_CMD_OP_CREATE_UCTX                   = 0xa04, +	MLX5_CMD_OP_DESTROY_UCTX                  = 0xa06, +	MLX5_CMD_OP_CREATE_UMEM                   = 0xa08, +	MLX5_CMD_OP_DESTROY_UMEM                  = 0xa0a,  	MLX5_CMD_OP_MAX  }; +/* Valid range for general commands that don't work over an object */ +enum { +	MLX5_CMD_OP_GENERAL_START = 0xb00, +	MLX5_CMD_OP_GENERAL_END = 0xd00, +}; +  struct mlx5_ifc_flow_table_fields_supported_bits {  	u8         outer_dmac[0x1];  	u8         outer_smac[0x1]; @@ -349,7 +359,7 @@ struct mlx5_ifc_flow_table_prop_layout_bits {  	u8	   reformat_l3_tunnel_to_l2[0x1];  	u8	   reformat_l2_to_l3_tunnel[0x1];  	u8	   reformat_and_modify_action[0x1]; -	u8         reserved_at_14[0xb]; +	u8         reserved_at_15[0xb];  	u8         reserved_at_20[0x2];  	u8         log_max_ft_size[0x6];  	u8         log_max_modify_header_context[0x8]; @@ -421,6 +431,16 @@ struct mlx5_ifc_fte_match_set_lyr_2_4_bits {  	union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits dst_ipv4_dst_ipv6;  }; +struct mlx5_ifc_nvgre_key_bits { +	u8 hi[0x18]; +	u8 lo[0x8]; +}; + +union mlx5_ifc_gre_key_bits { +	struct mlx5_ifc_nvgre_key_bits nvgre; +	u8 key[0x20]; +}; +  struct mlx5_ifc_fte_match_set_misc_bits {  	u8         reserved_at_0[0x8];  	u8         source_sqn[0x18]; @@ -442,8 +462,7 @@ struct mlx5_ifc_fte_match_set_misc_bits {  	u8         reserved_at_64[0xc];  	u8         gre_protocol[0x10]; -	u8         gre_key_h[0x18]; -	u8         gre_key_l[0x8]; +	union mlx5_ifc_gre_key_bits gre_key;  	u8         vxlan_vni[0x18];  	u8         reserved_at_b8[0x8]; @@ -599,20 +618,28 @@ struct mlx5_ifc_flow_table_eswitch_cap_bits {  	u8      reserved_at_800[0x7800];  }; +enum { +	MLX5_COUNTER_SOURCE_ESWITCH = 0x0, +	MLX5_COUNTER_FLOW_ESWITCH   = 0x1, +}; +  struct mlx5_ifc_e_switch_cap_bits {  	u8         vport_svlan_strip[0x1];  	u8         vport_cvlan_strip[0x1];  	u8         vport_svlan_insert[0x1];  	u8         vport_cvlan_insert_if_not_exist[0x1];  	u8         vport_cvlan_insert_overwrite[0x1]; -	u8         reserved_at_5[0x18]; +	u8         reserved_at_5[0x17]; +	u8         counter_eswitch_affinity[0x1];  	u8         merged_eswitch[0x1];  	u8         nic_vport_node_guid_modify[0x1];  	u8         nic_vport_port_guid_modify[0x1];  	u8         vxlan_encap_decap[0x1];  	u8         nvgre_encap_decap[0x1]; -	u8         reserved_at_22[0x9]; +	u8         reserved_at_22[0x1]; +	u8         log_max_fdb_encap_uplink[0x5]; +	u8         reserved_at_21[0x3];  	u8         log_max_packet_reformat_context[0x5];  	u8         reserved_2b[0x6];  	u8         max_encap_header_size[0xa]; @@ -831,7 +858,7 @@ struct mlx5_ifc_vector_calc_cap_bits {  	struct mlx5_ifc_calc_op calc2;  	struct mlx5_ifc_calc_op calc3; -	u8         reserved_at_e0[0x720]; +	u8         reserved_at_c0[0x720];  };  enum { @@ -885,6 +912,10 @@ enum {  	MLX5_CAP_UMR_FENCE_NONE		= 0x2,  }; +enum { +	MLX5_UCTX_CAP_RAW_TX = 1UL << 0, +}; +  struct mlx5_ifc_cmd_hca_cap_bits {  	u8         reserved_at_0[0x30];  	u8         vhca_id[0x10]; @@ -1045,7 +1076,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {  	u8         vector_calc[0x1];  	u8         umr_ptr_rlky[0x1];  	u8	   imaicl[0x1]; -	u8         reserved_at_232[0x4]; +	u8	   qp_packet_based[0x1]; +	u8         reserved_at_233[0x3];  	u8         qkv[0x1];  	u8         pkv[0x1];  	u8         set_deth_sqpn[0x1]; @@ -1155,7 +1187,10 @@ struct mlx5_ifc_cmd_hca_cap_bits {  	u8         reserved_at_440[0x20]; -	u8         reserved_at_460[0x10]; +	u8         reserved_at_460[0x3]; +	u8         log_max_uctx[0x5]; +	u8         reserved_at_468[0x3]; +	u8         log_max_umem[0x5];  	u8         max_num_eqs[0x10];  	u8         reserved_at_480[0x3]; @@ -1195,7 +1230,19 @@ struct mlx5_ifc_cmd_hca_cap_bits {  	u8	   num_vhca_ports[0x8];  	u8	   reserved_at_618[0x6];  	u8	   sw_owner_id[0x1]; -	u8	   reserved_at_61f[0x1e1]; +	u8         reserved_at_61f[0x1]; + +	u8         max_num_of_monitor_counters[0x10]; +	u8         num_ppcnt_monitor_counters[0x10]; + +	u8         reserved_at_640[0x10]; +	u8         num_q_monitor_counters[0x10]; + +	u8         reserved_at_660[0x40]; + +	u8         uctx_cap[0x20]; + +	u8	   reserved_at_6c0[0x140];  };  enum mlx5_flow_destination_type { @@ -1211,8 +1258,10 @@ enum mlx5_flow_destination_type {  struct mlx5_ifc_dest_format_struct_bits {  	u8         destination_type[0x8];  	u8         destination_id[0x18]; +  	u8         destination_eswitch_owner_vhca_id_valid[0x1]; -	u8         reserved_at_21[0xf]; +	u8         packet_reformat[0x1]; +	u8         reserved_at_22[0xe];  	u8         destination_eswitch_owner_vhca_id[0x10];  }; @@ -1222,6 +1271,14 @@ struct mlx5_ifc_flow_counter_list_bits {  	u8         reserved_at_20[0x20];  }; +struct mlx5_ifc_extended_dest_format_bits { +	struct mlx5_ifc_dest_format_struct_bits destination_entry; + +	u8         packet_reformat_id[0x20]; + +	u8         reserved_at_60[0x20]; +}; +  union mlx5_ifc_dest_format_struct_flow_counter_list_auto_bits {  	struct mlx5_ifc_dest_format_struct_bits dest_format_struct;  	struct mlx5_ifc_flow_counter_list_bits flow_counter_list; @@ -2251,7 +2308,8 @@ struct mlx5_ifc_qpc_bits {  	u8         st[0x8];  	u8         reserved_at_10[0x3];  	u8         pm_state[0x2]; -	u8         reserved_at_15[0x3]; +	u8         reserved_at_15[0x1]; +	u8         req_e2e_credit_mode[0x2];  	u8         offload_type[0x4];  	u8         end_padding_mode[0x2];  	u8         reserved_at_1e[0x2]; @@ -2442,7 +2500,8 @@ struct mlx5_ifc_flow_context_bits {  	u8         reserved_at_60[0x10];  	u8         action[0x10]; -	u8         reserved_at_80[0x8]; +	u8         extended_destination[0x1]; +	u8         reserved_at_80[0x7];  	u8         destination_list_size[0x18];  	u8         reserved_at_a0[0x8]; @@ -3798,6 +3857,83 @@ enum {  	MLX5_VPORT_STATE_OP_MOD_ESW_VPORT   = 0x1,  }; +struct mlx5_ifc_arm_monitor_counter_in_bits { +	u8         opcode[0x10]; +	u8         uid[0x10]; + +	u8         reserved_at_20[0x10]; +	u8         op_mod[0x10]; + +	u8         reserved_at_40[0x20]; + +	u8         reserved_at_60[0x20]; +}; + +struct mlx5_ifc_arm_monitor_counter_out_bits { +	u8         status[0x8]; +	u8         reserved_at_8[0x18]; + +	u8         syndrome[0x20]; + +	u8         reserved_at_40[0x40]; +}; + +enum { +	MLX5_QUERY_MONITOR_CNT_TYPE_PPCNT     = 0x0, +	MLX5_QUERY_MONITOR_CNT_TYPE_Q_COUNTER = 0x1, +}; + +enum mlx5_monitor_counter_ppcnt { +	MLX5_QUERY_MONITOR_PPCNT_IN_RANGE_LENGTH_ERRORS      = 0x0, +	MLX5_QUERY_MONITOR_PPCNT_OUT_OF_RANGE_LENGTH_FIELD   = 0x1, +	MLX5_QUERY_MONITOR_PPCNT_FRAME_TOO_LONG_ERRORS       = 0x2, +	MLX5_QUERY_MONITOR_PPCNT_FRAME_CHECK_SEQUENCE_ERRORS = 0x3, +	MLX5_QUERY_MONITOR_PPCNT_ALIGNMENT_ERRORS            = 0x4, +	MLX5_QUERY_MONITOR_PPCNT_IF_OUT_DISCARDS             = 0x5, +}; + +enum { +	MLX5_QUERY_MONITOR_Q_COUNTER_RX_OUT_OF_BUFFER     = 0x4, +}; + +struct mlx5_ifc_monitor_counter_output_bits { +	u8         reserved_at_0[0x4]; +	u8         type[0x4]; +	u8         reserved_at_8[0x8]; +	u8         counter[0x10]; + +	u8         counter_group_id[0x20]; +}; + +#define MLX5_CMD_SET_MONITOR_NUM_PPCNT_COUNTER_SET1 (6) +#define MLX5_CMD_SET_MONITOR_NUM_Q_COUNTERS_SET1    (1) +#define MLX5_CMD_SET_MONITOR_NUM_COUNTER (MLX5_CMD_SET_MONITOR_NUM_PPCNT_COUNTER_SET1 +\ +					  MLX5_CMD_SET_MONITOR_NUM_Q_COUNTERS_SET1) + +struct mlx5_ifc_set_monitor_counter_in_bits { +	u8         opcode[0x10]; +	u8         uid[0x10]; + +	u8         reserved_at_20[0x10]; +	u8         op_mod[0x10]; + +	u8         reserved_at_40[0x10]; +	u8         num_of_counters[0x10]; + +	u8         reserved_at_60[0x20]; + +	struct mlx5_ifc_monitor_counter_output_bits monitor_counter[MLX5_CMD_SET_MONITOR_NUM_COUNTER]; +}; + +struct mlx5_ifc_set_monitor_counter_out_bits { +	u8         status[0x8]; +	u8         reserved_at_8[0x18]; + +	u8         syndrome[0x20]; + +	u8         reserved_at_40[0x40]; +}; +  struct mlx5_ifc_query_vport_state_in_bits {  	u8         opcode[0x10];  	u8         reserved_at_10[0x10]; @@ -4663,7 +4799,7 @@ enum {  	MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_OUTER_HEADERS    = 0x0,  	MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS  = 0x1,  	MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_INNER_HEADERS    = 0x2, -	MLX5_QUERY_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_2 = 0X3, +	MLX5_QUERY_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_2 = 0x3,  };  struct mlx5_ifc_query_flow_group_out_bits { @@ -5569,7 +5705,7 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits {  struct mlx5_ifc_modify_nic_vport_field_select_bits {  	u8         reserved_at_0[0x12];  	u8	   affiliation[0x1]; -	u8	   reserved_at_e[0x1]; +	u8	   reserved_at_13[0x1];  	u8         disable_uc_local_lb[0x1];  	u8         disable_mc_local_lb[0x1];  	u8         node_guid[0x1]; @@ -6569,7 +6705,7 @@ struct mlx5_ifc_dealloc_transport_domain_out_bits {  struct mlx5_ifc_dealloc_transport_domain_in_bits {  	u8         opcode[0x10]; -	u8         reserved_at_10[0x10]; +	u8         uid[0x10];  	u8         reserved_at_20[0x10];  	u8         op_mod[0x10]; @@ -7422,7 +7558,7 @@ struct mlx5_ifc_alloc_transport_domain_out_bits {  struct mlx5_ifc_alloc_transport_domain_in_bits {  	u8         opcode[0x10]; -	u8         reserved_at_10[0x10]; +	u8         uid[0x10];  	u8         reserved_at_20[0x10];  	u8         op_mod[0x10]; @@ -7444,7 +7580,7 @@ struct mlx5_ifc_alloc_q_counter_out_bits {  struct mlx5_ifc_alloc_q_counter_in_bits {  	u8         opcode[0x10]; -	u8         reserved_at_10[0x10]; +	u8         uid[0x10];  	u8         reserved_at_20[0x10];  	u8         op_mod[0x10]; @@ -8166,7 +8302,9 @@ struct mlx5_ifc_pcam_regs_5000_to_507f_bits {  	u8         port_access_reg_cap_mask_31_to_13[0x13];  	u8         pbmc[0x1];  	u8         pptb[0x1]; -	u8         port_access_reg_cap_mask_10_to_0[0xb]; +	u8         port_access_reg_cap_mask_10_to_09[0x2]; +	u8         ppcnt[0x1]; +	u8         port_access_reg_cap_mask_07_to_00[0x8];  };  struct mlx5_ifc_pcam_reg_bits { @@ -9030,7 +9168,7 @@ struct mlx5_ifc_dcbx_param_bits {  	u8         dcbx_cee_cap[0x1];  	u8         dcbx_ieee_cap[0x1];  	u8         dcbx_standby_cap[0x1]; -	u8         reserved_at_0[0x5]; +	u8         reserved_at_3[0x5];  	u8         port_number[0x8];  	u8         reserved_at_10[0xa];  	u8         max_application_table_size[6]; @@ -9263,9 +9401,9 @@ struct mlx5_ifc_general_obj_out_cmd_hdr_bits {  };  struct mlx5_ifc_umem_bits { -	u8         modify_field_select[0x40]; +	u8         reserved_at_0[0x80]; -	u8         reserved_at_40[0x5b]; +	u8         reserved_at_80[0x1b];  	u8         log_page_size[0x5];  	u8         page_offset[0x20]; @@ -9276,19 +9414,46 @@ struct mlx5_ifc_umem_bits {  };  struct mlx5_ifc_uctx_bits { -	u8         modify_field_select[0x40]; +	u8         cap[0x20]; -	u8         reserved_at_40[0x1c0]; +	u8         reserved_at_20[0x160];  };  struct mlx5_ifc_create_umem_in_bits { -	struct mlx5_ifc_general_obj_in_cmd_hdr_bits   hdr; -	struct mlx5_ifc_umem_bits                     umem; +	u8         opcode[0x10]; +	u8         uid[0x10]; + +	u8         reserved_at_20[0x10]; +	u8         op_mod[0x10]; + +	u8         reserved_at_40[0x40]; + +	struct mlx5_ifc_umem_bits  umem;  };  struct mlx5_ifc_create_uctx_in_bits { -	struct mlx5_ifc_general_obj_in_cmd_hdr_bits   hdr; -	struct mlx5_ifc_uctx_bits                     uctx; +	u8         opcode[0x10]; +	u8         reserved_at_10[0x10]; + +	u8         reserved_at_20[0x10]; +	u8         op_mod[0x10]; + +	u8         reserved_at_40[0x40]; + +	struct mlx5_ifc_uctx_bits  uctx; +}; + +struct mlx5_ifc_destroy_uctx_in_bits { +	u8         opcode[0x10]; +	u8         reserved_at_10[0x10]; + +	u8         reserved_at_20[0x10]; +	u8         op_mod[0x10]; + +	u8         reserved_at_40[0x10]; +	u8         uid[0x10]; + +	u8         reserved_at_60[0x20];  };  struct mlx5_ifc_mtrc_string_db_param_bits { diff --git a/include/linux/mlx5/port.h b/include/linux/mlx5/port.h index 34aed6032f86..bf4bc01ffb0c 100644 --- a/include/linux/mlx5/port.h +++ b/include/linux/mlx5/port.h @@ -107,9 +107,6 @@ enum mlx5e_connector_type {  #define MLX5E_PROT_MASK(link_mode) (1 << link_mode) -#define PORT_MODULE_EVENT_MODULE_STATUS_MASK 0xF -#define PORT_MODULE_EVENT_ERROR_TYPE_MASK         0xF -  int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps);  int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys,  			 int ptys_size, int proto_mask, u8 local_port); diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index fbe322c966bc..b26ea9077384 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h @@ -596,6 +596,11 @@ int mlx5_core_dealloc_q_counter(struct mlx5_core_dev *dev, u16 counter_id);  int mlx5_core_query_q_counter(struct mlx5_core_dev *dev, u16 counter_id,  			      int reset, void *out, int out_size); +struct mlx5_core_rsc_common *mlx5_core_res_hold(struct mlx5_core_dev *dev, +						int res_num, +						enum mlx5_res_type res_type); +void mlx5_core_res_put(struct mlx5_core_rsc_common *res); +  static inline const char *mlx5_qp_type_str(int type)  {  	switch (type) { diff --git a/include/linux/mlx5/srq.h b/include/linux/mlx5/srq.h deleted file mode 100644 index 1b1f3c20c6a3..000000000000 --- a/include/linux/mlx5/srq.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved. - * - * This software is available to you under a choice of one of two - * licenses.  You may choose to be licensed under the terms of the GNU - * General Public License (GPL) Version 2, available from the file - * COPYING in the main directory of this source tree, or the - * OpenIB.org BSD license below: - * - *     Redistribution and use in source and binary forms, with or - *     without modification, are permitted provided that the following - *     conditions are met: - * - *      - Redistributions of source code must retain the above - *        copyright notice, this list of conditions and the following - *        disclaimer. - * - *      - Redistributions in binary form must reproduce the above - *        copyright notice, this list of conditions and the following - *        disclaimer in the documentation and/or other materials - *        provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef MLX5_SRQ_H -#define MLX5_SRQ_H - -#include <linux/mlx5/driver.h> - -enum { -	MLX5_SRQ_FLAG_ERR    = (1 << 0), -	MLX5_SRQ_FLAG_WQ_SIG = (1 << 1), -	MLX5_SRQ_FLAG_RNDV   = (1 << 2), -}; - -struct mlx5_srq_attr { -	u32 type; -	u32 flags; -	u32 log_size; -	u32 wqe_shift; -	u32 log_page_size; -	u32 wqe_cnt; -	u32 srqn; -	u32 xrcd; -	u32 page_offset; -	u32 cqn; -	u32 pd; -	u32 lwm; -	u32 user_index; -	u64 db_record; -	__be64 *pas; -	u32 tm_log_list_size; -	u32 tm_next_tag; -	u32 tm_hw_phase_cnt; -	u32 tm_sw_phase_cnt; -	u16 uid; -}; - -struct mlx5_core_dev; - -void mlx5_init_srq_table(struct mlx5_core_dev *dev); -void mlx5_cleanup_srq_table(struct mlx5_core_dev *dev); - -#endif /* MLX5_SRQ_H */ diff --git a/include/linux/mlx5/transobj.h b/include/linux/mlx5/transobj.h index 7f5ca2cd3a32..a261d5528ff7 100644 --- a/include/linux/mlx5/transobj.h +++ b/include/linux/mlx5/transobj.h @@ -58,17 +58,6 @@ int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen,  int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in,  			 int inlen);  void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn); -int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen, -			 u32 *rmpn); -int mlx5_core_modify_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen); -int mlx5_core_destroy_rmp(struct mlx5_core_dev *dev, u32 rmpn); -int mlx5_core_query_rmp(struct mlx5_core_dev *dev, u32 rmpn, u32 *out); -int mlx5_core_arm_rmp(struct mlx5_core_dev *dev, u32 rmpn, u16 lwm); -int mlx5_core_create_xsrq(struct mlx5_core_dev *dev, u32 *in, int inlen, -			  u32 *rmpn); -int mlx5_core_destroy_xsrq(struct mlx5_core_dev *dev, u32 rmpn); -int mlx5_core_arm_xsrq(struct mlx5_core_dev *dev, u32 rmpn, u16 lwm); -  int mlx5_core_create_rqt(struct mlx5_core_dev *dev, u32 *in, int inlen,  			 u32 *rqtn);  int mlx5_core_modify_rqt(struct mlx5_core_dev *dev, u32 rqtn, u32 *in, | 
