Lines Matching refs:vnic
2106 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_init_vnics() local
2108 vnic->fw_vnic_id = INVALID_HW_RING_ID; in bnxt_init_vnics()
2109 vnic->fw_rss_cos_lb_ctx = INVALID_HW_RING_ID; in bnxt_init_vnics()
2110 vnic->fw_l2_ctx_id = INVALID_HW_RING_ID; in bnxt_init_vnics()
2114 prandom_bytes(vnic->rss_hash_key, in bnxt_init_vnics()
2117 memcpy(vnic->rss_hash_key, in bnxt_init_vnics()
2228 struct bnxt_vnic_info *vnic; in bnxt_free_vnic_attributes() local
2235 vnic = &bp->vnic_info[i]; in bnxt_free_vnic_attributes()
2237 kfree(vnic->fw_grp_ids); in bnxt_free_vnic_attributes()
2238 vnic->fw_grp_ids = NULL; in bnxt_free_vnic_attributes()
2240 kfree(vnic->uc_list); in bnxt_free_vnic_attributes()
2241 vnic->uc_list = NULL; in bnxt_free_vnic_attributes()
2243 if (vnic->mc_list) { in bnxt_free_vnic_attributes()
2244 dma_free_coherent(&pdev->dev, vnic->mc_list_size, in bnxt_free_vnic_attributes()
2245 vnic->mc_list, vnic->mc_list_mapping); in bnxt_free_vnic_attributes()
2246 vnic->mc_list = NULL; in bnxt_free_vnic_attributes()
2249 if (vnic->rss_table) { in bnxt_free_vnic_attributes()
2251 vnic->rss_table, in bnxt_free_vnic_attributes()
2252 vnic->rss_table_dma_addr); in bnxt_free_vnic_attributes()
2253 vnic->rss_table = NULL; in bnxt_free_vnic_attributes()
2256 vnic->rss_hash_key = NULL; in bnxt_free_vnic_attributes()
2257 vnic->flags = 0; in bnxt_free_vnic_attributes()
2264 struct bnxt_vnic_info *vnic; in bnxt_alloc_vnic_attributes() local
2269 vnic = &bp->vnic_info[i]; in bnxt_alloc_vnic_attributes()
2271 if (vnic->flags & BNXT_VNIC_UCAST_FLAG) { in bnxt_alloc_vnic_attributes()
2275 vnic->uc_list = kmalloc(mem_size, GFP_KERNEL); in bnxt_alloc_vnic_attributes()
2276 if (!vnic->uc_list) { in bnxt_alloc_vnic_attributes()
2283 if (vnic->flags & BNXT_VNIC_MCAST_FLAG) { in bnxt_alloc_vnic_attributes()
2284 vnic->mc_list_size = BNXT_MAX_MC_ADDRS * ETH_ALEN; in bnxt_alloc_vnic_attributes()
2285 vnic->mc_list = in bnxt_alloc_vnic_attributes()
2287 vnic->mc_list_size, in bnxt_alloc_vnic_attributes()
2288 &vnic->mc_list_mapping, in bnxt_alloc_vnic_attributes()
2290 if (!vnic->mc_list) { in bnxt_alloc_vnic_attributes()
2296 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_alloc_vnic_attributes()
2301 vnic->fw_grp_ids = kcalloc(max_rings, sizeof(u16), GFP_KERNEL); in bnxt_alloc_vnic_attributes()
2302 if (!vnic->fw_grp_ids) { in bnxt_alloc_vnic_attributes()
2308 vnic->rss_table = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, in bnxt_alloc_vnic_attributes()
2309 &vnic->rss_table_dma_addr, in bnxt_alloc_vnic_attributes()
2311 if (!vnic->rss_table) { in bnxt_alloc_vnic_attributes()
2318 vnic->rss_hash_key = ((void *)vnic->rss_table) + size; in bnxt_alloc_vnic_attributes()
2319 vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr + size; in bnxt_alloc_vnic_attributes()
2772 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_cfa_l2_set_rx_mask() local
2775 req.dflt_vnic_id = cpu_to_le32(vnic->fw_vnic_id); in bnxt_hwrm_cfa_l2_set_rx_mask()
2777 req.num_mc_entries = cpu_to_le32(vnic->mc_list_count); in bnxt_hwrm_cfa_l2_set_rx_mask()
2778 req.mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping); in bnxt_hwrm_cfa_l2_set_rx_mask()
2779 req.mask = cpu_to_le32(vnic->rx_mask); in bnxt_hwrm_cfa_l2_set_rx_mask()
2818 struct bnxt_vnic_info *vnic = &bp->vnic_info[fltr->rxq + 1]; in bnxt_hwrm_cfa_ntuple_filter_alloc() local
2840 req.dst_vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_cfa_ntuple_filter_alloc()
2890 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_hwrm_clear_vnic_filter() local
2892 for (j = 0; j < vnic->uc_filter_count; j++) { in bnxt_hwrm_clear_vnic_filter()
2898 req.l2_filter_id = vnic->fw_l2_filter_id[j]; in bnxt_hwrm_clear_vnic_filter()
2903 vnic->uc_filter_count = 0; in bnxt_hwrm_clear_vnic_filter()
2912 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_tpa() local
2952 req.vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_tpa()
2960 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_rss() local
2963 if (vnic->fw_rss_cos_lb_ctx == INVALID_HW_RING_ID) in bnxt_hwrm_vnic_set_rss()
2968 vnic->hash_type = BNXT_RSS_HASH_TYPE_FLAG_IPV4 | in bnxt_hwrm_vnic_set_rss()
2973 req.hash_type = cpu_to_le32(vnic->hash_type); in bnxt_hwrm_vnic_set_rss()
2975 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_hwrm_vnic_set_rss()
2984 vnic->rss_table[i] = cpu_to_le16(vnic->fw_grp_ids[j]); in bnxt_hwrm_vnic_set_rss()
2987 req.ring_grp_tbl_addr = cpu_to_le64(vnic->rss_table_dma_addr); in bnxt_hwrm_vnic_set_rss()
2989 cpu_to_le64(vnic->rss_hash_key_dma_addr); in bnxt_hwrm_vnic_set_rss()
2991 req.rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx); in bnxt_hwrm_vnic_set_rss()
2997 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_hds() local
3010 req.vnic_id = cpu_to_le32(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_hds()
3031 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_hwrm_vnic_ctx_free() local
3033 if (vnic->fw_rss_cos_lb_ctx != INVALID_HW_RING_ID) in bnxt_hwrm_vnic_ctx_free()
3062 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_cfg() local
3069 req.rss_rule = cpu_to_le16(vnic->fw_rss_cos_lb_ctx); in bnxt_hwrm_vnic_cfg()
3071 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_hwrm_vnic_cfg()
3073 else if (vnic->flags & BNXT_VNIC_RFS_FLAG) in bnxt_hwrm_vnic_cfg()
3076 req.vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_cfg()
4787 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_mc_list_updated() local
4797 vnic->mc_list_count = 0; in bnxt_mc_list_updated()
4801 if (!ether_addr_equal(haddr, vnic->mc_list + off)) { in bnxt_mc_list_updated()
4802 memcpy(vnic->mc_list + off, haddr, ETH_ALEN); in bnxt_mc_list_updated()
4811 if (mc_count != vnic->mc_list_count) { in bnxt_mc_list_updated()
4812 vnic->mc_list_count = mc_count; in bnxt_mc_list_updated()
4821 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_uc_list_updated() local
4825 if (netdev_uc_count(dev) != (vnic->uc_filter_count - 1)) in bnxt_uc_list_updated()
4829 if (!ether_addr_equal(ha->addr, vnic->uc_list + off)) in bnxt_uc_list_updated()
4840 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_set_rx_mode() local
4841 u32 mask = vnic->rx_mask; in bnxt_set_rx_mode()
4860 vnic->mc_list_count = 0; in bnxt_set_rx_mode()
4865 if (mask != vnic->rx_mask || uc_update || mc_update) { in bnxt_set_rx_mode()
4866 vnic->rx_mask = mask; in bnxt_set_rx_mode()
4876 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_cfg_rx_mode() local
4889 for (i = 1; i < vnic->uc_filter_count; i++) { in bnxt_cfg_rx_mode()
4895 req.l2_filter_id = vnic->fw_l2_filter_id[i]; in bnxt_cfg_rx_mode()
4902 vnic->uc_filter_count = 1; in bnxt_cfg_rx_mode()
4906 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; in bnxt_cfg_rx_mode()
4909 memcpy(vnic->uc_list + off, ha->addr, ETH_ALEN); in bnxt_cfg_rx_mode()
4911 vnic->uc_filter_count++; in bnxt_cfg_rx_mode()
4916 for (i = 1, off = 0; i < vnic->uc_filter_count; i++, off += ETH_ALEN) { in bnxt_cfg_rx_mode()
4917 rc = bnxt_hwrm_set_vnic_filter(bp, 0, i, vnic->uc_list + off); in bnxt_cfg_rx_mode()
4921 vnic->uc_filter_count = i; in bnxt_cfg_rx_mode()