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 hardware VF VLAN filtering by an Ethernet device of
96 * received VLAN packets tagged with a given VLAN Tag Identifier.
99 * The port identifier of the Ethernet device.
101 * The VLAN Tag Identifier whose filtering must be enabled or disabled.
103 * Bitmap listing which VFs participate in the VLAN filtering.
105 * 1 - Enable VFs VLAN filtering.
106 * 0 - Disable VFs VLAN filtering.
108 * - (0) if successful.
109 * - (-ENOTSUP) if hardware doesn't support.
110 * - (-ENODEV) if *port_id* invalid.
111 * - (-EINVAL) if bad parameter.
113 int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
114 uint64_t vf_mask, uint8_t vlan_on);
117 * Enable/Disable tx loopback
120 * The port identifier of the Ethernet device.
122 * 1 - Enable tx loopback.
123 * 0 - Disable tx loopback.
126 * - (0) if successful.
127 * - (-ENODEV) if *port* invalid.
128 * - (-EINVAL) if bad parameter.
130 int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on);
133 * set all queues drop enable bit
136 * The port identifier of the Ethernet device.
138 * 1 - set the queue drop enable bit for all pools.
139 * 0 - reset the queue drop enable bit for all pools.
142 * - (0) if successful.
143 * - (-ENODEV) if *port* invalid.
144 * - (-EINVAL) if bad parameter.
146 int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on);
149 * Set the VF rate limit.
152 * The port identifier of the Ethernet device.
158 * Mask of the Tx queue
160 * - (0) if successful.
161 * - (-ENODEV) if *port* invalid.
162 * - (-EINVAL) if *vf* or *mac_addr* is invalid.
164 int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf,
165 uint16_t tx_rate, uint64_t q_msk);
168 * Get VF's statistics
171 * The port identifier of the Ethernet device.
173 * VF on which to get.
175 * A pointer to a structure of type *rte_eth_stats* to be filled with
176 * the values of device counters supported statistics:
178 * - (0) if successful.
179 * - (-ENODEV) if *port* invalid.
180 * - (-EINVAL) if bad parameter.
183 int rte_pmd_bnxt_get_vf_stats(uint8_t port,
185 struct rte_eth_stats *stats);
188 * Clear VF's statistics
191 * The port identifier of the Ethernet device.
193 * VF on which to get.
195 * - (0) if successful.
196 * - (-ENODEV) if *port* invalid.
197 * - (-EINVAL) if bad parameter.
199 int rte_pmd_bnxt_reset_vf_stats(uint8_t port,
203 * Enable/Disable VF VLAN anti spoof
206 * The port identifier of the Ethernet device.
210 * 1 - Enable VF VLAN anti spoof.
211 * 0 - Disable VF VLAN anti spoof.
214 * - (0) if successful.
215 * - (-ENODEV) if *port* invalid.
216 * - (-EINVAL) if bad parameter.
218 int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on);
221 * Queries the TX drop counter for the function
224 * The port identifier of the Ethernet device.
226 * VF on which to get.
228 * Pointer to a uint64_t that will be populated with the counter value.
230 * - Positive Non-zero value - Error code from HWRM
231 * - (-EINVAL) invalid vf_id specified.
232 * - (-ENOTSUP) Ethernet device is not a PF
234 int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id,
236 #endif /* _PMD_BNXT_H_ */