Commit 31a0956e authored by Leon Romanovsky's avatar Leon Romanovsky

net/mlx5: Update fs_core new cmd interface

Do mass update of fs_core to reuse newly introduced
mlx5_cmd_exec_in*() interfaces.
Reviewed-by: default avatarMoshe Shemesh <moshe@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent b316e186
...@@ -155,8 +155,7 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns, ...@@ -155,8 +155,7 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_table *ft, u32 underlay_qpn, struct mlx5_flow_table *ft, u32 underlay_qpn,
bool disconnect) bool disconnect)
{ {
u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)] = {0}; u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)] = {};
u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)] = {0};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
if ((MLX5_CAP_GEN(dev, port_type) == MLX5_CAP_PORT_TYPE_IB) && if ((MLX5_CAP_GEN(dev, port_type) == MLX5_CAP_PORT_TYPE_IB) &&
...@@ -167,13 +166,10 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns, ...@@ -167,13 +166,10 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns,
MLX5_CMD_OP_SET_FLOW_TABLE_ROOT); MLX5_CMD_OP_SET_FLOW_TABLE_ROOT);
MLX5_SET(set_flow_table_root_in, in, table_type, ft->type); MLX5_SET(set_flow_table_root_in, in, table_type, ft->type);
if (disconnect) { if (disconnect)
MLX5_SET(set_flow_table_root_in, in, op_mod, 1); MLX5_SET(set_flow_table_root_in, in, op_mod, 1);
MLX5_SET(set_flow_table_root_in, in, table_id, 0); else
} else {
MLX5_SET(set_flow_table_root_in, in, op_mod, 0);
MLX5_SET(set_flow_table_root_in, in, table_id, ft->id); MLX5_SET(set_flow_table_root_in, in, table_id, ft->id);
}
MLX5_SET(set_flow_table_root_in, in, underlay_qpn, underlay_qpn); MLX5_SET(set_flow_table_root_in, in, underlay_qpn, underlay_qpn);
if (ft->vport) { if (ft->vport) {
...@@ -181,7 +177,7 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns, ...@@ -181,7 +177,7 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns,
MLX5_SET(set_flow_table_root_in, in, other_vport, 1); MLX5_SET(set_flow_table_root_in, in, other_vport, 1);
} }
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); return mlx5_cmd_exec_in(dev, set_flow_table_root, in);
} }
static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns, static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns,
...@@ -192,8 +188,8 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns, ...@@ -192,8 +188,8 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns,
int en_encap = !!(ft->flags & MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT); int en_encap = !!(ft->flags & MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT);
int en_decap = !!(ft->flags & MLX5_FLOW_TABLE_TUNNEL_EN_DECAP); int en_decap = !!(ft->flags & MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
int term = !!(ft->flags & MLX5_FLOW_TABLE_TERMINATION); int term = !!(ft->flags & MLX5_FLOW_TABLE_TERMINATION);
u32 out[MLX5_ST_SZ_DW(create_flow_table_out)] = {0}; u32 out[MLX5_ST_SZ_DW(create_flow_table_out)] = {};
u32 in[MLX5_ST_SZ_DW(create_flow_table_in)] = {0}; u32 in[MLX5_ST_SZ_DW(create_flow_table_in)] = {};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
int err; int err;
...@@ -239,7 +235,7 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns, ...@@ -239,7 +235,7 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns,
break; break;
} }
err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); err = mlx5_cmd_exec_inout(dev, create_flow_table, in, out);
if (!err) if (!err)
ft->id = MLX5_GET(create_flow_table_out, out, ft->id = MLX5_GET(create_flow_table_out, out,
table_id); table_id);
...@@ -249,8 +245,7 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns, ...@@ -249,8 +245,7 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns,
static int mlx5_cmd_destroy_flow_table(struct mlx5_flow_root_namespace *ns, static int mlx5_cmd_destroy_flow_table(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_table *ft) struct mlx5_flow_table *ft)
{ {
u32 in[MLX5_ST_SZ_DW(destroy_flow_table_in)] = {0}; u32 in[MLX5_ST_SZ_DW(destroy_flow_table_in)] = {};
u32 out[MLX5_ST_SZ_DW(destroy_flow_table_out)] = {0};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
MLX5_SET(destroy_flow_table_in, in, opcode, MLX5_SET(destroy_flow_table_in, in, opcode,
...@@ -262,15 +257,14 @@ static int mlx5_cmd_destroy_flow_table(struct mlx5_flow_root_namespace *ns, ...@@ -262,15 +257,14 @@ static int mlx5_cmd_destroy_flow_table(struct mlx5_flow_root_namespace *ns,
MLX5_SET(destroy_flow_table_in, in, other_vport, 1); MLX5_SET(destroy_flow_table_in, in, other_vport, 1);
} }
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); return mlx5_cmd_exec_in(dev, destroy_flow_table, in);
} }
static int mlx5_cmd_modify_flow_table(struct mlx5_flow_root_namespace *ns, static int mlx5_cmd_modify_flow_table(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_table *ft, struct mlx5_flow_table *ft,
struct mlx5_flow_table *next_ft) struct mlx5_flow_table *next_ft)
{ {
u32 in[MLX5_ST_SZ_DW(modify_flow_table_in)] = {0}; u32 in[MLX5_ST_SZ_DW(modify_flow_table_in)] = {};
u32 out[MLX5_ST_SZ_DW(modify_flow_table_out)] = {0};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
MLX5_SET(modify_flow_table_in, in, opcode, MLX5_SET(modify_flow_table_in, in, opcode,
...@@ -310,7 +304,7 @@ static int mlx5_cmd_modify_flow_table(struct mlx5_flow_root_namespace *ns, ...@@ -310,7 +304,7 @@ static int mlx5_cmd_modify_flow_table(struct mlx5_flow_root_namespace *ns,
} }
} }
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); return mlx5_cmd_exec_in(dev, modify_flow_table, in);
} }
static int mlx5_cmd_create_flow_group(struct mlx5_flow_root_namespace *ns, static int mlx5_cmd_create_flow_group(struct mlx5_flow_root_namespace *ns,
...@@ -318,8 +312,7 @@ static int mlx5_cmd_create_flow_group(struct mlx5_flow_root_namespace *ns, ...@@ -318,8 +312,7 @@ static int mlx5_cmd_create_flow_group(struct mlx5_flow_root_namespace *ns,
u32 *in, u32 *in,
struct mlx5_flow_group *fg) struct mlx5_flow_group *fg)
{ {
u32 out[MLX5_ST_SZ_DW(create_flow_group_out)] = {0}; u32 out[MLX5_ST_SZ_DW(create_flow_group_out)] = {};
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
int err; int err;
...@@ -332,7 +325,7 @@ static int mlx5_cmd_create_flow_group(struct mlx5_flow_root_namespace *ns, ...@@ -332,7 +325,7 @@ static int mlx5_cmd_create_flow_group(struct mlx5_flow_root_namespace *ns,
MLX5_SET(create_flow_group_in, in, other_vport, 1); MLX5_SET(create_flow_group_in, in, other_vport, 1);
} }
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); err = mlx5_cmd_exec_inout(dev, create_flow_group, in, out);
if (!err) if (!err)
fg->id = MLX5_GET(create_flow_group_out, out, fg->id = MLX5_GET(create_flow_group_out, out,
group_id); group_id);
...@@ -343,8 +336,7 @@ static int mlx5_cmd_destroy_flow_group(struct mlx5_flow_root_namespace *ns, ...@@ -343,8 +336,7 @@ static int mlx5_cmd_destroy_flow_group(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_table *ft, struct mlx5_flow_table *ft,
struct mlx5_flow_group *fg) struct mlx5_flow_group *fg)
{ {
u32 out[MLX5_ST_SZ_DW(destroy_flow_group_out)] = {0}; u32 in[MLX5_ST_SZ_DW(destroy_flow_group_in)] = {};
u32 in[MLX5_ST_SZ_DW(destroy_flow_group_in)] = {0};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
MLX5_SET(destroy_flow_group_in, in, opcode, MLX5_SET(destroy_flow_group_in, in, opcode,
...@@ -357,7 +349,7 @@ static int mlx5_cmd_destroy_flow_group(struct mlx5_flow_root_namespace *ns, ...@@ -357,7 +349,7 @@ static int mlx5_cmd_destroy_flow_group(struct mlx5_flow_root_namespace *ns,
MLX5_SET(destroy_flow_group_in, in, other_vport, 1); MLX5_SET(destroy_flow_group_in, in, other_vport, 1);
} }
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); return mlx5_cmd_exec_in(dev, destroy_flow_group, in);
} }
static int mlx5_set_extended_dest(struct mlx5_core_dev *dev, static int mlx5_set_extended_dest(struct mlx5_core_dev *dev,
...@@ -600,8 +592,7 @@ static int mlx5_cmd_delete_fte(struct mlx5_flow_root_namespace *ns, ...@@ -600,8 +592,7 @@ static int mlx5_cmd_delete_fte(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_table *ft, struct mlx5_flow_table *ft,
struct fs_fte *fte) struct fs_fte *fte)
{ {
u32 out[MLX5_ST_SZ_DW(delete_fte_out)] = {0}; u32 in[MLX5_ST_SZ_DW(delete_fte_in)] = {};
u32 in[MLX5_ST_SZ_DW(delete_fte_in)] = {0};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
MLX5_SET(delete_fte_in, in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY); MLX5_SET(delete_fte_in, in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY);
...@@ -613,22 +604,22 @@ static int mlx5_cmd_delete_fte(struct mlx5_flow_root_namespace *ns, ...@@ -613,22 +604,22 @@ static int mlx5_cmd_delete_fte(struct mlx5_flow_root_namespace *ns,
MLX5_SET(delete_fte_in, in, other_vport, 1); MLX5_SET(delete_fte_in, in, other_vport, 1);
} }
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); return mlx5_cmd_exec_in(dev, delete_fte, in);
} }
int mlx5_cmd_fc_bulk_alloc(struct mlx5_core_dev *dev, int mlx5_cmd_fc_bulk_alloc(struct mlx5_core_dev *dev,
enum mlx5_fc_bulk_alloc_bitmask alloc_bitmask, enum mlx5_fc_bulk_alloc_bitmask alloc_bitmask,
u32 *id) u32 *id)
{ {
u32 in[MLX5_ST_SZ_DW(alloc_flow_counter_in)] = {0}; u32 out[MLX5_ST_SZ_DW(alloc_flow_counter_out)] = {};
u32 out[MLX5_ST_SZ_DW(alloc_flow_counter_out)] = {0}; u32 in[MLX5_ST_SZ_DW(alloc_flow_counter_in)] = {};
int err; int err;
MLX5_SET(alloc_flow_counter_in, in, opcode, MLX5_SET(alloc_flow_counter_in, in, opcode,
MLX5_CMD_OP_ALLOC_FLOW_COUNTER); MLX5_CMD_OP_ALLOC_FLOW_COUNTER);
MLX5_SET(alloc_flow_counter_in, in, flow_counter_bulk, alloc_bitmask); MLX5_SET(alloc_flow_counter_in, in, flow_counter_bulk, alloc_bitmask);
err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); err = mlx5_cmd_exec_inout(dev, alloc_flow_counter, in, out);
if (!err) if (!err)
*id = MLX5_GET(alloc_flow_counter_out, out, flow_counter_id); *id = MLX5_GET(alloc_flow_counter_out, out, flow_counter_id);
return err; return err;
...@@ -641,21 +632,20 @@ int mlx5_cmd_fc_alloc(struct mlx5_core_dev *dev, u32 *id) ...@@ -641,21 +632,20 @@ int mlx5_cmd_fc_alloc(struct mlx5_core_dev *dev, u32 *id)
int mlx5_cmd_fc_free(struct mlx5_core_dev *dev, u32 id) int mlx5_cmd_fc_free(struct mlx5_core_dev *dev, u32 id)
{ {
u32 in[MLX5_ST_SZ_DW(dealloc_flow_counter_in)] = {0}; u32 in[MLX5_ST_SZ_DW(dealloc_flow_counter_in)] = {};
u32 out[MLX5_ST_SZ_DW(dealloc_flow_counter_out)] = {0};
MLX5_SET(dealloc_flow_counter_in, in, opcode, MLX5_SET(dealloc_flow_counter_in, in, opcode,
MLX5_CMD_OP_DEALLOC_FLOW_COUNTER); MLX5_CMD_OP_DEALLOC_FLOW_COUNTER);
MLX5_SET(dealloc_flow_counter_in, in, flow_counter_id, id); MLX5_SET(dealloc_flow_counter_in, in, flow_counter_id, id);
return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); return mlx5_cmd_exec_in(dev, dealloc_flow_counter, in);
} }
int mlx5_cmd_fc_query(struct mlx5_core_dev *dev, u32 id, int mlx5_cmd_fc_query(struct mlx5_core_dev *dev, u32 id,
u64 *packets, u64 *bytes) u64 *packets, u64 *bytes)
{ {
u32 out[MLX5_ST_SZ_BYTES(query_flow_counter_out) + u32 out[MLX5_ST_SZ_BYTES(query_flow_counter_out) +
MLX5_ST_SZ_BYTES(traffic_counter)] = {0}; MLX5_ST_SZ_BYTES(traffic_counter)] = {};
u32 in[MLX5_ST_SZ_DW(query_flow_counter_in)] = {0}; u32 in[MLX5_ST_SZ_DW(query_flow_counter_in)] = {};
void *stats; void *stats;
int err = 0; int err = 0;
...@@ -683,11 +673,10 @@ int mlx5_cmd_fc_bulk_query(struct mlx5_core_dev *dev, u32 base_id, int bulk_len, ...@@ -683,11 +673,10 @@ int mlx5_cmd_fc_bulk_query(struct mlx5_core_dev *dev, u32 base_id, int bulk_len,
u32 *out) u32 *out)
{ {
int outlen = mlx5_cmd_fc_get_bulk_query_out_len(bulk_len); int outlen = mlx5_cmd_fc_get_bulk_query_out_len(bulk_len);
u32 in[MLX5_ST_SZ_DW(query_flow_counter_in)] = {0}; u32 in[MLX5_ST_SZ_DW(query_flow_counter_in)] = {};
MLX5_SET(query_flow_counter_in, in, opcode, MLX5_SET(query_flow_counter_in, in, opcode,
MLX5_CMD_OP_QUERY_FLOW_COUNTER); MLX5_CMD_OP_QUERY_FLOW_COUNTER);
MLX5_SET(query_flow_counter_in, in, op_mod, 0);
MLX5_SET(query_flow_counter_in, in, flow_counter_id, base_id); MLX5_SET(query_flow_counter_in, in, flow_counter_id, base_id);
MLX5_SET(query_flow_counter_in, in, num_of_counters, bulk_len); MLX5_SET(query_flow_counter_in, in, num_of_counters, bulk_len);
return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen); return mlx5_cmd_exec(dev, in, sizeof(in), out, outlen);
...@@ -700,7 +689,7 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -700,7 +689,7 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
enum mlx5_flow_namespace_type namespace, enum mlx5_flow_namespace_type namespace,
struct mlx5_pkt_reformat *pkt_reformat) struct mlx5_pkt_reformat *pkt_reformat)
{ {
u32 out[MLX5_ST_SZ_DW(alloc_packet_reformat_context_out)]; u32 out[MLX5_ST_SZ_DW(alloc_packet_reformat_context_out)] = {};
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
void *packet_reformat_context_in; void *packet_reformat_context_in;
int max_encap_size; int max_encap_size;
...@@ -732,7 +721,6 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -732,7 +721,6 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
reformat_data); reformat_data);
inlen = reformat - (void *)in + size; inlen = reformat - (void *)in + size;
memset(in, 0, inlen);
MLX5_SET(alloc_packet_reformat_context_in, in, opcode, MLX5_SET(alloc_packet_reformat_context_in, in, opcode,
MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT); MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT);
MLX5_SET(packet_reformat_context_in, packet_reformat_context_in, MLX5_SET(packet_reformat_context_in, packet_reformat_context_in,
...@@ -741,7 +729,6 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -741,7 +729,6 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
reformat_type, reformat_type); reformat_type, reformat_type);
memcpy(reformat, reformat_data, size); memcpy(reformat, reformat_data, size);
memset(out, 0, sizeof(out));
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
pkt_reformat->id = MLX5_GET(alloc_packet_reformat_context_out, pkt_reformat->id = MLX5_GET(alloc_packet_reformat_context_out,
...@@ -753,17 +740,15 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -753,17 +740,15 @@ static int mlx5_cmd_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
static void mlx5_cmd_packet_reformat_dealloc(struct mlx5_flow_root_namespace *ns, static void mlx5_cmd_packet_reformat_dealloc(struct mlx5_flow_root_namespace *ns,
struct mlx5_pkt_reformat *pkt_reformat) struct mlx5_pkt_reformat *pkt_reformat)
{ {
u32 in[MLX5_ST_SZ_DW(dealloc_packet_reformat_context_in)]; u32 in[MLX5_ST_SZ_DW(dealloc_packet_reformat_context_in)] = {};
u32 out[MLX5_ST_SZ_DW(dealloc_packet_reformat_context_out)];
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
memset(in, 0, sizeof(in));
MLX5_SET(dealloc_packet_reformat_context_in, in, opcode, MLX5_SET(dealloc_packet_reformat_context_in, in, opcode,
MLX5_CMD_OP_DEALLOC_PACKET_REFORMAT_CONTEXT); MLX5_CMD_OP_DEALLOC_PACKET_REFORMAT_CONTEXT);
MLX5_SET(dealloc_packet_reformat_context_in, in, packet_reformat_id, MLX5_SET(dealloc_packet_reformat_context_in, in, packet_reformat_id,
pkt_reformat->id); pkt_reformat->id);
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); mlx5_cmd_exec_in(dev, dealloc_packet_reformat_context, in);
} }
static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns, static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
...@@ -771,7 +756,7 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -771,7 +756,7 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
void *modify_actions, void *modify_actions,
struct mlx5_modify_hdr *modify_hdr) struct mlx5_modify_hdr *modify_hdr)
{ {
u32 out[MLX5_ST_SZ_DW(alloc_modify_header_context_out)]; u32 out[MLX5_ST_SZ_DW(alloc_modify_header_context_out)] = {};
int max_actions, actions_size, inlen, err; int max_actions, actions_size, inlen, err;
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
void *actions_in; void *actions_in;
...@@ -821,7 +806,6 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -821,7 +806,6 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
actions_in = MLX5_ADDR_OF(alloc_modify_header_context_in, in, actions); actions_in = MLX5_ADDR_OF(alloc_modify_header_context_in, in, actions);
memcpy(actions_in, modify_actions, actions_size); memcpy(actions_in, modify_actions, actions_size);
memset(out, 0, sizeof(out));
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
modify_hdr->id = MLX5_GET(alloc_modify_header_context_out, out, modify_header_id); modify_hdr->id = MLX5_GET(alloc_modify_header_context_out, out, modify_header_id);
...@@ -832,17 +816,15 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns, ...@@ -832,17 +816,15 @@ static int mlx5_cmd_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
static void mlx5_cmd_modify_header_dealloc(struct mlx5_flow_root_namespace *ns, static void mlx5_cmd_modify_header_dealloc(struct mlx5_flow_root_namespace *ns,
struct mlx5_modify_hdr *modify_hdr) struct mlx5_modify_hdr *modify_hdr)
{ {
u32 in[MLX5_ST_SZ_DW(dealloc_modify_header_context_in)]; u32 in[MLX5_ST_SZ_DW(dealloc_modify_header_context_in)] = {};
u32 out[MLX5_ST_SZ_DW(dealloc_modify_header_context_out)];
struct mlx5_core_dev *dev = ns->dev; struct mlx5_core_dev *dev = ns->dev;
memset(in, 0, sizeof(in));
MLX5_SET(dealloc_modify_header_context_in, in, opcode, MLX5_SET(dealloc_modify_header_context_in, in, opcode,
MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT); MLX5_CMD_OP_DEALLOC_MODIFY_HEADER_CONTEXT);
MLX5_SET(dealloc_modify_header_context_in, in, modify_header_id, MLX5_SET(dealloc_modify_header_context_in, in, modify_header_id,
modify_hdr->id); modify_hdr->id);
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); mlx5_cmd_exec_in(dev, dealloc_modify_header_context, in);
} }
static const struct mlx5_flow_cmds mlx5_flow_cmds = { static const struct mlx5_flow_cmds mlx5_flow_cmds = {
......
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