Lines Matching refs:vnic

3511 		struct bnxt_vnic_info *vnic = &bp->vnic_info[i];  in bnxt_init_vnics()  local
3514 vnic->fw_vnic_id = INVALID_HW_RING_ID; in bnxt_init_vnics()
3516 vnic->fw_rss_cos_lb_ctx[j] = INVALID_HW_RING_ID; in bnxt_init_vnics()
3518 vnic->fw_l2_ctx_id = INVALID_HW_RING_ID; in bnxt_init_vnics()
3522 prandom_bytes(vnic->rss_hash_key, in bnxt_init_vnics()
3525 memcpy(vnic->rss_hash_key, in bnxt_init_vnics()
3671 struct bnxt_vnic_info *vnic; in bnxt_free_vnic_attributes() local
3678 vnic = &bp->vnic_info[i]; in bnxt_free_vnic_attributes()
3680 kfree(vnic->fw_grp_ids); in bnxt_free_vnic_attributes()
3681 vnic->fw_grp_ids = NULL; in bnxt_free_vnic_attributes()
3683 kfree(vnic->uc_list); in bnxt_free_vnic_attributes()
3684 vnic->uc_list = NULL; in bnxt_free_vnic_attributes()
3686 if (vnic->mc_list) { in bnxt_free_vnic_attributes()
3687 dma_free_coherent(&pdev->dev, vnic->mc_list_size, in bnxt_free_vnic_attributes()
3688 vnic->mc_list, vnic->mc_list_mapping); in bnxt_free_vnic_attributes()
3689 vnic->mc_list = NULL; in bnxt_free_vnic_attributes()
3692 if (vnic->rss_table) { in bnxt_free_vnic_attributes()
3693 dma_free_coherent(&pdev->dev, vnic->rss_table_size, in bnxt_free_vnic_attributes()
3694 vnic->rss_table, in bnxt_free_vnic_attributes()
3695 vnic->rss_table_dma_addr); in bnxt_free_vnic_attributes()
3696 vnic->rss_table = NULL; in bnxt_free_vnic_attributes()
3699 vnic->rss_hash_key = NULL; in bnxt_free_vnic_attributes()
3700 vnic->flags = 0; in bnxt_free_vnic_attributes()
3707 struct bnxt_vnic_info *vnic; in bnxt_alloc_vnic_attributes() local
3712 vnic = &bp->vnic_info[i]; in bnxt_alloc_vnic_attributes()
3714 if (vnic->flags & BNXT_VNIC_UCAST_FLAG) { in bnxt_alloc_vnic_attributes()
3718 vnic->uc_list = kmalloc(mem_size, GFP_KERNEL); in bnxt_alloc_vnic_attributes()
3719 if (!vnic->uc_list) { in bnxt_alloc_vnic_attributes()
3726 if (vnic->flags & BNXT_VNIC_MCAST_FLAG) { in bnxt_alloc_vnic_attributes()
3727 vnic->mc_list_size = BNXT_MAX_MC_ADDRS * ETH_ALEN; in bnxt_alloc_vnic_attributes()
3728 vnic->mc_list = in bnxt_alloc_vnic_attributes()
3730 vnic->mc_list_size, in bnxt_alloc_vnic_attributes()
3731 &vnic->mc_list_mapping, in bnxt_alloc_vnic_attributes()
3733 if (!vnic->mc_list) { in bnxt_alloc_vnic_attributes()
3742 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_alloc_vnic_attributes()
3747 vnic->fw_grp_ids = kcalloc(max_rings, sizeof(u16), GFP_KERNEL); in bnxt_alloc_vnic_attributes()
3748 if (!vnic->fw_grp_ids) { in bnxt_alloc_vnic_attributes()
3754 !(vnic->flags & BNXT_VNIC_RSS_FLAG)) in bnxt_alloc_vnic_attributes()
3762 vnic->rss_table_size = size + HW_HASH_KEY_SIZE; in bnxt_alloc_vnic_attributes()
3763 vnic->rss_table = dma_alloc_coherent(&pdev->dev, in bnxt_alloc_vnic_attributes()
3764 vnic->rss_table_size, in bnxt_alloc_vnic_attributes()
3765 &vnic->rss_table_dma_addr, in bnxt_alloc_vnic_attributes()
3767 if (!vnic->rss_table) { in bnxt_alloc_vnic_attributes()
3772 vnic->rss_hash_key = ((void *)vnic->rss_table) + size; in bnxt_alloc_vnic_attributes()
3773 vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr + size; in bnxt_alloc_vnic_attributes()
4830 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_cfa_l2_set_rx_mask() local
4833 req.vnic_id = cpu_to_le32(vnic->fw_vnic_id); in bnxt_hwrm_cfa_l2_set_rx_mask()
4835 req.num_mc_entries = cpu_to_le32(vnic->mc_list_count); in bnxt_hwrm_cfa_l2_set_rx_mask()
4836 req.mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping); in bnxt_hwrm_cfa_l2_set_rx_mask()
4837 req.mask = cpu_to_le32(vnic->rx_mask); in bnxt_hwrm_cfa_l2_set_rx_mask()
4877 struct bnxt_vnic_info *vnic; in bnxt_hwrm_cfa_ntuple_filter_alloc() local
4888 vnic = &bp->vnic_info[fltr->rxq + 1]; in bnxt_hwrm_cfa_ntuple_filter_alloc()
4889 req.dst_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_cfa_ntuple_filter_alloc()
4983 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_hwrm_clear_vnic_filter() local
4985 for (j = 0; j < vnic->uc_filter_count; j++) { in bnxt_hwrm_clear_vnic_filter()
4991 req.l2_filter_id = vnic->fw_l2_filter_id[j]; in bnxt_hwrm_clear_vnic_filter()
4996 vnic->uc_filter_count = 0; in bnxt_hwrm_clear_vnic_filter()
5005 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_tpa() local
5009 if (vnic->fw_vnic_id == INVALID_HW_RING_ID) in bnxt_hwrm_vnic_set_tpa()
5057 req.vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_tpa()
5157 static void __bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic) in __bnxt_fill_hw_rss_tbl() argument
5159 bool no_rss = !(vnic->flags & BNXT_VNIC_RSS_FLAG); in __bnxt_fill_hw_rss_tbl()
5166 vnic->rss_table[i] = cpu_to_le16(vnic->fw_grp_ids[j]); in __bnxt_fill_hw_rss_tbl()
5171 struct bnxt_vnic_info *vnic) in __bnxt_fill_hw_rss_tbl_p5() argument
5173 __le16 *ring_tbl = vnic->rss_table; in __bnxt_fill_hw_rss_tbl_p5()
5192 static void bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic) in bnxt_fill_hw_rss_tbl() argument
5195 __bnxt_fill_hw_rss_tbl_p5(bp, vnic); in bnxt_fill_hw_rss_tbl()
5197 __bnxt_fill_hw_rss_tbl(bp, vnic); in bnxt_fill_hw_rss_tbl()
5202 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_rss() local
5206 vnic->fw_rss_cos_lb_ctx[0] == INVALID_HW_RING_ID) in bnxt_hwrm_vnic_set_rss()
5211 bnxt_fill_hw_rss_tbl(bp, vnic); in bnxt_hwrm_vnic_set_rss()
5214 req.ring_grp_tbl_addr = cpu_to_le64(vnic->rss_table_dma_addr); in bnxt_hwrm_vnic_set_rss()
5216 cpu_to_le64(vnic->rss_hash_key_dma_addr); in bnxt_hwrm_vnic_set_rss()
5218 req.rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]); in bnxt_hwrm_vnic_set_rss()
5224 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_rss_p5() local
5230 req.vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_rss_p5()
5235 bnxt_fill_hw_rss_tbl(bp, vnic); in bnxt_hwrm_vnic_set_rss_p5()
5238 req.hash_key_tbl_addr = cpu_to_le64(vnic->rss_hash_key_dma_addr); in bnxt_hwrm_vnic_set_rss_p5()
5239 ring_tbl_map = vnic->rss_table_dma_addr; in bnxt_hwrm_vnic_set_rss_p5()
5246 req.rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[i]); in bnxt_hwrm_vnic_set_rss_p5()
5256 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_hds() local
5269 req.vnic_id = cpu_to_le32(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_hds()
5291 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_hwrm_vnic_ctx_free() local
5294 if (vnic->fw_rss_cos_lb_ctx[j] != INVALID_HW_RING_ID) in bnxt_hwrm_vnic_ctx_free()
5331 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_cfg() local
5351 if (vnic->fw_rss_cos_lb_ctx[0] != INVALID_HW_RING_ID) { in bnxt_hwrm_vnic_cfg()
5352 req.rss_rule = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]); in bnxt_hwrm_vnic_cfg()
5355 } else if (vnic->flags & BNXT_VNIC_RFS_NEW_RSS_FLAG) { in bnxt_hwrm_vnic_cfg()
5366 (vnic->fw_rss_cos_lb_ctx[0] != INVALID_HW_RING_ID)) { in bnxt_hwrm_vnic_cfg()
5367 req.cos_rule = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[1]); in bnxt_hwrm_vnic_cfg()
5373 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_hwrm_vnic_cfg()
5375 else if (vnic->flags & BNXT_VNIC_RFS_FLAG) in bnxt_hwrm_vnic_cfg()
5386 req.vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_cfg()
5429 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_alloc() local
5442 vnic->fw_grp_ids[j] = bp->grp_info[grp_idx].fw_grp_id; in bnxt_hwrm_vnic_alloc()
5447 vnic->fw_rss_cos_lb_ctx[i] = INVALID_HW_RING_ID; in bnxt_hwrm_vnic_alloc()
5456 vnic->fw_vnic_id = le32_to_cpu(resp->vnic_id); in bnxt_hwrm_vnic_alloc()
6207 int cp, int stat, int vnic) in bnxt_hwrm_reserve_rings() argument
6211 vnic); in bnxt_hwrm_reserve_rings()
6214 vnic); in bnxt_hwrm_reserve_rings()
6278 int vnic = 1, grp = rx; in bnxt_need_reserve_rings() local
6294 vnic = rx + 1; in bnxt_need_reserve_rings()
6299 hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat || in bnxt_need_reserve_rings()
6316 int vnic = 1, stat; in __bnxt_reserve_rings() local
6325 vnic = rx + 1; in __bnxt_reserve_rings()
6331 rc = bnxt_hwrm_reserve_rings(bp, tx, rx, grp, cp, stat, vnic); in __bnxt_reserve_rings()
6340 vnic = hw_resc->resv_vnics; in __bnxt_reserve_rings()
6387 if (!tx || !rx || !cp || !grp || !vnic || !stat) in __bnxt_reserve_rings()
8132 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in __bnxt_setup_vnic() local
8135 if (vnic->flags & BNXT_VNIC_RFS_NEW_RSS_FLAG) in __bnxt_setup_vnic()
8242 struct bnxt_vnic_info *vnic; in bnxt_alloc_rfs_vnics() local
8249 vnic = &bp->vnic_info[vnic_id]; in bnxt_alloc_rfs_vnics()
8250 vnic->flags |= BNXT_VNIC_RFS_FLAG; in bnxt_alloc_rfs_vnics()
8252 vnic->flags |= BNXT_VNIC_RFS_NEW_RSS_FLAG; in bnxt_alloc_rfs_vnics()
8304 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_init_chip() local
8364 vnic->uc_filter_count = 1; in bnxt_init_chip()
8366 vnic->rx_mask = 0; in bnxt_init_chip()
8368 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_BCAST; in bnxt_init_chip()
8371 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; in bnxt_init_chip()
8374 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; in bnxt_init_chip()
8375 vnic->mc_list_count = 0; in bnxt_init_chip()
8380 vnic->rx_mask |= mask; in bnxt_init_chip()
10256 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_mc_list_updated() local
10266 vnic->mc_list_count = 0; in bnxt_mc_list_updated()
10270 if (!ether_addr_equal(haddr, vnic->mc_list + off)) { in bnxt_mc_list_updated()
10271 memcpy(vnic->mc_list + off, haddr, ETH_ALEN); in bnxt_mc_list_updated()
10280 if (mc_count != vnic->mc_list_count) { in bnxt_mc_list_updated()
10281 vnic->mc_list_count = mc_count; in bnxt_mc_list_updated()
10290 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_uc_list_updated() local
10294 if (netdev_uc_count(dev) != (vnic->uc_filter_count - 1)) in bnxt_uc_list_updated()
10298 if (!ether_addr_equal(ha->addr, vnic->uc_list + off)) in bnxt_uc_list_updated()
10309 struct bnxt_vnic_info *vnic; in bnxt_set_rx_mode() local
10317 vnic = &bp->vnic_info[0]; in bnxt_set_rx_mode()
10318 mask = vnic->rx_mask; in bnxt_set_rx_mode()
10333 vnic->mc_list_count = 0; in bnxt_set_rx_mode()
10338 if (mask != vnic->rx_mask || uc_update || mc_update) { in bnxt_set_rx_mode()
10339 vnic->rx_mask = mask; in bnxt_set_rx_mode()
10349 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_cfg_rx_mode() local
10362 for (i = 1; i < vnic->uc_filter_count; i++) { in bnxt_cfg_rx_mode()
10368 req.l2_filter_id = vnic->fw_l2_filter_id[i]; in bnxt_cfg_rx_mode()
10375 vnic->uc_filter_count = 1; in bnxt_cfg_rx_mode()
10379 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; in bnxt_cfg_rx_mode()
10382 memcpy(vnic->uc_list + off, ha->addr, ETH_ALEN); in bnxt_cfg_rx_mode()
10384 vnic->uc_filter_count++; in bnxt_cfg_rx_mode()
10389 for (i = 1, off = 0; i < vnic->uc_filter_count; i++, off += ETH_ALEN) { in bnxt_cfg_rx_mode()
10390 rc = bnxt_hwrm_set_vnic_filter(bp, 0, i, vnic->uc_list + off); in bnxt_cfg_rx_mode()
10394 vnic->uc_filter_count = i; in bnxt_cfg_rx_mode()
10401 if (rc && vnic->mc_list_count) { in bnxt_cfg_rx_mode()
10404 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; in bnxt_cfg_rx_mode()
10405 vnic->mc_list_count = 0; in bnxt_cfg_rx_mode()
11959 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_rx_flow_steer() local
11963 for (j = 0; j < vnic->uc_filter_count; j++, off += ETH_ALEN) { in bnxt_rx_flow_steer()
11965 vnic->uc_list + off)) { in bnxt_rx_flow_steer()