4 * Copyright (c) 2017 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.
37 * @file rte_pmd_i40e.h
39 * i40e PMD specific functions.
41 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
45 #include <rte_ethdev.h>
48 * Response sent back to i40e driver from user app after callback
50 enum rte_pmd_i40e_mb_event_rsp {
51 RTE_PMD_I40E_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */
52 RTE_PMD_I40E_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
53 RTE_PMD_I40E_MB_EVENT_PROCEED, /**< proceed with mbox request */
54 RTE_PMD_I40E_MB_EVENT_MAX /**< max value of this enum */
58 * Data sent to the user application when the callback is executed.
60 struct rte_pmd_i40e_mb_event_param {
61 uint16_t vfid; /**< Virtual Function number */
62 uint16_t msg_type; /**< VF to PF message type, see i40e_virtchnl_ops */
63 uint16_t retval; /**< return value */
64 void *msg; /**< pointer to message */
65 uint16_t msglen; /**< length of the message */
69 * Notify VF when PF link status changes.
72 * The port identifier of the Ethernet device.
76 * - (0) if successful.
77 * - (-ENODEV) if *port* invalid.
78 * - (-EINVAL) if *vf* invalid.
80 int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf);
83 * Enable/Disable VF MAC anti spoofing.
86 * The port identifier of the Ethernet device.
88 * VF on which to set MAC anti spoofing.
90 * 1 - Enable VFs MAC anti spoofing.
91 * 0 - Disable VFs MAC anti spoofing.
93 * - (0) if successful.
94 * - (-ENODEV) if *port* invalid.
95 * - (-EINVAL) if bad parameter.
97 int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port,
102 * Enable/Disable VF VLAN anti spoofing.
105 * The port identifier of the Ethernet device.
107 * VF on which to set VLAN anti spoofing.
109 * 1 - Enable VFs VLAN anti spoofing.
110 * 0 - Disable VFs VLAN anti spoofing.
112 * - (0) if successful.
113 * - (-ENODEV) if *port* invalid.
114 * - (-EINVAL) if bad parameter.
116 int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port,
121 * Enable/Disable TX loopback on all the PF and VFs.
124 * The port identifier of the Ethernet device.
126 * 1 - Enable TX loopback.
127 * 0 - Disable TX loopback.
129 * - (0) if successful.
130 * - (-ENODEV) if *port* invalid.
131 * - (-EINVAL) if bad parameter.
133 int rte_pmd_i40e_set_tx_loopback(uint8_t port,
137 * Enable/Disable VF unicast promiscuous mode.
140 * The port identifier of the Ethernet device.
142 * VF on which to set.
147 * - (0) if successful.
148 * - (-ENODEV) if *port* invalid.
149 * - (-EINVAL) if bad parameter.
151 int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port,
156 * Enable/Disable VF multicast promiscuous mode.
159 * The port identifier of the Ethernet device.
161 * VF on which to set.
166 * - (0) if successful.
167 * - (-ENODEV) if *port* invalid.
168 * - (-EINVAL) if bad parameter.
170 int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port,
175 * Set the VF MAC address.
177 * PF should set MAC address before VF initialized, if PF sets the MAC
178 * address after VF initialized, new MAC address won't be effective until
181 * This will remove all existing MAC filters.
184 * The port identifier of the Ethernet device.
190 * - (0) if successful.
191 * - (-ENODEV) if *port* invalid.
192 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
194 int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id,
195 struct ether_addr *mac_addr);
198 * Enable/Disable vf vlan strip for all queues in a pool
201 * The port identifier of the Ethernet device.
205 * 1 - Enable VF's vlan strip on RX queues.
206 * 0 - Disable VF's vlan strip on RX queues.
209 * - (0) if successful.
210 * - (-ENODEV) if *port* invalid.
211 * - (-EINVAL) if bad parameter.
214 rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
217 * Enable/Disable vf vlan insert
220 * The port identifier of the Ethernet device.
224 * 0 - Disable VF's vlan insert.
225 * n - Enable; n is inserted as the vlan id.
228 * - (0) if successful.
229 * - (-ENODEV) if *port* invalid.
230 * - (-EINVAL) if bad parameter.
232 int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id,
236 * Enable/Disable vf broadcast mode
239 * The port identifier of the Ethernet device.
243 * 0 - Disable broadcast.
244 * 1 - Enable broadcast.
247 * - (0) if successful.
248 * - (-ENODEV) if *port* invalid.
249 * - (-EINVAL) if bad parameter.
251 int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id,
254 #endif /* _PMD_I40E_H_ */