Commit 5600a410 authored by Jason Gunthorpe's avatar Jason Gunthorpe

Merge mlx5-next into rdma for-next

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

Required for dependencies in the next patches.

* mlx5-next:
  net/mlx5: Add rts2rts_qp_counters_set_id field in hca cap
  net/mlx5: Properly name the generic WQE control field
  net/mlx5: Introduce TLS TX offload hardware bits and structures
  net/mlx5: Refactor mlx5_esw_query_functions for modularity
  net/mlx5: E-Switch prepare functions change handler to be modular
  net/mlx5: Introduce and use mlx5_eswitch_get_total_vports()
parents bcde9a83 f8efee08
...@@ -29,7 +29,7 @@ mlx5_ib_set_vport_rep(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) ...@@ -29,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;
......
...@@ -1715,14 +1715,34 @@ static int eswitch_vport_event(struct notifier_block *nb, ...@@ -1715,14 +1715,34 @@ static int eswitch_vport_event(struct notifier_block *nb,
return NOTIFY_OK; return NOTIFY_OK;
} }
int mlx5_esw_query_functions(struct mlx5_core_dev *dev, u32 *out, int outlen) /**
* mlx5_esw_query_functions - Returns raw output about functions state
* @dev: Pointer to device to query
*
* mlx5_esw_query_functions() allocates and returns functions changed
* raw output memory pointer from device on success. Otherwise returns ERR_PTR.
* Caller must free the memory using kvfree() when valid pointer is returned.
*/
const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
{ {
int outlen = MLX5_ST_SZ_BYTES(query_esw_functions_out);
u32 in[MLX5_ST_SZ_DW(query_esw_functions_in)] = {}; u32 in[MLX5_ST_SZ_DW(query_esw_functions_in)] = {};
u32 *out;
int err;
out = kvzalloc(outlen, GFP_KERNEL);
if (!out)
return ERR_PTR(-ENOMEM);
MLX5_SET(query_esw_functions_in, in, opcode, MLX5_SET(query_esw_functions_in, in, opcode,
MLX5_CMD_OP_QUERY_ESW_FUNCTIONS); MLX5_CMD_OP_QUERY_ESW_FUNCTIONS);
return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen); err = mlx5_cmd_exec(dev, in, sizeof(in), out, outlen);
if (!err)
return out;
kvfree(out);
return ERR_PTR(err);
} }
static void mlx5_eswitch_event_handlers_register(struct mlx5_eswitch *esw) static void mlx5_eswitch_event_handlers_register(struct mlx5_eswitch *esw)
...@@ -1868,14 +1888,16 @@ void mlx5_eswitch_disable(struct mlx5_eswitch *esw) ...@@ -1868,14 +1888,16 @@ void mlx5_eswitch_disable(struct mlx5_eswitch *esw)
int mlx5_eswitch_init(struct mlx5_core_dev *dev) int mlx5_eswitch_init(struct mlx5_core_dev *dev)
{ {
int total_vports = MLX5_TOTAL_VPORTS(dev);
struct mlx5_eswitch *esw; struct mlx5_eswitch *esw;
struct mlx5_vport *vport; struct mlx5_vport *vport;
int total_vports;
int err, i; int err, i;
if (!MLX5_VPORT_MANAGER(dev)) if (!MLX5_VPORT_MANAGER(dev))
return 0; return 0;
total_vports = mlx5_eswitch_get_total_vports(dev);
esw_info(dev, esw_info(dev,
"Total vports %d, per vport: max uc(%d) max mc(%d)\n", "Total vports %d, per vport: max uc(%d) max mc(%d)\n",
total_vports, total_vports,
...@@ -2525,8 +2547,7 @@ bool mlx5_esw_multipath_prereq(struct mlx5_core_dev *dev0, ...@@ -2525,8 +2547,7 @@ bool mlx5_esw_multipath_prereq(struct mlx5_core_dev *dev0,
void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs)
{ {
u32 out[MLX5_ST_SZ_DW(query_esw_functions_out)] = {}; const u32 *out;
int err;
WARN_ON_ONCE(esw->mode != MLX5_ESWITCH_NONE); WARN_ON_ONCE(esw->mode != MLX5_ESWITCH_NONE);
...@@ -2535,8 +2556,11 @@ void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) ...@@ -2535,8 +2556,11 @@ void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs)
return; return;
} }
err = mlx5_esw_query_functions(esw->dev, out, sizeof(out)); out = mlx5_esw_query_functions(esw->dev);
if (!err) if (IS_ERR(out))
return;
esw->esw_funcs.num_vfs = MLX5_GET(query_esw_functions_out, out, esw->esw_funcs.num_vfs = MLX5_GET(query_esw_functions_out, out,
host_params_context.host_num_of_vfs); host_params_context.host_num_of_vfs);
kvfree(out);
} }
...@@ -403,7 +403,7 @@ bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, ...@@ -403,7 +403,7 @@ bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0,
bool mlx5_esw_multipath_prereq(struct mlx5_core_dev *dev0, bool mlx5_esw_multipath_prereq(struct mlx5_core_dev *dev0,
struct mlx5_core_dev *dev1); struct mlx5_core_dev *dev1);
int mlx5_esw_query_functions(struct mlx5_core_dev *dev, u32 *out, int outlen); const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev);
#define MLX5_DEBUG_ESWITCH_MASK BIT(3) #define MLX5_DEBUG_ESWITCH_MASK BIT(3)
...@@ -560,10 +560,9 @@ static inline int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int mode) { ret ...@@ -560,10 +560,9 @@ static inline int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int mode) { ret
static inline void mlx5_eswitch_disable(struct mlx5_eswitch *esw) {} static inline void mlx5_eswitch_disable(struct mlx5_eswitch *esw) {}
static inline bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1) { return true; } static inline bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1) { return true; }
static inline bool mlx5_eswitch_is_funcs_handler(struct mlx5_core_dev *dev) { return false; } static inline bool mlx5_eswitch_is_funcs_handler(struct mlx5_core_dev *dev) { return false; }
static inline int static inline const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
mlx5_esw_query_functions(struct mlx5_core_dev *dev, u32 *out, int outlen)
{ {
return -EOPNOTSUPP; return ERR_PTR(-EOPNOTSUPP);
} }
static inline void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) {} static inline void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) {}
......
...@@ -1395,7 +1395,7 @@ void esw_offloads_cleanup_reps(struct mlx5_eswitch *esw) ...@@ -1395,7 +1395,7 @@ void esw_offloads_cleanup_reps(struct mlx5_eswitch *esw)
int esw_offloads_init_reps(struct mlx5_eswitch *esw) int esw_offloads_init_reps(struct mlx5_eswitch *esw)
{ {
int total_vports = MLX5_TOTAL_VPORTS(esw->dev); int total_vports = esw->total_vports;
struct mlx5_core_dev *dev = esw->dev; struct mlx5_core_dev *dev = esw->dev;
struct mlx5_eswitch_rep *rep; struct mlx5_eswitch_rep *rep;
u8 hw_id[ETH_ALEN], rep_type; u8 hw_id[ETH_ALEN], rep_type;
...@@ -2047,38 +2047,48 @@ static void esw_offloads_steering_cleanup(struct mlx5_eswitch *esw) ...@@ -2047,38 +2047,48 @@ static void esw_offloads_steering_cleanup(struct mlx5_eswitch *esw)
esw_destroy_offloads_acl_tables(esw); esw_destroy_offloads_acl_tables(esw);
} }
static void esw_functions_changed_event_handler(struct work_struct *work) static void
esw_vfs_changed_event_handler(struct mlx5_eswitch *esw, const u32 *out)
{ {
u32 out[MLX5_ST_SZ_DW(query_esw_functions_out)] = {};
struct mlx5_host_work *host_work;
struct mlx5_eswitch *esw;
bool host_pf_disabled; bool host_pf_disabled;
u16 num_vfs = 0; u16 new_num_vfs;
int err;
host_work = container_of(work, struct mlx5_host_work, work);
esw = host_work->esw;
err = mlx5_esw_query_functions(esw->dev, out, sizeof(out)); new_num_vfs = MLX5_GET(query_esw_functions_out, out,
num_vfs = MLX5_GET(query_esw_functions_out, out,
host_params_context.host_num_of_vfs); host_params_context.host_num_of_vfs);
host_pf_disabled = MLX5_GET(query_esw_functions_out, out, host_pf_disabled = MLX5_GET(query_esw_functions_out, out,
host_params_context.host_pf_disabled); host_params_context.host_pf_disabled);
if (err || host_pf_disabled || num_vfs == esw->esw_funcs.num_vfs)
goto out; if (new_num_vfs == esw->esw_funcs.num_vfs || host_pf_disabled)
return;
/* Number of VFs can only change from "0 to x" or "x to 0". */ /* Number of VFs can only change from "0 to x" or "x to 0". */
if (esw->esw_funcs.num_vfs > 0) { if (esw->esw_funcs.num_vfs > 0) {
esw_offloads_unload_vf_reps(esw, esw->esw_funcs.num_vfs); esw_offloads_unload_vf_reps(esw, esw->esw_funcs.num_vfs);
} else { } else {
err = esw_offloads_load_vf_reps(esw, num_vfs); int err;
err = esw_offloads_load_vf_reps(esw, new_num_vfs);
if (err) if (err)
goto out; return;
} }
esw->esw_funcs.num_vfs = new_num_vfs;
}
static void esw_functions_changed_event_handler(struct work_struct *work)
{
struct mlx5_host_work *host_work;
struct mlx5_eswitch *esw;
const u32 *out;
host_work = container_of(work, struct mlx5_host_work, work);
esw = host_work->esw;
esw->esw_funcs.num_vfs = num_vfs; out = mlx5_esw_query_functions(esw->dev);
if (IS_ERR(out))
goto out;
esw_vfs_changed_event_handler(esw, out);
kvfree(out);
out: out:
kfree(host_work); kfree(host_work);
} }
......
...@@ -2092,7 +2092,7 @@ struct mlx5_flow_namespace *mlx5_get_flow_vport_acl_namespace(struct mlx5_core_d ...@@ -2092,7 +2092,7 @@ struct mlx5_flow_namespace *mlx5_get_flow_vport_acl_namespace(struct mlx5_core_d
{ {
struct mlx5_flow_steering *steering = dev->priv.steering; struct mlx5_flow_steering *steering = dev->priv.steering;
if (!steering || vport >= MLX5_TOTAL_VPORTS(dev)) if (!steering || vport >= mlx5_eswitch_get_total_vports(dev))
return NULL; return NULL;
switch (type) { switch (type) {
...@@ -2423,7 +2423,7 @@ static void cleanup_egress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2423,7 +2423,7 @@ static void cleanup_egress_acls_root_ns(struct mlx5_core_dev *dev)
if (!steering->esw_egress_root_ns) if (!steering->esw_egress_root_ns)
return; return;
for (i = 0; i < MLX5_TOTAL_VPORTS(dev); i++) for (i = 0; i < mlx5_eswitch_get_total_vports(dev); i++)
cleanup_root_ns(steering->esw_egress_root_ns[i]); cleanup_root_ns(steering->esw_egress_root_ns[i]);
kfree(steering->esw_egress_root_ns); kfree(steering->esw_egress_root_ns);
...@@ -2438,7 +2438,7 @@ static void cleanup_ingress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2438,7 +2438,7 @@ static void cleanup_ingress_acls_root_ns(struct mlx5_core_dev *dev)
if (!steering->esw_ingress_root_ns) if (!steering->esw_ingress_root_ns)
return; return;
for (i = 0; i < MLX5_TOTAL_VPORTS(dev); i++) for (i = 0; i < mlx5_eswitch_get_total_vports(dev); i++)
cleanup_root_ns(steering->esw_ingress_root_ns[i]); cleanup_root_ns(steering->esw_ingress_root_ns[i]);
kfree(steering->esw_ingress_root_ns); kfree(steering->esw_ingress_root_ns);
...@@ -2606,16 +2606,18 @@ static int init_ingress_acl_root_ns(struct mlx5_flow_steering *steering, int vpo ...@@ -2606,16 +2606,18 @@ static int init_ingress_acl_root_ns(struct mlx5_flow_steering *steering, int vpo
static int init_egress_acls_root_ns(struct mlx5_core_dev *dev) static int init_egress_acls_root_ns(struct mlx5_core_dev *dev)
{ {
struct mlx5_flow_steering *steering = dev->priv.steering; struct mlx5_flow_steering *steering = dev->priv.steering;
int total_vports = mlx5_eswitch_get_total_vports(dev);
int err; int err;
int i; int i;
steering->esw_egress_root_ns = kcalloc(MLX5_TOTAL_VPORTS(dev), steering->esw_egress_root_ns =
kcalloc(total_vports,
sizeof(*steering->esw_egress_root_ns), sizeof(*steering->esw_egress_root_ns),
GFP_KERNEL); GFP_KERNEL);
if (!steering->esw_egress_root_ns) if (!steering->esw_egress_root_ns)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < MLX5_TOTAL_VPORTS(dev); i++) { for (i = 0; i < total_vports; i++) {
err = init_egress_acl_root_ns(steering, i); err = init_egress_acl_root_ns(steering, i);
if (err) if (err)
goto cleanup_root_ns; goto cleanup_root_ns;
...@@ -2634,16 +2636,18 @@ static int init_egress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2634,16 +2636,18 @@ static int init_egress_acls_root_ns(struct mlx5_core_dev *dev)
static int init_ingress_acls_root_ns(struct mlx5_core_dev *dev) static int init_ingress_acls_root_ns(struct mlx5_core_dev *dev)
{ {
struct mlx5_flow_steering *steering = dev->priv.steering; struct mlx5_flow_steering *steering = dev->priv.steering;
int total_vports = mlx5_eswitch_get_total_vports(dev);
int err; int err;
int i; int i;
steering->esw_ingress_root_ns = kcalloc(MLX5_TOTAL_VPORTS(dev), steering->esw_ingress_root_ns =
kcalloc(total_vports,
sizeof(*steering->esw_ingress_root_ns), sizeof(*steering->esw_ingress_root_ns),
GFP_KERNEL); GFP_KERNEL);
if (!steering->esw_ingress_root_ns) if (!steering->esw_ingress_root_ns)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < MLX5_TOTAL_VPORTS(dev); i++) { for (i = 0; i < total_vports; i++) {
err = init_ingress_acl_root_ns(steering, i); err = init_ingress_acl_root_ns(steering, i);
if (err) if (err)
goto cleanup_root_ns; goto cleanup_root_ns;
......
...@@ -197,22 +197,25 @@ void mlx5_sriov_detach(struct mlx5_core_dev *dev) ...@@ -197,22 +197,25 @@ void mlx5_sriov_detach(struct mlx5_core_dev *dev)
static u16 mlx5_get_max_vfs(struct mlx5_core_dev *dev) static u16 mlx5_get_max_vfs(struct mlx5_core_dev *dev)
{ {
u32 out[MLX5_ST_SZ_DW(query_esw_functions_out)] = {};
u16 host_total_vfs; u16 host_total_vfs;
int err; const u32 *out;
if (mlx5_core_is_ecpf_esw_manager(dev)) { if (mlx5_core_is_ecpf_esw_manager(dev)) {
err = mlx5_esw_query_functions(dev, out, sizeof(out)); out = mlx5_esw_query_functions(dev);
host_total_vfs = MLX5_GET(query_esw_functions_out, out,
host_params_context.host_total_vfs);
/* Old FW doesn't support getting total_vfs from esw func /* Old FW doesn't support getting total_vfs from esw func
* but supports getting it from pci_sriov. * but supports getting it from pci_sriov.
*/ */
if (!err && host_total_vfs) if (IS_ERR(out))
goto done;
host_total_vfs = MLX5_GET(query_esw_functions_out, out,
host_params_context.host_total_vfs);
kvfree(out);
if (host_total_vfs)
return host_total_vfs; return host_total_vfs;
} }
done:
return pci_sriov_get_totalvfs(dev->pdev); return pci_sriov_get_totalvfs(dev->pdev);
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/mlx5/driver.h> #include <linux/mlx5/driver.h>
#include <linux/mlx5/vport.h> #include <linux/mlx5/vport.h>
#include <linux/mlx5/eswitch.h>
#include "mlx5_core.h" #include "mlx5_core.h"
/* Mutex to hold while enabling or disabling RoCE */ /* Mutex to hold while enabling or disabling RoCE */
...@@ -1165,3 +1166,17 @@ u64 mlx5_query_nic_system_image_guid(struct mlx5_core_dev *mdev) ...@@ -1165,3 +1166,17 @@ u64 mlx5_query_nic_system_image_guid(struct mlx5_core_dev *mdev)
return tmp; return tmp;
} }
EXPORT_SYMBOL_GPL(mlx5_query_nic_system_image_guid); EXPORT_SYMBOL_GPL(mlx5_query_nic_system_image_guid);
/**
* mlx5_eswitch_get_total_vports - Get total vports of the eswitch
*
* @dev: Pointer to core device
*
* mlx5_eswitch_get_total_vports returns total number of vports for
* the eswitch.
*/
u16 mlx5_eswitch_get_total_vports(const struct mlx5_core_dev *dev)
{
return MLX5_SPECIAL_VPORTS(dev) + mlx5_core_max_vfs(dev);
}
EXPORT_SYMBOL(mlx5_eswitch_get_total_vports);
...@@ -437,6 +437,7 @@ enum { ...@@ -437,6 +437,7 @@ enum {
MLX5_OPCODE_SET_PSV = 0x20, MLX5_OPCODE_SET_PSV = 0x20,
MLX5_OPCODE_GET_PSV = 0x21, MLX5_OPCODE_GET_PSV = 0x21,
MLX5_OPCODE_CHECK_PSV = 0x22, MLX5_OPCODE_CHECK_PSV = 0x22,
MLX5_OPCODE_DUMP = 0x23,
MLX5_OPCODE_RGET_PSV = 0x26, MLX5_OPCODE_RGET_PSV = 0x26,
MLX5_OPCODE_RCHECK_PSV = 0x27, MLX5_OPCODE_RCHECK_PSV = 0x27,
...@@ -444,6 +445,14 @@ enum { ...@@ -444,6 +445,14 @@ enum {
}; };
enum {
MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x20,
};
enum {
MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x20,
};
enum { enum {
MLX5_SET_PORT_RESET_QKEY = 0, MLX5_SET_PORT_RESET_QKEY = 0,
MLX5_SET_PORT_GUID0 = 16, MLX5_SET_PORT_GUID0 = 16,
...@@ -1077,6 +1086,8 @@ enum mlx5_cap_type { ...@@ -1077,6 +1086,8 @@ enum mlx5_cap_type {
MLX5_CAP_DEBUG, MLX5_CAP_DEBUG,
MLX5_CAP_RESERVED_14, MLX5_CAP_RESERVED_14,
MLX5_CAP_DEV_MEM, MLX5_CAP_DEV_MEM,
MLX5_CAP_RESERVED_16,
MLX5_CAP_TLS,
MLX5_CAP_DEV_EVENT = 0x14, MLX5_CAP_DEV_EVENT = 0x14,
/* NUM OF CAP Types */ /* NUM OF CAP Types */
MLX5_CAP_NUM MLX5_CAP_NUM
...@@ -1256,6 +1267,9 @@ enum mlx5_qcam_feature_groups { ...@@ -1256,6 +1267,9 @@ enum mlx5_qcam_feature_groups {
#define MLX5_CAP64_DEV_MEM(mdev, cap)\ #define MLX5_CAP64_DEV_MEM(mdev, cap)\
MLX5_GET64(device_mem_cap, mdev->caps.hca_cur[MLX5_CAP_DEV_MEM], cap) MLX5_GET64(device_mem_cap, mdev->caps.hca_cur[MLX5_CAP_DEV_MEM], cap)
#define MLX5_CAP_TLS(mdev, cap) \
MLX5_GET(tls_cap, (mdev)->caps.hca_cur[MLX5_CAP_TLS], cap)
#define MLX5_CAP_DEV_EVENT(mdev, cap)\ #define MLX5_CAP_DEV_EVENT(mdev, cap)\
MLX5_ADDR_OF(device_event_cap, (mdev)->caps.hca_cur[MLX5_CAP_DEV_EVENT], cap) MLX5_ADDR_OF(device_event_cap, (mdev)->caps.hca_cur[MLX5_CAP_DEV_EVENT], cap)
......
...@@ -1085,7 +1085,7 @@ enum { ...@@ -1085,7 +1085,7 @@ enum {
MLX5_PCI_DEV_IS_VF = 1 << 0, MLX5_PCI_DEV_IS_VF = 1 << 0,
}; };
static inline bool mlx5_core_is_pf(struct mlx5_core_dev *dev) static inline bool mlx5_core_is_pf(const struct mlx5_core_dev *dev)
{ {
return dev->coredev_type == MLX5_COREDEV_PF; return dev->coredev_type == MLX5_COREDEV_PF;
} }
...@@ -1095,17 +1095,18 @@ static inline bool mlx5_core_is_ecpf(struct mlx5_core_dev *dev) ...@@ -1095,17 +1095,18 @@ static inline bool mlx5_core_is_ecpf(struct mlx5_core_dev *dev)
return dev->caps.embedded_cpu; return dev->caps.embedded_cpu;
} }
static inline bool mlx5_core_is_ecpf_esw_manager(struct mlx5_core_dev *dev) static inline bool
mlx5_core_is_ecpf_esw_manager(const struct mlx5_core_dev *dev)
{ {
return dev->caps.embedded_cpu && MLX5_CAP_GEN(dev, eswitch_manager); return dev->caps.embedded_cpu && MLX5_CAP_GEN(dev, eswitch_manager);
} }
static inline bool mlx5_ecpf_vport_exists(struct mlx5_core_dev *dev) static inline bool mlx5_ecpf_vport_exists(const struct mlx5_core_dev *dev)
{ {
return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists); return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists);
} }
static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev) static inline u16 mlx5_core_max_vfs(const struct mlx5_core_dev *dev)
{ {
return dev->priv.sriov.max_vfs; return dev->priv.sriov.max_vfs;
} }
......
...@@ -66,6 +66,8 @@ struct mlx5_flow_handle * ...@@ -66,6 +66,8 @@ struct mlx5_flow_handle *
mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,
u16 vport_num, u32 sqn); u16 vport_num, u32 sqn);
u16 mlx5_eswitch_get_total_vports(const struct mlx5_core_dev *dev);
#ifdef CONFIG_MLX5_ESWITCH #ifdef CONFIG_MLX5_ESWITCH
enum devlink_eswitch_encap_mode enum devlink_eswitch_encap_mode
mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev); mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev);
...@@ -93,4 +95,5 @@ mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw, ...@@ -93,4 +95,5 @@ mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw,
return 0; return 0;
}; };
#endif /* CONFIG_MLX5_ESWITCH */ #endif /* CONFIG_MLX5_ESWITCH */
#endif #endif
...@@ -973,6 +973,16 @@ struct mlx5_ifc_vector_calc_cap_bits { ...@@ -973,6 +973,16 @@ struct mlx5_ifc_vector_calc_cap_bits {
u8 reserved_at_c0[0x720]; u8 reserved_at_c0[0x720];
}; };
struct mlx5_ifc_tls_cap_bits {
u8 tls_1_2_aes_gcm_128[0x1];
u8 tls_1_3_aes_gcm_128[0x1];
u8 tls_1_2_aes_gcm_256[0x1];
u8 tls_1_3_aes_gcm_256[0x1];
u8 reserved_at_4[0x1c];
u8 reserved_at_20[0x7e0];
};
enum { enum {
MLX5_WQ_TYPE_LINKED_LIST = 0x0, MLX5_WQ_TYPE_LINKED_LIST = 0x0,
MLX5_WQ_TYPE_CYCLIC = 0x1, MLX5_WQ_TYPE_CYCLIC = 0x1,
...@@ -1086,7 +1096,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -1086,7 +1096,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 cc_modify_allowed[0x1]; u8 cc_modify_allowed[0x1];
u8 start_pad[0x1]; u8 start_pad[0x1];
u8 cache_line_128byte[0x1]; u8 cache_line_128byte[0x1];
u8 reserved_at_165[0xa]; u8 reserved_at_165[0x4];
u8 rts2rts_qp_counters_set_id[0x1];
u8 reserved_at_16a[0x5];
u8 qcam_reg[0x1]; u8 qcam_reg[0x1];
u8 gid_table_size[0x10]; u8 gid_table_size[0x10];
...@@ -1303,7 +1315,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -1303,7 +1315,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 reserved_at_440[0x20]; u8 reserved_at_440[0x20];
u8 reserved_at_460[0x3]; u8 tls[0x1];
u8 reserved_at_461[0x2];
u8 log_max_uctx[0x5]; u8 log_max_uctx[0x5];
u8 reserved_at_468[0x3]; u8 reserved_at_468[0x3];
u8 log_max_umem[0x5]; u8 log_max_umem[0x5];
...@@ -1328,7 +1341,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { ...@@ -1328,7 +1341,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 max_geneve_tlv_option_data_len[0x5]; u8 max_geneve_tlv_option_data_len[0x5];
u8 reserved_at_570[0x10]; u8 reserved_at_570[0x10];
u8 reserved_at_580[0x3c]; u8 reserved_at_580[0x33];
u8 log_max_dek[0x5];
u8 reserved_at_5b8[0x4];
u8 mini_cqe_resp_stride_index[0x1]; u8 mini_cqe_resp_stride_index[0x1];
u8 cqe_128_always[0x1]; u8 cqe_128_always[0x1];
u8 cqe_compression_128[0x1]; u8 cqe_compression_128[0x1];
...@@ -2607,6 +2622,7 @@ union mlx5_ifc_hca_cap_union_bits { ...@@ -2607,6 +2622,7 @@ union mlx5_ifc_hca_cap_union_bits {
struct mlx5_ifc_qos_cap_bits qos_cap; struct mlx5_ifc_qos_cap_bits qos_cap;
struct mlx5_ifc_debug_cap_bits debug_cap; struct mlx5_ifc_debug_cap_bits debug_cap;
struct mlx5_ifc_fpga_cap_bits fpga_cap; struct mlx5_ifc_fpga_cap_bits fpga_cap;
struct mlx5_ifc_tls_cap_bits tls_cap;
u8 reserved_at_0[0x8000]; u8 reserved_at_0[0x8000];
}; };
...@@ -2746,7 +2762,8 @@ struct mlx5_ifc_traffic_counter_bits { ...@@ -2746,7 +2762,8 @@ struct mlx5_ifc_traffic_counter_bits {
struct mlx5_ifc_tisc_bits { struct mlx5_ifc_tisc_bits {
u8 strict_lag_tx_port_affinity[0x1]; u8 strict_lag_tx_port_affinity[0x1];
u8 reserved_at_1[0x3]; u8 tls_en[0x1];
u8 reserved_at_1[0x2];
u8 lag_tx_port_affinity[0x04]; u8 lag_tx_port_affinity[0x04];
u8 reserved_at_8[0x4]; u8 reserved_at_8[0x4];
...@@ -2760,7 +2777,11 @@ struct mlx5_ifc_tisc_bits { ...@@ -2760,7 +2777,11 @@ struct mlx5_ifc_tisc_bits {
u8 reserved_at_140[0x8]; u8 reserved_at_140[0x8];
u8 underlay_qpn[0x18]; u8 underlay_qpn[0x18];
u8 reserved_at_160[0x3a0];
u8 reserved_at_160[0x8];
u8 pd[0x18];
u8 reserved_at_180[0x380];
}; };
enum { enum {
...@@ -9965,4 +9986,81 @@ struct mlx5_ifc_affiliated_event_header_bits { ...@@ -9965,4 +9986,81 @@ struct mlx5_ifc_affiliated_event_header_bits {
u8 obj_id[0x20]; u8 obj_id[0x20];
}; };
enum {
MLX5_HCA_CAP_GENERAL_OBJECT_TYPES_ENCRYPTION_KEY = BIT(0xc),
};
enum {
MLX5_GENERAL_OBJECT_TYPES_ENCRYPTION_KEY = 0xc,
};
struct mlx5_ifc_encryption_key_obj_bits {
u8 modify_field_select[0x40];
u8 reserved_at_40[0x14];
u8 key_size[0x4];
u8 reserved_at_58[0x4];
u8 key_type[0x4];
u8 reserved_at_60[0x8];
u8 pd[0x18];
u8 reserved_at_80[0x180];
u8 key[8][0x20];
u8 reserved_at_300[0x500];
};
struct mlx5_ifc_create_encryption_key_in_bits {
struct mlx5_ifc_general_obj_in_cmd_hdr_bits general_obj_in_cmd_hdr;
struct mlx5_ifc_encryption_key_obj_bits encryption_key_object;
};
enum {
MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_KEY_SIZE_128 = 0x0,
MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_KEY_SIZE_256 = 0x1,
};
enum {
MLX5_GENERAL_OBJECT_TYPE_ENCRYPTION_KEY_TYPE_DEK = 0x1,
};
struct mlx5_ifc_tls_static_params_bits {
u8 const_2[0x2];
u8 tls_version[0x4];
u8 const_1[0x2];
u8 reserved_at_8[0x14];
u8 encryption_standard[0x4];
u8 reserved_at_20[0x20];
u8 initial_record_number[0x40];
u8 resync_tcp_sn[0x20];
u8 gcm_iv[0x20];
u8 implicit_iv[0x40];
u8 reserved_at_100[0x8];
u8 dek_index[0x18];
u8 reserved_at_120[0xe0];
};
struct mlx5_ifc_tls_progress_params_bits {
u8 valid[0x1];
u8 reserved_at_1[0x7];
u8 pd[0x18];
u8 next_record_tcp_sn[0x20];
u8 hw_resync_tcp_sn[0x20];
u8 record_tracker_state[0x2];
u8 auth_state[0x2];
u8 reserved_at_64[0x4];
u8 hw_offset_record_number[0x18];
};
#endif /* MLX5_IFC_H */ #endif /* MLX5_IFC_H */
...@@ -203,7 +203,12 @@ struct mlx5_wqe_ctrl_seg { ...@@ -203,7 +203,12 @@ struct mlx5_wqe_ctrl_seg {
u8 signature; u8 signature;
u8 rsvd[2]; u8 rsvd[2];
u8 fm_ce_se; u8 fm_ce_se;
union {
__be32 general_id;
__be32 imm; __be32 imm;
__be32 umr_mkey;
__be32 tisn;
};
}; };
#define MLX5_WQE_CTRL_DS_MASK 0x3f #define MLX5_WQE_CTRL_DS_MASK 0x3f
......
...@@ -44,9 +44,6 @@ ...@@ -44,9 +44,6 @@
MLX5_VPORT_UPLINK_PLACEHOLDER + \ MLX5_VPORT_UPLINK_PLACEHOLDER + \
MLX5_VPORT_ECPF_PLACEHOLDER(mdev)) MLX5_VPORT_ECPF_PLACEHOLDER(mdev))
#define MLX5_TOTAL_VPORTS(mdev) (MLX5_SPECIAL_VPORTS(mdev) + \
mlx5_core_max_vfs(mdev))
#define MLX5_VPORT_MANAGER(mdev) \ #define MLX5_VPORT_MANAGER(mdev) \
(MLX5_CAP_GEN(mdev, vport_group_manager) && \ (MLX5_CAP_GEN(mdev, vport_group_manager) && \
(MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \ (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \
......
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