MLX5_SET(general_obj_in_cmd_hdr, in, opcode, MLX5_CMD_OP_DESTROY_GENERAL_OBJECT);
MLX5_SET(general_obj_in_cmd_hdr, in, obj_type, MLX5_OBJ_TYPE_GENEVE_TLV_OPT);
MLX5_SET(general_obj_in_cmd_hdr, in, obj_id, obj_id);
mlx5_cmd_exec(mdev, in, sizeof(in), out, sizeof(out));
}
int mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt)
{ int res = 0;
if (IS_ERR_OR_NULL(geneve)) return -EOPNOTSUPP;
mutex_lock(&geneve->sync_lock);
if (geneve->refcount) { if (geneve->opt_class == opt->opt_class &&
geneve->opt_type == opt->type) { /* We already have TLV options obj allocated */
geneve->refcount++;
} else { /* TLV options obj allocated, but its params * do not match the new request. * We support only one such object.
*/
mlx5_core_warn(geneve->mdev, "Won't create Geneve TLV opt object with class:type:len = 0x%x:0x%x:%d (another class:type already exists)\n",
be16_to_cpu(opt->opt_class),
opt->type,
opt->length);
res = -EOPNOTSUPP; goto unlock;
}
} else { /* We don't have any TLV options obj allocated */
void mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve)
{ if (IS_ERR_OR_NULL(geneve)) return;
mutex_lock(&geneve->sync_lock); if (--geneve->refcount == 0) { /* We've just removed the last user of Geneve option. * Now delete the object in FW.
*/
mlx5_geneve_tlv_option_destroy(geneve->mdev, geneve->obj_id);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.