DPDK  20.08.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.h>
10 #include <rte_ether.h>
11 
12 /*
13  * Response sent back to the caller after callback
14  */
15 enum rte_pmd_bnxt_mb_event_rsp {
16  RTE_PMD_BNXT_MB_EVENT_NOOP_ACK,
17  RTE_PMD_BNXT_MB_EVENT_NOOP_NACK,
18  RTE_PMD_BNXT_MB_EVENT_PROCEED,
19  RTE_PMD_BNXT_MB_EVENT_MAX
20 };
21 
22 /* mailbox message types */
23 #define BNXT_VF_RESET 0x01 /* VF requests reset */
24 #define BNXT_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */
25 #define BNXT_VF_SET_VLAN 0x03 /* VF requests PF to set VLAN */
26 #define BNXT_VF_SET_MTU 0x04 /* VF requests PF to set MTU */
27 #define BNXT_VF_SET_MRU 0x05 /* VF requests PF to set MRU */
28 
29 /*
30  * Data sent to the caller when the callback is executed.
31  */
32 struct rte_pmd_bnxt_mb_event_param {
33  uint16_t vf_id; /* Virtual Function number */
34  int retval; /* return value */
35  void *msg; /* pointer to message */
36 };
37 
54 int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
55 
70 int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
71  struct rte_ether_addr *mac_addr);
72 
90 int
91 rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on);
92 
109 int
110 rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf,
111  uint16_t vlan_id);
112 
132 int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
133  uint64_t vf_mask, uint8_t vlan_on);
134 
149 int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on);
150 
165 int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on);
166 
183 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
184  uint16_t tx_rate, uint64_t q_msk);
185 
202 int rte_pmd_bnxt_get_vf_stats(uint16_t port,
203  uint16_t vf_id,
204  struct rte_eth_stats *stats);
205 
218 int rte_pmd_bnxt_reset_vf_stats(uint16_t port,
219  uint16_t vf_id);
220 
237 int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);
238 
256 int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf,
257  uint16_t rx_mask, uint8_t on);
258 
273 int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id);
274 
289 int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,
290  uint64_t *count);
291 
307 int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *mac_addr,
308  uint32_t vf_id);
309 
326 int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on);
327 #endif /* _PMD_BNXT_H_ */