1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2021 Broadcom
12 #define INVALID_VNIC_ID ((uint16_t)-1)
14 #define BNXT_RSS_LEVEL_INNERMOST 0x2
15 #define BNXT_RSS_LEVEL_OUTERMOST 0x1
17 struct bnxt_vnic_info {
18 STAILQ_ENTRY(bnxt_vnic_info) next;
21 uint16_t fw_vnic_id; /* returned by Chimp during alloc */
23 uint16_t start_grp_id;
26 uint16_t num_lb_ctxts;
27 uint16_t dflt_ring_grp;
31 rte_iova_t rss_table_dma_addr;
33 rte_iova_t rss_hash_key_dma_addr;
36 #define BNXT_VNIC_INFO_PROMISC (1 << 0)
37 #define BNXT_VNIC_INFO_ALLMULTI (1 << 1)
38 #define BNXT_VNIC_INFO_BCAST (1 << 2)
39 #define BNXT_VNIC_INFO_UCAST (1 << 3)
40 #define BNXT_VNIC_INFO_MCAST (1 << 4)
41 #define BNXT_VNIC_INFO_TAGGED (1 << 5)
42 #define BNXT_VNIC_INFO_UNTAGGED (1 << 6)
46 uint16_t rx_queue_cnt;
47 uint16_t cos_queue_id;
53 STAILQ_HEAD(, bnxt_filter_info) filter;
54 STAILQ_HEAD(, rte_flow) flow_list;
58 int bnxt_free_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic,
60 struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp);
61 void bnxt_free_all_vnics(struct bnxt *bp);
62 void bnxt_free_vnic_attributes(struct bnxt *bp);
63 int bnxt_alloc_vnic_attributes(struct bnxt *bp);
64 void bnxt_free_vnic_mem(struct bnxt *bp);
65 int bnxt_alloc_vnic_mem(struct bnxt *bp);
66 int bnxt_vnic_grp_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
67 void bnxt_prandom_bytes(void *dest_ptr, size_t len);
68 uint16_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type);
69 int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl);
70 uint64_t bnxt_hwrm_to_rte_rss_level(struct bnxt *bp, uint32_t mode);