Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/net/ethernet/mellanox/mlx5/core/sf/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  cmd.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
/* Copyright (c) 2020 Mellanox Technologies Ltd */

#include <linux/mlx5/driver.h>
#include "priv.h"

int mlx5_cmd_alloc_sf(struct mlx5_core_dev *dev, u16 function_id)
{
 u32 out[MLX5_ST_SZ_DW(alloc_sf_out)] = {};
 u32 in[MLX5_ST_SZ_DW(alloc_sf_in)] = {};

 MLX5_SET(alloc_sf_in, in, opcode, MLX5_CMD_OP_ALLOC_SF);
 MLX5_SET(alloc_sf_in, in, function_id, function_id);

 return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
}

int mlx5_cmd_dealloc_sf(struct mlx5_core_dev *dev, u16 function_id)
{
 u32 out[MLX5_ST_SZ_DW(dealloc_sf_out)] = {};
 u32 in[MLX5_ST_SZ_DW(dealloc_sf_in)] = {};

 MLX5_SET(dealloc_sf_in, in, opcode, MLX5_CMD_OP_DEALLOC_SF);
 MLX5_SET(dealloc_sf_in, in, function_id, function_id);

 return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
}

int mlx5_cmd_sf_enable_hca(struct mlx5_core_dev *dev, u16 func_id)
{
 u32 out[MLX5_ST_SZ_DW(enable_hca_out)] = {};
 u32 in[MLX5_ST_SZ_DW(enable_hca_in)] = {};

 MLX5_SET(enable_hca_in, in, opcode, MLX5_CMD_OP_ENABLE_HCA);
 MLX5_SET(enable_hca_in, in, function_id, func_id);
 MLX5_SET(enable_hca_in, in, embedded_cpu_function, 0);
 return mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
}

int mlx5_cmd_sf_disable_hca(struct mlx5_core_dev *dev, u16 func_id)
{
 u32 out[MLX5_ST_SZ_DW(disable_hca_out)] = {};
 u32 in[MLX5_ST_SZ_DW(disable_hca_in)] = {};

 MLX5_SET(disable_hca_in, in, opcode, MLX5_CMD_OP_DISABLE_HCA);
 MLX5_SET(disable_hca_in, in, function_id, func_id);
 MLX5_SET(enable_hca_in, in, embedded_cpu_function, 0);
 return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
}

Messung V0.5
C=98 H=90 G=94

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.