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

Commit 61c2491d authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'mlx5-updates-2019-07-04-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux



Saeed Mahameed says:

====================
mlx5-update-2019-07-04

This series adds mlx5 support for devlink fw versions query.

1) Implement the required low level firmware commands
2) Implement the devlink knobs and callbacks for fw versions query.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f654e676 8338d937
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -10,6 +10,7 @@ Contents
========
========


- `Enabling the driver and kconfig options`_
- `Enabling the driver and kconfig options`_
- `Devlink info`_
- `Devlink health reporters`_
- `Devlink health reporters`_


Enabling the driver and kconfig options
Enabling the driver and kconfig options
@@ -101,6 +102,24 @@ Enabling the driver and kconfig options
- CONFIG_VXLAN: When chosen, mlx5 vxaln support will be enabled.
- CONFIG_VXLAN: When chosen, mlx5 vxaln support will be enabled.
- CONFIG_MLXFW: When chosen, mlx5 firmware flashing support will be enabled (via devlink and ethtool).
- CONFIG_MLXFW: When chosen, mlx5 firmware flashing support will be enabled (via devlink and ethtool).


Devlink info
============

The devlink info reports the running and stored firmware versions on device.
It also prints the device PSID which represents the HCA board type ID.

User command example::

   $ devlink dev info pci/0000:00:06.0
      pci/0000:00:06.0:
      driver mlx5_core
      versions:
         fixed:
            fw.psid MT_0000000009
         running:
            fw.version 16.26.0100
         stored:
            fw.version 16.26.0100


Devlink health reporters
Devlink health reporters
========================
========================
+3 −2
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@
#include "mlx5_ib.h"
#include "mlx5_ib.h"
#include "srq.h"
#include "srq.h"


static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq)
static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe)
{
{
	struct ib_cq *ibcq = &to_mibcq(cq)->ibcq;
	struct ib_cq *ibcq = &to_mibcq(cq)->ibcq;


@@ -891,6 +891,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
	int entries = attr->cqe;
	int entries = attr->cqe;
	int vector = attr->comp_vector;
	int vector = attr->comp_vector;
	struct mlx5_ib_dev *dev = to_mdev(ibdev);
	struct mlx5_ib_dev *dev = to_mdev(ibdev);
	u32 out[MLX5_ST_SZ_DW(create_cq_out)];
	struct mlx5_ib_cq *cq;
	struct mlx5_ib_cq *cq;
	int uninitialized_var(index);
	int uninitialized_var(index);
	int uninitialized_var(inlen);
	int uninitialized_var(inlen);
@@ -958,7 +959,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
	if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
	if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
		MLX5_SET(cqc, cqc, oi, 1);
		MLX5_SET(cqc, cqc, oi, 1);


	err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen);
	err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen, out, sizeof(out));
	if (err)
	if (err)
		goto err_cqb;
		goto err_cqb;


+14 −10
Original line number Original line Diff line number Diff line
@@ -14,9 +14,10 @@ mlx5_ib_set_vport_rep(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
	int vport_index;
	int vport_index;


	ibdev = mlx5_ib_get_uplink_ibdev(dev->priv.eswitch);
	ibdev = mlx5_ib_get_uplink_ibdev(dev->priv.eswitch);
	vport_index = ibdev->free_port++;
	vport_index = rep->vport_index;


	ibdev->port[vport_index].rep = rep;
	ibdev->port[vport_index].rep = rep;
	rep->rep_data[REP_IB].priv = ibdev;
	write_lock(&ibdev->port[vport_index].roce.netdev_lock);
	write_lock(&ibdev->port[vport_index].roce.netdev_lock);
	ibdev->port[vport_index].roce.netdev =
	ibdev->port[vport_index].roce.netdev =
		mlx5_ib_get_rep_netdev(dev->priv.eswitch, rep->vport);
		mlx5_ib_get_rep_netdev(dev->priv.eswitch, rep->vport);
@@ -28,7 +29,7 @@ mlx5_ib_set_vport_rep(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
static int
static int
mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
{
{
	int num_ports = MLX5_TOTAL_VPORTS(dev);
	int num_ports = mlx5_eswitch_get_total_vports(dev);
	const struct mlx5_ib_profile *profile;
	const struct mlx5_ib_profile *profile;
	struct mlx5_ib_dev *ibdev;
	struct mlx5_ib_dev *ibdev;
	int vport_index;
	int vport_index;
@@ -50,7 +51,7 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
	}
	}


	ibdev->is_rep = true;
	ibdev->is_rep = true;
	vport_index = ibdev->free_port++;
	vport_index = rep->vport_index;
	ibdev->port[vport_index].rep = rep;
	ibdev->port[vport_index].rep = rep;
	ibdev->port[vport_index].roce.netdev =
	ibdev->port[vport_index].roce.netdev =
		mlx5_ib_get_rep_netdev(dev->priv.eswitch, rep->vport);
		mlx5_ib_get_rep_netdev(dev->priv.eswitch, rep->vport);
@@ -68,15 +69,18 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
static void
static void
mlx5_ib_vport_rep_unload(struct mlx5_eswitch_rep *rep)
mlx5_ib_vport_rep_unload(struct mlx5_eswitch_rep *rep)
{
{
	struct mlx5_ib_dev *dev;
	struct mlx5_ib_dev *dev = mlx5_ib_rep_to_dev(rep);
	struct mlx5_ib_port *port;


	if (!rep->rep_data[REP_IB].priv ||
	port = &dev->port[rep->vport_index];
	    rep->vport != MLX5_VPORT_UPLINK)
	write_lock(&port->roce.netdev_lock);
		return;
	port->roce.netdev = NULL;
	write_unlock(&port->roce.netdev_lock);
	rep->rep_data[REP_IB].priv = NULL;
	port->rep = NULL;


	dev = mlx5_ib_rep_to_dev(rep);
	if (rep->vport == MLX5_VPORT_UPLINK)
		__mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX);
		__mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX);
	rep->rep_data[REP_IB].priv = NULL;
}
}


static void *mlx5_ib_vport_get_proto_dev(struct mlx5_eswitch_rep *rep)
static void *mlx5_ib_vport_get_proto_dev(struct mlx5_eswitch_rep *rep)
+1 −1
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@ struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw,
#else /* CONFIG_MLX5_ESWITCH */
#else /* CONFIG_MLX5_ESWITCH */
static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw)
static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw)
{
{
	return SRIOV_NONE;
	return MLX5_ESWITCH_NONE;
}
}


static inline
static inline
+2 −2
Original line number Original line Diff line number Diff line
@@ -4492,7 +4492,7 @@ static void mlx5_ib_handle_internal_error(struct mlx5_ib_dev *ibdev)
	 * lock/unlock above locks Now need to arm all involved CQs.
	 * lock/unlock above locks Now need to arm all involved CQs.
	 */
	 */
	list_for_each_entry(mcq, &cq_armed_list, reset_notify) {
	list_for_each_entry(mcq, &cq_armed_list, reset_notify) {
		mcq->comp(mcq);
		mcq->comp(mcq, NULL);
	}
	}
	spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags);
	spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags);
}
}
@@ -6814,7 +6814,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
	printk_once(KERN_INFO "%s", mlx5_version);
	printk_once(KERN_INFO "%s", mlx5_version);


	if (MLX5_ESWITCH_MANAGER(mdev) &&
	if (MLX5_ESWITCH_MANAGER(mdev) &&
	    mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
	    mlx5_ib_eswitch_mode(mdev->priv.eswitch) == MLX5_ESWITCH_OFFLOADS) {
		if (!mlx5_core_mp_enabled(mdev))
		if (!mlx5_core_mp_enabled(mdev))
			mlx5_ib_register_vport_reps(mdev);
			mlx5_ib_register_vport_reps(mdev);
		return mdev;
		return mdev;
Loading