4 * Copyright (c) 2016 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of Intel Corporation nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * @file rte_pmd_ixgbe.h
35 * ixgbe PMD specific functions.
42 #include <rte_ethdev.h>
45 * Notify VF when PF link status changes.
48 * The port identifier of the Ethernet device.
52 * - (0) if successful.
53 * - (-ENODEV) if *port* invalid.
54 * - (-EINVAL) if *vf* invalid.
56 int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf);
59 * Set the VF MAC address.
62 * The port identifier of the Ethernet device.
68 * - (0) if successful.
69 * - (-ENODEV) if *port* invalid.
70 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
72 int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
73 struct ether_addr *mac_addr);
76 * Enable/Disable VF VLAN anti spoofing.
79 * The port identifier of the Ethernet device.
81 * VF on which to set VLAN anti spoofing.
83 * 1 - Enable VFs VLAN anti spoofing.
84 * 0 - Disable VFs VLAN anti spoofing.
86 * - (0) if successful.
87 * - (-ENODEV) if *port* invalid.
88 * - (-EINVAL) if bad parameter.
90 int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
93 * Enable/Disable VF MAC anti spoofing.
96 * The port identifier of the Ethernet device.
98 * VF on which to set MAC anti spoofing.
100 * 1 - Enable VFs MAC anti spoofing.
101 * 0 - Disable VFs MAC anti spoofing.
103 * - (0) if successful.
104 * - (-ENODEV) if *port* invalid.
105 * - (-EINVAL) if bad parameter.
107 int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
110 * Enable/Disable vf vlan insert
113 * The port identifier of the Ethernet device.
117 * 0 - Disable VF's vlan insert.
118 * n - Enable; n is inserted as the vlan id.
121 * - (0) if successful.
122 * - (-ENODEV) if *port* invalid.
123 * - (-EINVAL) if bad parameter.
125 int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf,
129 * Enable/Disable tx loopback
132 * The port identifier of the Ethernet device.
134 * 1 - Enable tx loopback.
135 * 0 - Disable tx loopback.
138 * - (0) if successful.
139 * - (-ENODEV) if *port* invalid.
140 * - (-EINVAL) if bad parameter.
142 int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on);
145 * set all queues drop enable bit
148 * The port identifier of the Ethernet device.
150 * 1 - set the queue drop enable bit for all pools.
151 * 0 - reset the queue drop enable bit for all pools.
154 * - (0) if successful.
155 * - (-ENODEV) if *port* invalid.
156 * - (-EINVAL) if bad parameter.
158 int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on);
161 * set drop enable bit in the VF split rx control register
164 * The port identifier of the Ethernet device.
168 * 1 - set the drop enable bit in the split rx control register.
169 * 0 - reset the drop enable bit in the split rx control register.
172 * - (0) if successful.
173 * - (-ENODEV) if *port* invalid.
174 * - (-EINVAL) if bad parameter.
177 int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on);
180 * Enable/Disable vf vlan strip for all queues in a pool
183 * The port identifier of the Ethernet device.
187 * 1 - Enable VF's vlan strip on RX queues.
188 * 0 - Disable VF's vlan strip on RX queues.
191 * - (0) if successful.
192 * - (-ENOTSUP) if hardware doesn't support this feature.
193 * - (-ENODEV) if *port* invalid.
194 * - (-EINVAL) if bad parameter.
197 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
200 * Enable MACsec offload.
203 * The port identifier of the Ethernet device.
205 * 1 - Enable encryption (encrypt and add integrity signature).
206 * 0 - Disable encryption (only add integrity signature).
208 * 1 - Enable replay protection.
209 * 0 - Disable replay protection.
211 * - (0) if successful.
212 * - (-ENODEV) if *port* invalid.
213 * - (-ENOTSUP) if hardware doesn't support this feature.
215 int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp);
218 * Disable MACsec offload.
221 * The port identifier of the Ethernet device.
223 * - (0) if successful.
224 * - (-ENODEV) if *port* invalid.
225 * - (-ENOTSUP) if hardware doesn't support this feature.
227 int rte_pmd_ixgbe_macsec_disable(uint8_t port);
230 * Configure Tx SC (Secure Connection).
233 * The port identifier of the Ethernet device.
235 * The MAC address on the local side.
237 * - (0) if successful.
238 * - (-ENODEV) if *port* invalid.
239 * - (-ENOTSUP) if hardware doesn't support this feature.
241 int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac);
244 * Configure Rx SC (Secure Connection).
247 * The port identifier of the Ethernet device.
249 * The MAC address on the remote side.
251 * The PI (port identifier) on the remote side.
253 * - (0) if successful.
254 * - (-ENODEV) if *port* invalid.
255 * - (-ENOTSUP) if hardware doesn't support this feature.
257 int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi);
260 * Enable Tx SA (Secure Association).
263 * The port identifier of the Ethernet device.
265 * The SA to be enabled (0 or 1).
267 * The association number on the local side.
269 * The packet number on the local side.
271 * The key on the local side.
273 * - (0) if successful.
274 * - (-ENODEV) if *port* invalid.
275 * - (-ENOTSUP) if hardware doesn't support this feature.
276 * - (-EINVAL) if bad parameter.
278 int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an,
279 uint32_t pn, uint8_t *key);
282 * Enable Rx SA (Secure Association).
285 * The port identifier of the Ethernet device.
287 * The SA to be enabled (0 or 1)
289 * The association number on the remote side.
291 * The packet number on the remote side.
293 * The key on the remote side.
295 * - (0) if successful.
296 * - (-ENODEV) if *port* invalid.
297 * - (-ENOTSUP) if hardware doesn't support this feature.
298 * - (-EINVAL) if bad parameter.
300 int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an,
301 uint32_t pn, uint8_t *key);
304 * Set RX L2 Filtering mode of a VF of an Ethernet device.
307 * The port identifier of the Ethernet device.
311 * The RX mode mask, which is one or more of accepting Untagged Packets,
312 * packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
313 * ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
314 * ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
317 * 1 - Enable a VF RX mode.
318 * 0 - Disable a VF RX mode.
320 * - (0) if successful.
321 * - (-ENOTSUP) if hardware doesn't support.
322 * - (-ENODEV) if *port_id* invalid.
323 * - (-EINVAL) if bad parameter.
326 rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
329 * Enable or disable a VF traffic receive of an Ethernet device.
332 * The port identifier of the Ethernet device.
336 * 1 - Enable a VF traffic receive.
337 * 0 - Disable a VF traffic receive.
339 * - (0) if successful.
340 * - (-ENOTSUP) if hardware doesn't support.
341 * - (-ENODEV) if *port_id* invalid.
342 * - (-EINVAL) if bad parameter.
345 rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
348 * Enable or disable a VF traffic transmit of the Ethernet device.
351 * The port identifier of the Ethernet device.
355 * 1 - Enable a VF traffic transmit.
356 * 0 - Disable a VF traffic transmit.
358 * - (0) if successful.
359 * - (-ENODEV) if *port_id* invalid.
360 * - (-ENOTSUP) if hardware doesn't support.
361 * - (-EINVAL) if bad parameter.
364 rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
367 * Enable/Disable hardware VF VLAN filtering by an Ethernet device of
368 * received VLAN packets tagged with a given VLAN Tag Identifier.
371 * The port identifier of the Ethernet device.
373 * The VLAN Tag Identifier whose filtering must be enabled or disabled.
375 * Bitmap listing which VFs participate in the VLAN filtering.
377 * 1 - Enable VFs VLAN filtering.
378 * 0 - Disable VFs VLAN filtering.
380 * - (0) if successful.
381 * - (-ENOTSUP) if hardware doesn't support.
382 * - (-ENODEV) if *port_id* invalid.
383 * - (-EINVAL) if bad parameter.
386 rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
389 * Set the rate limitation for a vf on an Ethernet device.
392 * The port identifier of the Ethernet device.
396 * The tx rate allocated from the total link speed for this VF id.
398 * The queue mask which need to set the rate.
400 * - (0) if successful.
401 * - (-ENOTSUP) if hardware doesn't support this feature.
402 * - (-ENODEV) if *port_id* invalid.
403 * - (-EINVAL) if bad parameter.
405 int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
408 * Set all the TCs' bandwidth weight.
410 * The bw_weight means the percentage occupied by the TC.
411 * It can be taken as the relative min bandwidth setting.
414 * The port identifier of the Ethernet device.
418 * An array of relative bandwidth weight for all the TCs.
419 * The summary of the bw_weight should be 100.
421 * - (0) if successful.
422 * - (-ENODEV) if *port* invalid.
423 * - (-EINVAL) if bad parameter.
424 * - (-ENOTSUP) not supported by firmware.
426 int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port,
431 * Response sent back to ixgbe driver from user app after callback
433 enum rte_pmd_ixgbe_mb_event_rsp {
434 RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */
435 RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
436 RTE_PMD_IXGBE_MB_EVENT_PROCEED, /**< proceed with mbox request */
437 RTE_PMD_IXGBE_MB_EVENT_MAX /**< max value of this enum */
441 * Data sent to the user application when the callback is executed.
443 struct rte_pmd_ixgbe_mb_event_param {
444 uint16_t vfid; /**< Virtual Function number */
445 uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */
446 uint16_t retval; /**< return value */
447 void *msg; /**< pointer to message */
449 #endif /* _PMD_IXGBE_H_ */