summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/mlx5io.4 3.html
blob: bac13d1cbc40f47a3a7f720ee39db01db926a2b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<table class="head">
  <tr>
    <td class="head-ltitle">mlx5io(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">mlx5io(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">mlx5io</code> &#x2014; <span class="Nd">IOCTL
    interface to manage Connect-X 4/5/6 Mellanox network adapters</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">dev/mlx5/mlx5io.h</a>&gt;</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">mlx5io</code> interface is provided for
    management of the Connect-X4, 5 and 6 network adapters in the aspects not
    covered by the generic network configuration, mostly related to the PCIe
    attachment and internal card working. Interface consists of the commands,
    which are passed by means of <a class="Xr">ioctl(2)</a> on the file
    descriptor, opened from the <span class="Pa">/dev/mlx5ctl</span> device
    node.</p>
<p class="Pp">The following commands are implemented:</p>
<dl class="Bl-tag">
  <dt id="MLX5_FWDUMP_FORCE"><a class="permalink" href="#MLX5_FWDUMP_FORCE"><code class="Dv">MLX5_FWDUMP_FORCE</code></a></dt>
  <dd>Take the snapshot of the firmware registers state and store it in the
      kernel buffer. The buffer must be empty, in other words, no dumps should
      be written so far, or existing dump cleared with the
      <code class="Dv">MLX5_FWDUMP_RESET</code> command for the specified
      device. The argument for the command should point to the
      <var class="Vt">struct mlx5_tool_addr</var> structure, containing the PCIe
      bus address of the device.
    <div class="Bd Pp Li">
    <pre>struct mlx5_tool_addr {
	uint32_t domain;
	uint8_t bus;
	uint8_t slot;
	uint8_t func;
};</pre>
    </div>
  </dd>
  <dt id="MLX5_FWDUMP_RESET"><a class="permalink" href="#MLX5_FWDUMP_RESET"><code class="Dv">MLX5_FWDUMP_RESET</code></a></dt>
  <dd>Clear the stored firmware dump, preparing the kernel buffer for the next
      dump. The argument for the command should point to the
      <var class="Vt">struct mlx5_tool_addr</var> structure, containing the PCIe
      bus address of the device.</dd>
  <dt id="MLX5_FWDUMP_GET"><a class="permalink" href="#MLX5_FWDUMP_GET"><code class="Dv">MLX5_FWDUMP_GET</code></a></dt>
  <dd>Fetch the stored firmware dump into the user memory. The argument to the
      command should point to the input/output <var class="Vt">struct
      mlx5_fwdump_get</var> structure. Its <code class="Dv">devaddr</code> field
      specifies the address of the device, the <code class="Dv">buf</code>
      fields points to the array of <var class="Vt">struct mlx5_fwdump_reg</var>
      of records of the registers values, the size of the array is specified in
      the <code class="Dv">reg_cnt</code> field.
    <div class="Bd Pp Li">
    <pre>struct mlx5_fwdump_get {
	struct mlx5_tool_addr devaddr;
	struct mlx5_fwdump_reg *buf;
	size_t reg_cnt;
	size_t reg_filled; /* out */
};</pre>
    </div>
    <p class="Pp">On successful return, the <code class="Dv">reg_filled</code>
        field reports the number of the <code class="Dv">buf</code> array
        elements actually filled with the registers values. If
        <code class="Dv">buf</code> contains the <code class="Dv">NULL</code>
        pointer, no registers are filled, but <code class="Dv">reg_filled</code>
        still contains the number of registers that should be passed for the
        complete dump.</p>
    <p class="Pp">The <var class="Vt">struct mlx5_fwdump_reg</var> element
        contains the address of the register in the field
        <code class="Dv">addr</code>, and its value in the field
        <code class="Dv">val</code>.</p>
    <div class="Bd Pp Li">
    <pre>struct mlx5_fwdump_reg {
	uint32_t addr;
	uint32_t val;
};</pre>
    </div>
  </dd>
  <dt id="MLX5_FW_UPDATE"><a class="permalink" href="#MLX5_FW_UPDATE"><code class="Dv">MLX5_FW_UPDATE</code></a></dt>
  <dd>Requests firmware update (flash) on the adapter specified by the
      <code class="Dv">devaddr</code> using the firmware image in
      <code class="Dv">MFA2</code> format. The argument for the ioctl command is
      the <var class="Vt">struct mlx5_fw_update</var> with the following
      definition.
    <div class="Bd Pp Li">
    <pre>struct mlx5_fw_update {
	struct mlx5_tool_addr devaddr;
	void *img_fw_data;
	size_t img_fw_data_len;
};</pre>
    </div>
    Image address in memory is passed in <code class="Dv">img_fw_data</code>,
      the length of the image is specified in
      <code class="Dv">img_fw_data_len</code> field.</dd>
  <dt id="MLX5_FW_RESET"><a class="permalink" href="#MLX5_FW_RESET"><code class="Dv">MLX5_FW_RESET</code></a></dt>
  <dd>Requests PCIe link-level reset on the device. The address of the device is
      specified by the <var class="Vt">struct mlx5_tool_addr</var> structure,
      which should be passed as an argument.</dd>
  <dt id="MLX5_EEPROM_GET"><a class="permalink" href="#MLX5_EEPROM_GET"><code class="Dv">MLX5_EEPROM_GET</code></a></dt>
  <dd>Fetch EEPROM information. The argument to the command should point to the
      input/output <var class="Vt">struct mlx5_eeprom_get</var> structure where,
      the <code class="Dv">devaddr</code> field specifies the address of the
      device.
    <div class="Bd Pp Li">
    <pre>struct mlx5_eeprom_get {
        struct mlx5_tool_addr devaddr;
        size_t eeprom_info_page_valid;
        uint32_t *eeprom_info_buf;
        size_t eeprom_info_out_len;
};</pre>
    </div>
    <p class="Pp">On successful return, the
        <code class="Dv">eeprom_info_out_len</code> field reports the length of
        the EEPROM information. <code class="Dv">eeprom_info_buf</code> field
        contains the actual EEPROM information.
        <code class="Dv">eeprom_info_page_valid</code> field reports the third
        page validity.</p>
  </dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<p class="Pp">The <span class="Pa">/dev/mlx5ctl</span>
    <a class="Xr">devfs(4)</a> node is used to pass commands to the driver.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
  VALUES</a></h1>
<p class="Pp">If successful, the IOCTL returns zero. Otherwise, -1 is returned
    and the global variable <var class="Va">errno</var> is set to indicate the
    error.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">errno(2)</a>, <a class="Xr">ioctl(2)</a>,
    <a class="Xr">mlx5en(4)</a>, <a class="Xr">mlx5ib(4)</a>,
    <a class="Xr">mlx5tool(8)</a> and <a class="Xr">pci(9)</a>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">October 2, 2019</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>