Commit 04c6faa1 authored by David S. Miller's avatar David S. Miller

Merge tag 'mlx5-fixes-2018-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-fixes-2018-06-26

Fixes for mlx5 core and netdev driver:

Two fixes from Alex Vesker to address command interface issues
 - Race in command interface polling mode
 - Incorrect raw command length parsing

From Shay Agroskin, Fix wrong size allocation for QoS ETC TC regitster.

From Or Gerlitz and Eli Cohin, Address backward compatability issues for when
Eswitch capability is not advertised for the PF host driver
    - Fix required capability for manipulating MPFS
    - E-Switch, Disallow vlan/spoofcheck setup if not being esw manager
    - Avoid dealing with vport IB/eth representors if not being e-switch manager
    - E-Switch, Avoid setup attempt if not being e-switch manager
    - Don't attempt to dereference the ppriv struct if not being eswitch manager
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 933e671f d412c31d
...@@ -6113,7 +6113,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) ...@@ -6113,7 +6113,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports), dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports),
MLX5_CAP_GEN(mdev, num_vhca_ports)); MLX5_CAP_GEN(mdev, num_vhca_ports));
if (MLX5_VPORT_MANAGER(mdev) && if (MLX5_ESWITCH_MANAGER(mdev) &&
mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) { mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0); dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0);
......
...@@ -807,6 +807,7 @@ static void cmd_work_handler(struct work_struct *work) ...@@ -807,6 +807,7 @@ static void cmd_work_handler(struct work_struct *work)
unsigned long flags; unsigned long flags;
bool poll_cmd = ent->polling; bool poll_cmd = ent->polling;
int alloc_ret; int alloc_ret;
int cmd_mode;
sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
down(sem); down(sem);
...@@ -853,6 +854,7 @@ static void cmd_work_handler(struct work_struct *work) ...@@ -853,6 +854,7 @@ static void cmd_work_handler(struct work_struct *work)
set_signature(ent, !cmd->checksum_disabled); set_signature(ent, !cmd->checksum_disabled);
dump_command(dev, ent, 1); dump_command(dev, ent, 1);
ent->ts1 = ktime_get_ns(); ent->ts1 = ktime_get_ns();
cmd_mode = cmd->mode;
if (ent->callback) if (ent->callback)
schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); schedule_delayed_work(&ent->cb_timeout_work, cb_timeout);
...@@ -877,7 +879,7 @@ static void cmd_work_handler(struct work_struct *work) ...@@ -877,7 +879,7 @@ static void cmd_work_handler(struct work_struct *work)
iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell); iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell);
mmiowb(); mmiowb();
/* if not in polling don't use ent after this point */ /* if not in polling don't use ent after this point */
if (cmd->mode == CMD_MODE_POLLING || poll_cmd) { if (cmd_mode == CMD_MODE_POLLING || poll_cmd) {
poll_timeout(ent); poll_timeout(ent);
/* make sure we read the descriptor after ownership is SW */ /* make sure we read the descriptor after ownership is SW */
rmb(); rmb();
...@@ -1276,7 +1278,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, ...@@ -1276,7 +1278,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,
{ {
struct mlx5_core_dev *dev = filp->private_data; struct mlx5_core_dev *dev = filp->private_data;
struct mlx5_cmd_debug *dbg = &dev->cmd.dbg; struct mlx5_cmd_debug *dbg = &dev->cmd.dbg;
char outlen_str[8]; char outlen_str[8] = {0};
int outlen; int outlen;
void *ptr; void *ptr;
int err; int err;
...@@ -1291,8 +1293,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, ...@@ -1291,8 +1293,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf,
if (copy_from_user(outlen_str, buf, count)) if (copy_from_user(outlen_str, buf, count))
return -EFAULT; return -EFAULT;
outlen_str[7] = 0;
err = sscanf(outlen_str, "%d", &outlen); err = sscanf(outlen_str, "%d", &outlen);
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -2846,7 +2846,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv) ...@@ -2846,7 +2846,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv)
mlx5e_activate_channels(&priv->channels); mlx5e_activate_channels(&priv->channels);
netif_tx_start_all_queues(priv->netdev); netif_tx_start_all_queues(priv->netdev);
if (MLX5_VPORT_MANAGER(priv->mdev)) if (MLX5_ESWITCH_MANAGER(priv->mdev))
mlx5e_add_sqs_fwd_rules(priv); mlx5e_add_sqs_fwd_rules(priv);
mlx5e_wait_channels_min_rx_wqes(&priv->channels); mlx5e_wait_channels_min_rx_wqes(&priv->channels);
...@@ -2857,7 +2857,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv) ...@@ -2857,7 +2857,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv)
{ {
mlx5e_redirect_rqts_to_drop(priv); mlx5e_redirect_rqts_to_drop(priv);
if (MLX5_VPORT_MANAGER(priv->mdev)) if (MLX5_ESWITCH_MANAGER(priv->mdev))
mlx5e_remove_sqs_fwd_rules(priv); mlx5e_remove_sqs_fwd_rules(priv);
/* FIXME: This is a W/A only for tx timeout watch dog false alarm when /* FIXME: This is a W/A only for tx timeout watch dog false alarm when
...@@ -4597,7 +4597,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) ...@@ -4597,7 +4597,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
mlx5e_set_netdev_dev_addr(netdev); mlx5e_set_netdev_dev_addr(netdev);
#if IS_ENABLED(CONFIG_MLX5_ESWITCH) #if IS_ENABLED(CONFIG_MLX5_ESWITCH)
if (MLX5_VPORT_MANAGER(mdev)) if (MLX5_ESWITCH_MANAGER(mdev))
netdev->switchdev_ops = &mlx5e_switchdev_ops; netdev->switchdev_ops = &mlx5e_switchdev_ops;
#endif #endif
...@@ -4753,7 +4753,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) ...@@ -4753,7 +4753,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)
mlx5e_enable_async_events(priv); mlx5e_enable_async_events(priv);
if (MLX5_VPORT_MANAGER(priv->mdev)) if (MLX5_ESWITCH_MANAGER(priv->mdev))
mlx5e_register_vport_reps(priv); mlx5e_register_vport_reps(priv);
if (netdev->reg_state != NETREG_REGISTERED) if (netdev->reg_state != NETREG_REGISTERED)
...@@ -4788,7 +4788,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) ...@@ -4788,7 +4788,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
queue_work(priv->wq, &priv->set_rx_mode_work); queue_work(priv->wq, &priv->set_rx_mode_work);
if (MLX5_VPORT_MANAGER(priv->mdev)) if (MLX5_ESWITCH_MANAGER(priv->mdev))
mlx5e_unregister_vport_reps(priv); mlx5e_unregister_vport_reps(priv);
mlx5e_disable_async_events(priv); mlx5e_disable_async_events(priv);
...@@ -4972,7 +4972,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev) ...@@ -4972,7 +4972,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev)
return NULL; return NULL;
#ifdef CONFIG_MLX5_ESWITCH #ifdef CONFIG_MLX5_ESWITCH
if (MLX5_VPORT_MANAGER(mdev)) { if (MLX5_ESWITCH_MANAGER(mdev)) {
rpriv = mlx5e_alloc_nic_rep_priv(mdev); rpriv = mlx5e_alloc_nic_rep_priv(mdev);
if (!rpriv) { if (!rpriv) {
mlx5_core_warn(mdev, "Failed to alloc NIC rep priv data\n"); mlx5_core_warn(mdev, "Failed to alloc NIC rep priv data\n");
......
...@@ -823,7 +823,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) ...@@ -823,7 +823,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv)
struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5e_rep_priv *rpriv = priv->ppriv;
struct mlx5_eswitch_rep *rep; struct mlx5_eswitch_rep *rep;
if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager)) if (!MLX5_ESWITCH_MANAGER(priv->mdev))
return false; return false;
rep = rpriv->rep; rep = rpriv->rep;
...@@ -837,8 +837,12 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) ...@@ -837,8 +837,12 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv)
static bool mlx5e_is_vf_vport_rep(struct mlx5e_priv *priv) static bool mlx5e_is_vf_vport_rep(struct mlx5e_priv *priv)
{ {
struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5e_rep_priv *rpriv = priv->ppriv;
struct mlx5_eswitch_rep *rep = rpriv->rep; struct mlx5_eswitch_rep *rep;
if (!MLX5_ESWITCH_MANAGER(priv->mdev))
return false;
rep = rpriv->rep;
if (rep && rep->vport != FDB_UPLINK_VPORT) if (rep && rep->vport != FDB_UPLINK_VPORT)
return true; return true;
......
...@@ -1594,17 +1594,15 @@ static void esw_disable_vport(struct mlx5_eswitch *esw, int vport_num) ...@@ -1594,17 +1594,15 @@ static void esw_disable_vport(struct mlx5_eswitch *esw, int vport_num)
} }
/* Public E-Switch API */ /* Public E-Switch API */
#define ESW_ALLOWED(esw) ((esw) && MLX5_VPORT_MANAGER((esw)->dev)) #define ESW_ALLOWED(esw) ((esw) && MLX5_ESWITCH_MANAGER((esw)->dev))
int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode) int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode)
{ {
int err; int err;
int i, enabled_events; int i, enabled_events;
if (!ESW_ALLOWED(esw)) if (!ESW_ALLOWED(esw) ||
return 0;
if (!MLX5_CAP_GEN(esw->dev, eswitch_flow_table) ||
!MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ft_support)) { !MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ft_support)) {
esw_warn(esw->dev, "E-Switch FDB is not supported, aborting ...\n"); esw_warn(esw->dev, "E-Switch FDB is not supported, aborting ...\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -1806,7 +1804,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, ...@@ -1806,7 +1804,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
u64 node_guid; u64 node_guid;
int err = 0; int err = 0;
if (!ESW_ALLOWED(esw)) if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
return -EPERM; return -EPERM;
if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac)) if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac))
return -EINVAL; return -EINVAL;
...@@ -1883,7 +1881,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw, ...@@ -1883,7 +1881,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
{ {
struct mlx5_vport *evport; struct mlx5_vport *evport;
if (!ESW_ALLOWED(esw)) if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
return -EPERM; return -EPERM;
if (!LEGAL_VPORT(esw, vport)) if (!LEGAL_VPORT(esw, vport))
return -EINVAL; return -EINVAL;
......
...@@ -1079,8 +1079,8 @@ static int mlx5_devlink_eswitch_check(struct devlink *devlink) ...@@ -1079,8 +1079,8 @@ static int mlx5_devlink_eswitch_check(struct devlink *devlink)
if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH) if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!MLX5_CAP_GEN(dev, vport_group_manager)) if(!MLX5_ESWITCH_MANAGER(dev))
return -EOPNOTSUPP; return -EPERM;
if (dev->priv.eswitch->mode == SRIOV_NONE) if (dev->priv.eswitch->mode == SRIOV_NONE)
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#include <linux/mlx5/eswitch.h>
#include "mlx5_core.h" #include "mlx5_core.h"
#include "fs_core.h" #include "fs_core.h"
...@@ -2652,7 +2653,7 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) ...@@ -2652,7 +2653,7 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
goto err; goto err;
} }
if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { if (MLX5_ESWITCH_MANAGER(dev)) {
if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) { if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) {
err = init_fdb_root_ns(steering); err = init_fdb_root_ns(steering);
if (err) if (err)
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#include <linux/mlx5/cmd.h> #include <linux/mlx5/cmd.h>
#include <linux/mlx5/eswitch.h>
#include <linux/module.h> #include <linux/module.h>
#include "mlx5_core.h" #include "mlx5_core.h"
#include "../../mlxfw/mlxfw.h" #include "../../mlxfw/mlxfw.h"
...@@ -159,13 +160,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) ...@@ -159,13 +160,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
} }
if (MLX5_CAP_GEN(dev, vport_group_manager) && if (MLX5_CAP_GEN(dev, vport_group_manager) &&
MLX5_CAP_GEN(dev, eswitch_flow_table)) { MLX5_ESWITCH_MANAGER(dev)) {
err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH_FLOW_TABLE); err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH_FLOW_TABLE);
if (err) if (err)
return err; return err;
} }
if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { if (MLX5_ESWITCH_MANAGER(dev)) {
err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH); err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH);
if (err) if (err)
return err; return err;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#include <linux/mlx5/mlx5_ifc.h> #include <linux/mlx5/mlx5_ifc.h>
#include <linux/mlx5/eswitch.h>
#include "mlx5_core.h" #include "mlx5_core.h"
#include "lib/mpfs.h" #include "lib/mpfs.h"
...@@ -98,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev) ...@@ -98,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev)
int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table); int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table);
struct mlx5_mpfs *mpfs; struct mlx5_mpfs *mpfs;
if (!MLX5_VPORT_MANAGER(dev)) if (!MLX5_ESWITCH_MANAGER(dev))
return 0; return 0;
mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL); mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL);
...@@ -122,7 +123,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev) ...@@ -122,7 +123,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev)
{ {
struct mlx5_mpfs *mpfs = dev->priv.mpfs; struct mlx5_mpfs *mpfs = dev->priv.mpfs;
if (!MLX5_VPORT_MANAGER(dev)) if (!MLX5_ESWITCH_MANAGER(dev))
return; return;
WARN_ON(!hlist_empty(mpfs->hash)); WARN_ON(!hlist_empty(mpfs->hash));
...@@ -137,7 +138,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac) ...@@ -137,7 +138,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac)
u32 index; u32 index;
int err; int err;
if (!MLX5_VPORT_MANAGER(dev)) if (!MLX5_ESWITCH_MANAGER(dev))
return 0; return 0;
mutex_lock(&mpfs->lock); mutex_lock(&mpfs->lock);
...@@ -179,7 +180,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac) ...@@ -179,7 +180,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac)
int err = 0; int err = 0;
u32 index; u32 index;
if (!MLX5_VPORT_MANAGER(dev)) if (!MLX5_ESWITCH_MANAGER(dev))
return 0; return 0;
mutex_lock(&mpfs->lock); mutex_lock(&mpfs->lock);
......
...@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc); ...@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc);
static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in,
int inlen) int inlen)
{ {
u32 out[MLX5_ST_SZ_DW(qtct_reg)]; u32 out[MLX5_ST_SZ_DW(qetc_reg)];
if (!MLX5_CAP_GEN(mdev, ets)) if (!MLX5_CAP_GEN(mdev, ets))
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -713,7 +713,7 @@ static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, ...@@ -713,7 +713,7 @@ static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in,
static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out, static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out,
int outlen) int outlen)
{ {
u32 in[MLX5_ST_SZ_DW(qtct_reg)]; u32 in[MLX5_ST_SZ_DW(qetc_reg)];
if (!MLX5_CAP_GEN(mdev, ets)) if (!MLX5_CAP_GEN(mdev, ets))
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -88,6 +88,9 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) ...@@ -88,6 +88,9 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs)
return -EBUSY; return -EBUSY;
} }
if (!MLX5_ESWITCH_MANAGER(dev))
goto enable_vfs_hca;
err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY); err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY);
if (err) { if (err) {
mlx5_core_warn(dev, mlx5_core_warn(dev,
...@@ -95,6 +98,7 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) ...@@ -95,6 +98,7 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs)
return err; return err;
} }
enable_vfs_hca:
for (vf = 0; vf < num_vfs; vf++) { for (vf = 0; vf < num_vfs; vf++) {
err = mlx5_core_enable_hca(dev, vf + 1); err = mlx5_core_enable_hca(dev, vf + 1);
if (err) { if (err) {
...@@ -140,7 +144,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev) ...@@ -140,7 +144,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev)
} }
out: out:
mlx5_eswitch_disable_sriov(dev->priv.eswitch); if (MLX5_ESWITCH_MANAGER(dev))
mlx5_eswitch_disable_sriov(dev->priv.eswitch);
if (mlx5_wait_for_vf_pages(dev)) if (mlx5_wait_for_vf_pages(dev))
mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); mlx5_core_warn(dev, "timeout reclaiming VFs pages\n");
......
...@@ -549,8 +549,6 @@ int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev, ...@@ -549,8 +549,6 @@ int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
return -EINVAL; return -EINVAL;
if (!MLX5_CAP_GEN(mdev, vport_group_manager)) if (!MLX5_CAP_GEN(mdev, vport_group_manager))
return -EACCES; return -EACCES;
if (!MLX5_CAP_ESW(mdev, nic_vport_node_guid_modify))
return -EOPNOTSUPP;
in = kvzalloc(inlen, GFP_KERNEL); in = kvzalloc(inlen, GFP_KERNEL);
if (!in) if (!in)
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)
enum { enum {
SRIOV_NONE, SRIOV_NONE,
SRIOV_LEGACY, SRIOV_LEGACY,
......
...@@ -922,7 +922,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -922,7 +922,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 vnic_env_queue_counters[0x1]; u8 vnic_env_queue_counters[0x1];
u8 ets[0x1]; u8 ets[0x1];
u8 nic_flow_table[0x1]; u8 nic_flow_table[0x1];
u8 eswitch_flow_table[0x1]; u8 eswitch_manager[0x1];
u8 device_memory[0x1]; u8 device_memory[0x1];
u8 mcam_reg[0x1]; u8 mcam_reg[0x1];
u8 pcam_reg[0x1]; u8 pcam_reg[0x1];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment