DPDK  20.05.0
rte_pmd_bnxt.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017-2018 Broadcom
3  * All rights reserved.
4  */
5 
6 #ifndef _PMD_BNXT_H_
7 #define _PMD_BNXT_H_
8 
9 #include <rte_ethdev_driver.h>
10 
11 /*
12  * Response sent back to the caller after callback
13  */
14 enum rte_pmd_bnxt_mb_event_rsp {
15  RTE_PMD_BNXT_MB_EVENT_NOOP_ACK,
16  RTE_PMD_BNXT_MB_EVENT_NOOP_NACK,
17  RTE_PMD_BNXT_MB_EVENT_PROCEED,
18  RTE_PMD_BNXT_MB_EVENT_MAX
19 };
20 
21 /* mailbox message types */
22 #define BNXT_VF_RESET 0x01 /* VF requests reset */
23 #define BNXT_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */
24 #define BNXT_VF_SET_VLAN 0x03 /* VF requests PF to set VLAN */
25 #define BNXT_VF_SET_MTU 0x04 /* VF requests PF to set MTU */
26 #define BNXT_VF_SET_MRU 0x05 /* VF requests PF to set MRU */
27 
28 /*
29  * Data sent to the caller when the callback is executed.
30  */
31 struct rte_pmd_bnxt_mb_event_param {
32  uint16_t vf_id; /* Virtual Function number */
33  int retval; /* return value */
34  void *msg; /* pointer to message */
35 };
36 
53 int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
54 
69 int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
70  struct rte_ether_addr *mac_addr);
71 
89 int
90 rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
91 
108 int
109 rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf,
110  uint16_t vlan_id);
111 
131 int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
132  uint64_t vf_mask, uint8_t vlan_on);
133 
148 int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on);
149 
164 int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on);
165 
182 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
183  uint16_t tx_rate, uint64_t q_msk);
184 
201 int rte_pmd_bnxt_get_vf_stats(uint16_t port,
202  uint16_t vf_id,
203  struct rte_eth_stats *stats);
204 
217 int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
218  uint16_t vf_id);
219 
236 int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
237 
255 int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
256  uint16_t rx_mask, uint8_t on);
257 
272 int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id);
273 
288 int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
289  uint64_t *count);
290 
306 int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *mac_addr,
307  uint32_t vf_id);
308 
325 int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on);
326 #endif /* _PMD_BNXT_H_ */