DPDK  23.03.0
rte_pmd_bnxt.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017-2021 Broadcom
3  * All rights reserved.
4  */
5 
6 #ifndef _PMD_BNXT_H_
7 #define _PMD_BNXT_H_
8 
9 #include <rte_ethdev.h>
10 #include <rte_ether.h>
11 
13 #define RTE_PMD_BNXT_CFA_CODE_DYNFIELD_NAME "rte_net_bnxt_dynfield_cfa_code"
14 
15 /*
16  * Response sent back to the caller after callback
17  */
18 enum rte_pmd_bnxt_mb_event_rsp {
19  RTE_PMD_BNXT_MB_EVENT_NOOP_ACK,
20  RTE_PMD_BNXT_MB_EVENT_NOOP_NACK,
21  RTE_PMD_BNXT_MB_EVENT_PROCEED,
22  RTE_PMD_BNXT_MB_EVENT_MAX
23 };
24 
25 /* mailbox message types */
26 #define BNXT_VF_RESET 0x01 /* VF requests reset */
27 #define BNXT_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */
28 #define BNXT_VF_SET_VLAN 0x03 /* VF requests PF to set VLAN */
29 #define BNXT_VF_SET_MTU 0x04 /* VF requests PF to set MTU */
30 #define BNXT_VF_SET_MRU 0x05 /* VF requests PF to set MRU */
31 
32 /*
33  * Data sent to the caller when the callback is executed.
34  */
35 struct rte_pmd_bnxt_mb_event_param {
36  uint16_t vf_id; /* Virtual Function number */
37  int retval; /* return value */
38  void *msg; /* pointer to message */
39 };
40 
57 int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
58 
73 int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
74  struct rte_ether_addr *mac_addr);
75 
93 int
94 rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
95 
112 int
113 rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf,
114  uint16_t vlan_id);
115 
135 int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
136  uint64_t vf_mask, uint8_t vlan_on);
137 
152 int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on);
153 
168 int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on);
169 
186 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
187  uint32_t tx_rate, uint64_t q_msk);
188 
205 int rte_pmd_bnxt_get_vf_stats(uint16_t port,
206  uint16_t vf_id,
207  struct rte_eth_stats *stats);
208 
221 int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
222  uint16_t vf_id);
223 
240 int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
241 
259 int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
260  uint16_t rx_mask, uint8_t on);
261 
276 int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id);
277 
292 int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
293  uint64_t *count);
294 
310 int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *mac_addr,
311  uint32_t vf_id);
312 
329 int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on);
330 #endif /* _PMD_BNXT_H_ */