4 * Copyright(c) 2017 Broadcom Limited.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Broadcom Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 #include <rte_ethdev.h>
40 * Enable/Disable VF MAC anti spoof
43 * The port identifier of the Ethernet device.
47 * 1 - Enable VF MAC anti spoof.
48 * 0 - Disable VF MAC anti spoof.
51 * - (0) if successful.
52 * - (-ENODEV) if *port* invalid.
53 * - (-EINVAL) if bad parameter.
55 int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
58 * Set the VF MAC address.
61 * The port identifier of the Ethernet device.
67 * - (0) if successful.
68 * - (-ENODEV) if *port* invalid.
69 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
71 int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf,
72 struct ether_addr *mac_addr);
75 * Enable/Disable vf vlan strip for all queues in a pool
78 * The port identifier of the Ethernet device.
82 * 1 - Enable VF's vlan strip on RX queues.
83 * 0 - Disable VF's vlan strip on RX queues.
86 * - (0) if successful.
87 * - (-ENOTSUP) if hardware doesn't support this feature.
88 * - (-ENODEV) if *port* invalid.
89 * - (-EINVAL) if bad parameter.
92 rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
95 * Enable/Disable vf vlan insert
98 * The port identifier of the Ethernet device.
102 * 0 - Disable VF's vlan insert.
103 * n - Enable; n is inserted as the vlan id.
106 * - (0) if successful.
107 * - (-ENODEV) if *port* invalid.
108 * - (-EINVAL) if bad parameter.
111 rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf,
115 * Enable/Disable hardware VF VLAN filtering by an Ethernet device of
116 * received VLAN packets tagged with a given VLAN Tag Identifier.
119 * The port identifier of the Ethernet device.
121 * The VLAN Tag Identifier whose filtering must be enabled or disabled.
123 * Bitmap listing which VFs participate in the VLAN filtering.
125 * 1 - Enable VFs VLAN filtering.
126 * 0 - Disable VFs VLAN filtering.
128 * - (0) if successful.
129 * - (-ENOTSUP) if hardware doesn't support.
130 * - (-ENODEV) if *port_id* invalid.
131 * - (-EINVAL) if bad parameter.
133 int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
134 uint64_t vf_mask, uint8_t vlan_on);
137 * Enable/Disable tx loopback
140 * The port identifier of the Ethernet device.
142 * 1 - Enable tx loopback.
143 * 0 - Disable tx loopback.
146 * - (0) if successful.
147 * - (-ENODEV) if *port* invalid.
148 * - (-EINVAL) if bad parameter.
150 int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on);
153 * set all queues drop enable bit
156 * The port identifier of the Ethernet device.
158 * 1 - set the queue drop enable bit for all pools.
159 * 0 - reset the queue drop enable bit for all pools.
162 * - (0) if successful.
163 * - (-ENODEV) if *port* invalid.
164 * - (-EINVAL) if bad parameter.
166 int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on);
169 * Set the VF rate limit.
172 * The port identifier of the Ethernet device.
178 * Mask of the Tx queue
180 * - (0) if successful.
181 * - (-ENODEV) if *port* invalid.
182 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
184 int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf,
185 uint16_t tx_rate, uint64_t q_msk);
188 * Get VF's statistics
191 * The port identifier of the Ethernet device.
193 * VF on which to get.
195 * A pointer to a structure of type *rte_eth_stats* to be filled with
196 * the values of device counters supported statistics:
198 * - (0) if successful.
199 * - (-ENODEV) if *port* invalid.
200 * - (-EINVAL) if bad parameter.
203 int rte_pmd_bnxt_get_vf_stats(uint8_t port,
205 struct rte_eth_stats *stats);
208 * Clear VF's statistics
211 * The port identifier of the Ethernet device.
213 * VF on which to get.
215 * - (0) if successful.
216 * - (-ENODEV) if *port* invalid.
217 * - (-EINVAL) if bad parameter.
219 int rte_pmd_bnxt_reset_vf_stats(uint8_t port,
223 * Enable/Disable VF VLAN anti spoof
226 * The port identifier of the Ethernet device.
230 * 1 - Enable VF VLAN anti spoof.
231 * 0 - Disable VF VLAN anti spoof.
234 * - (0) if successful.
235 * - (-ENODEV) if *port* invalid.
236 * - (-EINVAL) if bad parameter.
238 int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
241 * Set RX L2 Filtering mode of a VF of an Ethernet device.
244 * The port identifier of the Ethernet device.
250 * 1 - Enable a VF RX mode.
251 * 0 - Disable a VF RX mode.
253 * - (0) if successful.
254 * - (-ENODEV) if *port_id* invalid.
255 * - (-EINVAL) if bad parameter.
257 int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf,
258 uint16_t rx_mask, uint8_t on);
261 * Returns the number of default RX queues on a VF
264 * The port identifier of the Ethernet device.
268 * - Non-negative value - Number of default RX queues
269 * - (-EINVAL) if bad parameter.
270 * - (-ENOTSUP) if on a function without VFs
271 * - (-ENOMEM) on an allocation failure
272 * - (-1) firmware interface error
274 int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id);
277 * Queries the TX drop counter for the function
280 * The port identifier of the Ethernet device.
282 * VF on which to get.
284 * Pointer to a uint64_t that will be populated with the counter value.
286 * - Positive Non-zero value - Error code from HWRM
287 * - (-EINVAL) invalid vf_id specified.
288 * - (-ENOTSUP) Ethernet device is not a PF
290 int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id,
294 * Programs the MAC address for the function specified
297 * The port identifier of the Ethernet device.
299 * The MAC address to be programmed in the filter.
301 * VF on which to get.
303 * - Positive Non-zero value - Error code from HWRM
304 * - (-EINVAL) invalid vf_id specified.
305 * - (-ENOTSUP) Ethernet device is not a PF
306 * - (-ENOMEM) on an allocation failure
308 int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr,
310 #endif /* _PMD_BNXT_H_ */