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 * Set the VF MAC address.
48 * The port identifier of the Ethernet device.
54 * - (0) if successful.
55 * - (-ENODEV) if *port* invalid.
56 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
58 int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
59 struct ether_addr *mac_addr);
62 * Enable/Disable VF VLAN anti spoofing.
65 * The port identifier of the Ethernet device.
67 * VF on which to set VLAN anti spoofing.
69 * 1 - Enable VFs VLAN anti spoofing.
70 * 0 - Disable VFs VLAN anti spoofing.
72 * - (0) if successful.
73 * - (-ENODEV) if *port* invalid.
74 * - (-EINVAL) if bad parameter.
76 int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
79 * Enable/Disable VF MAC anti spoofing.
82 * The port identifier of the Ethernet device.
84 * VF on which to set MAC anti spoofing.
86 * 1 - Enable VFs MAC anti spoofing.
87 * 0 - Disable VFs MAC anti spoofing.
89 * - (0) if successful.
90 * - (-ENODEV) if *port* invalid.
91 * - (-EINVAL) if bad parameter.
93 int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
96 * Enable/Disable vf vlan insert
99 * The port identifier of the Ethernet device.
103 * 0 - Disable VF's vlan insert.
104 * n - Enable; n is inserted as the vlan id.
107 * - (0) if successful.
108 * - (-ENODEV) if *port* invalid.
109 * - (-EINVAL) if bad parameter.
111 int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf,
115 * Enable/Disable tx loopback
118 * The port identifier of the Ethernet device.
120 * 1 - Enable tx loopback.
121 * 0 - Disable tx loopback.
124 * - (0) if successful.
125 * - (-ENODEV) if *port* invalid.
126 * - (-EINVAL) if bad parameter.
128 int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on);
131 * set all queues drop enable bit
134 * The port identifier of the Ethernet device.
136 * 1 - set the queue drop enable bit for all pools.
137 * 0 - reset the queue drop enable bit for all pools.
140 * - (0) if successful.
141 * - (-ENODEV) if *port* invalid.
142 * - (-EINVAL) if bad parameter.
144 int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on);
147 * set drop enable bit in the VF split rx control register
150 * The port identifier of the Ethernet device.
154 * 1 - set the drop enable bit in the split rx control register.
155 * 0 - reset the drop enable bit in the split rx control register.
158 * - (0) if successful.
159 * - (-ENODEV) if *port* invalid.
160 * - (-EINVAL) if bad parameter.
163 int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on);
166 * Enable/Disable vf vlan strip for all queues in a pool
169 * The port identifier of the Ethernet device.
173 * 1 - Enable VF's vlan strip on RX queues.
174 * 0 - Disable VF's vlan strip on RX queues.
177 * - (0) if successful.
178 * - (-ENOTSUP) if hardware doesn't support this feature.
179 * - (-ENODEV) if *port* invalid.
180 * - (-EINVAL) if bad parameter.
183 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
186 * Enable MACsec offload.
189 * The port identifier of the Ethernet device.
191 * 1 - Enable encryption (encrypt and add integrity signature).
192 * 0 - Disable encryption (only add integrity signature).
194 * 1 - Enable replay protection.
195 * 0 - Disable replay protection.
197 * - (0) if successful.
198 * - (-ENODEV) if *port* invalid.
199 * - (-ENOTSUP) if hardware doesn't support this feature.
201 int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp);
204 * Disable MACsec offload.
207 * The port identifier of the Ethernet device.
209 * - (0) if successful.
210 * - (-ENODEV) if *port* invalid.
211 * - (-ENOTSUP) if hardware doesn't support this feature.
213 int rte_pmd_ixgbe_macsec_disable(uint8_t port);
216 * Configure Tx SC (Secure Connection).
219 * The port identifier of the Ethernet device.
221 * The MAC address on the local side.
223 * - (0) if successful.
224 * - (-ENODEV) if *port* invalid.
226 int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac);
229 * Configure Rx SC (Secure Connection).
232 * The port identifier of the Ethernet device.
234 * The MAC address on the remote side.
236 * The PI (port identifier) on the remote side.
238 * - (0) if successful.
239 * - (-ENODEV) if *port* invalid.
241 int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi);
244 * Enable Tx SA (Secure Association).
247 * The port identifier of the Ethernet device.
249 * The SA to be enabled (0 or 1).
251 * The association number on the local side.
253 * The packet number on the local side.
255 * The key on the local side.
257 * - (0) if successful.
258 * - (-ENODEV) if *port* invalid.
259 * - (-EINVAL) if bad parameter.
261 int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an,
262 uint32_t pn, uint8_t *key);
265 * Enable Rx SA (Secure Association).
268 * The port identifier of the Ethernet device.
270 * The SA to be enabled (0 or 1)
272 * The association number on the remote side.
274 * The packet number on the remote side.
276 * The key on the remote side.
278 * - (0) if successful.
279 * - (-ENODEV) if *port* invalid.
280 * - (-EINVAL) if bad parameter.
282 int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an,
283 uint32_t pn, uint8_t *key);
286 * Response sent back to ixgbe driver from user app after callback
288 enum rte_pmd_ixgbe_mb_event_rsp {
289 RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */
290 RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
291 RTE_PMD_IXGBE_MB_EVENT_PROCEED, /**< proceed with mbox request */
292 RTE_PMD_IXGBE_MB_EVENT_MAX /**< max value of this enum */
296 * Data sent to the user application when the callback is executed.
298 struct rte_pmd_ixgbe_mb_event_param {
299 uint16_t vfid; /**< Virtual Function number */
300 uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */
301 uint16_t retval; /**< return value */
302 void *msg; /**< pointer to message */
304 #endif /* _PMD_IXGBE_H_ */