Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eda98779 authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

Merge branch 'mellanox/mlx5-next' into rdma.git for-next

From git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git



This is required to resolve dependencies of the next series of RDMA
patches.

* branch 'mellanox/mlx5-next':
  net/mlx5: Add support for flow table destination number
  net/mlx5: Add forward compatible support for the FTE match data
  net/mlx5: Fix tristate and description for MLX5 module
  net/mlx5: Better return types for CQE API
  net/mlx5: Use ERR_CAST() instead of coding it
  net/mlx5: Add missing SET_DRIVER_VERSION command translation
  net/mlx5: Add XRQ commands definitions
  net/mlx5: Add core support for double vlan push/pop steering action
  net/mlx5: Expose MPEGC (Management PCIe General Configuration) structures
  net/mlx5: FW tracer, add hardware structures
  net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers

Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parents 4fca0377 664000b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
config MLX5_INFINIBAND
	tristate "Mellanox Connect-IB HCA support"
	tristate "Mellanox 5th generation network adapters (ConnectX series) support"
	depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
	depends on INFINIBAND_USER_ACCESS || INFINIBAND_USER_ACCESS=n
	---help---
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#

config MLX5_CORE
	tristate "Mellanox Technologies ConnectX-4 and Connect-IB core driver"
	tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
	depends on MAY_USE_DEVLINK
	depends on PCI
	imply PTP_1588_CLOCK
@@ -27,7 +27,7 @@ config MLX5_FPGA
          sandbox-specific client drivers.

config MLX5_CORE_EN
	bool "Mellanox Technologies ConnectX-4 Ethernet support"
	bool "Mellanox 5th generation network adapters (ConnectX series) Ethernet support"
	depends on NETDEVICES && ETHERNET && INET && PCI && MLX5_CORE
	depends on IPV6=y || IPV6=n || MLX5_CORE=m
	select PAGE_POOL
@@ -69,7 +69,7 @@ config MLX5_CORE_EN_DCB
	  If unsure, set to Y

config MLX5_CORE_IPOIB
	bool "Mellanox Technologies ConnectX-4 IPoIB offloads support"
	bool "Mellanox 5th generation network adapters (connectX series) IPoIB offloads support"
	depends on MLX5_CORE_EN
	default n
	---help---
+16 −21
Original line number Diff line number Diff line
@@ -278,6 +278,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
	case MLX5_CMD_OP_DESTROY_PSV:
	case MLX5_CMD_OP_DESTROY_SRQ:
	case MLX5_CMD_OP_DESTROY_XRC_SRQ:
	case MLX5_CMD_OP_DESTROY_XRQ:
	case MLX5_CMD_OP_DESTROY_DCT:
	case MLX5_CMD_OP_DEALLOC_Q_COUNTER:
	case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT:
@@ -347,6 +348,9 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op,
	case MLX5_CMD_OP_CREATE_XRC_SRQ:
	case MLX5_CMD_OP_QUERY_XRC_SRQ:
	case MLX5_CMD_OP_ARM_XRC_SRQ:
	case MLX5_CMD_OP_CREATE_XRQ:
	case MLX5_CMD_OP_QUERY_XRQ:
	case MLX5_CMD_OP_ARM_XRQ:
	case MLX5_CMD_OP_CREATE_DCT:
	case MLX5_CMD_OP_DRAIN_DCT:
	case MLX5_CMD_OP_QUERY_DCT:
@@ -456,6 +460,7 @@ const char *mlx5_command_str(int command)
	MLX5_COMMAND_STR_CASE(SET_HCA_CAP);
	MLX5_COMMAND_STR_CASE(QUERY_ISSI);
	MLX5_COMMAND_STR_CASE(SET_ISSI);
	MLX5_COMMAND_STR_CASE(SET_DRIVER_VERSION);
	MLX5_COMMAND_STR_CASE(CREATE_MKEY);
	MLX5_COMMAND_STR_CASE(QUERY_MKEY);
	MLX5_COMMAND_STR_CASE(DESTROY_MKEY);
@@ -603,6 +608,10 @@ const char *mlx5_command_str(int command)
	MLX5_COMMAND_STR_CASE(FPGA_QUERY_QP);
	MLX5_COMMAND_STR_CASE(FPGA_QUERY_QP_COUNTERS);
	MLX5_COMMAND_STR_CASE(FPGA_DESTROY_QP);
	MLX5_COMMAND_STR_CASE(CREATE_XRQ);
	MLX5_COMMAND_STR_CASE(DESTROY_XRQ);
	MLX5_COMMAND_STR_CASE(QUERY_XRQ);
	MLX5_COMMAND_STR_CASE(ARM_XRQ);
	MLX5_COMMAND_STR_CASE(CREATE_GENERAL_OBJECT);
	MLX5_COMMAND_STR_CASE(DESTROY_GENERAL_OBJECT);
	MLX5_COMMAND_STR_CASE(MODIFY_GENERAL_OBJECT);
@@ -1037,7 +1046,10 @@ static ssize_t dbg_write(struct file *filp, const char __user *buf,
	if (!dbg->in_msg || !dbg->out_msg)
		return -ENOMEM;

	if (copy_from_user(lbuf, buf, sizeof(lbuf)))
	if (count < sizeof(lbuf) - 1)
		return -EINVAL;

	if (copy_from_user(lbuf, buf, sizeof(lbuf) - 1))
		return -EFAULT;

	lbuf[sizeof(lbuf) - 1] = 0;
@@ -1241,21 +1253,12 @@ static ssize_t data_read(struct file *filp, char __user *buf, size_t count,
{
	struct mlx5_core_dev *dev = filp->private_data;
	struct mlx5_cmd_debug *dbg = &dev->cmd.dbg;
	int copy;

	if (*pos)
		return 0;

	if (!dbg->out_msg)
		return -ENOMEM;

	copy = min_t(int, count, dbg->outlen);
	if (copy_to_user(buf, dbg->out_msg, copy))
		return -EFAULT;

	*pos += copy;

	return copy;
	return simple_read_from_buffer(buf, count, pos, dbg->out_msg,
				       dbg->outlen);
}

static const struct file_operations dfops = {
@@ -1273,19 +1276,11 @@ static ssize_t outlen_read(struct file *filp, char __user *buf, size_t count,
	char outlen[8];
	int err;

	if (*pos)
		return 0;

	err = snprintf(outlen, sizeof(outlen), "%d", dbg->outlen);
	if (err < 0)
		return err;

	if (copy_to_user(buf, &outlen, err))
		return -EFAULT;

	*pos += err;

	return err;
	return simple_read_from_buffer(buf, count, pos, outlen, err);
}

static ssize_t outlen_write(struct file *filp, const char __user *buf,
+2 −20
Original line number Diff line number Diff line
@@ -150,22 +150,13 @@ static ssize_t average_read(struct file *filp, char __user *buf, size_t count,
	int ret;
	char tbuf[22];

	if (*pos)
		return 0;

	stats = filp->private_data;
	spin_lock_irq(&stats->lock);
	if (stats->n)
		field = div64_u64(stats->sum, stats->n);
	spin_unlock_irq(&stats->lock);
	ret = snprintf(tbuf, sizeof(tbuf), "%llu\n", field);
	if (ret > 0) {
		if (copy_to_user(buf, tbuf, ret))
			return -EFAULT;
	}

	*pos += ret;
	return ret;
	return simple_read_from_buffer(buf, count, pos, tbuf, ret);
}

static ssize_t average_write(struct file *filp, const char __user *buf,
@@ -442,9 +433,6 @@ static ssize_t dbg_read(struct file *filp, char __user *buf, size_t count,
	u64 field;
	int ret;

	if (*pos)
		return 0;

	desc = filp->private_data;
	d = (void *)(desc - desc->i) - sizeof(*d);
	switch (d->type) {
@@ -470,13 +458,7 @@ static ssize_t dbg_read(struct file *filp, char __user *buf, size_t count,
	else
		ret = snprintf(tbuf, sizeof(tbuf), "0x%llx\n", field);

	if (ret > 0) {
		if (copy_to_user(buf, tbuf, ret))
			return -EFAULT;
	}

	*pos += ret;
	return ret;
	return simple_read_from_buffer(buf, count, pos, tbuf, ret);
}

static const struct file_operations fops = {
+3 −0
Original line number Diff line number Diff line
@@ -240,6 +240,9 @@ const char *parse_fs_dst(struct trace_seq *p,
	case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE:
		trace_seq_printf(p, "ft=%p\n", dst->ft);
		break;
	case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM:
		trace_seq_printf(p, "ft_num=%u\n", dst->ft_num);
		break;
	case MLX5_FLOW_DESTINATION_TYPE_TIR:
		trace_seq_printf(p, "tir=%u\n", dst->tir_num);
		break;
Loading