Lines Matching refs:vnic

3868 		struct bnxt_vnic_info *vnic = &bp->vnic_info[i];  in bnxt_init_vnics()  local
3871 vnic->fw_vnic_id = INVALID_HW_RING_ID; in bnxt_init_vnics()
3873 vnic->fw_rss_cos_lb_ctx[j] = INVALID_HW_RING_ID; in bnxt_init_vnics()
3875 vnic->fw_l2_ctx_id = INVALID_HW_RING_ID; in bnxt_init_vnics()
3879 get_random_bytes(vnic->rss_hash_key, in bnxt_init_vnics()
3882 memcpy(vnic->rss_hash_key, in bnxt_init_vnics()
4049 struct bnxt_vnic_info *vnic; in bnxt_free_vnic_attributes() local
4056 vnic = &bp->vnic_info[i]; in bnxt_free_vnic_attributes()
4058 kfree(vnic->fw_grp_ids); in bnxt_free_vnic_attributes()
4059 vnic->fw_grp_ids = NULL; in bnxt_free_vnic_attributes()
4061 kfree(vnic->uc_list); in bnxt_free_vnic_attributes()
4062 vnic->uc_list = NULL; in bnxt_free_vnic_attributes()
4064 if (vnic->mc_list) { in bnxt_free_vnic_attributes()
4065 dma_free_coherent(&pdev->dev, vnic->mc_list_size, in bnxt_free_vnic_attributes()
4066 vnic->mc_list, vnic->mc_list_mapping); in bnxt_free_vnic_attributes()
4067 vnic->mc_list = NULL; in bnxt_free_vnic_attributes()
4070 if (vnic->rss_table) { in bnxt_free_vnic_attributes()
4071 dma_free_coherent(&pdev->dev, vnic->rss_table_size, in bnxt_free_vnic_attributes()
4072 vnic->rss_table, in bnxt_free_vnic_attributes()
4073 vnic->rss_table_dma_addr); in bnxt_free_vnic_attributes()
4074 vnic->rss_table = NULL; in bnxt_free_vnic_attributes()
4077 vnic->rss_hash_key = NULL; in bnxt_free_vnic_attributes()
4078 vnic->flags = 0; in bnxt_free_vnic_attributes()
4085 struct bnxt_vnic_info *vnic; in bnxt_alloc_vnic_attributes() local
4090 vnic = &bp->vnic_info[i]; in bnxt_alloc_vnic_attributes()
4092 if (vnic->flags & BNXT_VNIC_UCAST_FLAG) { in bnxt_alloc_vnic_attributes()
4096 vnic->uc_list = kmalloc(mem_size, GFP_KERNEL); in bnxt_alloc_vnic_attributes()
4097 if (!vnic->uc_list) { in bnxt_alloc_vnic_attributes()
4104 if (vnic->flags & BNXT_VNIC_MCAST_FLAG) { in bnxt_alloc_vnic_attributes()
4105 vnic->mc_list_size = BNXT_MAX_MC_ADDRS * ETH_ALEN; in bnxt_alloc_vnic_attributes()
4106 vnic->mc_list = in bnxt_alloc_vnic_attributes()
4108 vnic->mc_list_size, in bnxt_alloc_vnic_attributes()
4109 &vnic->mc_list_mapping, in bnxt_alloc_vnic_attributes()
4111 if (!vnic->mc_list) { in bnxt_alloc_vnic_attributes()
4120 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_alloc_vnic_attributes()
4125 vnic->fw_grp_ids = kcalloc(max_rings, sizeof(u16), GFP_KERNEL); in bnxt_alloc_vnic_attributes()
4126 if (!vnic->fw_grp_ids) { in bnxt_alloc_vnic_attributes()
4132 !(vnic->flags & BNXT_VNIC_RSS_FLAG)) in bnxt_alloc_vnic_attributes()
4140 vnic->rss_table_size = size + HW_HASH_KEY_SIZE; in bnxt_alloc_vnic_attributes()
4141 vnic->rss_table = dma_alloc_coherent(&pdev->dev, in bnxt_alloc_vnic_attributes()
4142 vnic->rss_table_size, in bnxt_alloc_vnic_attributes()
4143 &vnic->rss_table_dma_addr, in bnxt_alloc_vnic_attributes()
4145 if (!vnic->rss_table) { in bnxt_alloc_vnic_attributes()
4150 vnic->rss_hash_key = ((void *)vnic->rss_table) + size; in bnxt_alloc_vnic_attributes()
4151 vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr + size; in bnxt_alloc_vnic_attributes()
4917 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_cfa_l2_set_rx_mask() local
4924 req->vnic_id = cpu_to_le32(vnic->fw_vnic_id); in bnxt_hwrm_cfa_l2_set_rx_mask()
4925 if (vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_MCAST) { in bnxt_hwrm_cfa_l2_set_rx_mask()
4926 req->num_mc_entries = cpu_to_le32(vnic->mc_list_count); in bnxt_hwrm_cfa_l2_set_rx_mask()
4927 req->mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping); in bnxt_hwrm_cfa_l2_set_rx_mask()
4929 req->mask = cpu_to_le32(vnic->rx_mask); in bnxt_hwrm_cfa_l2_set_rx_mask()
4973 struct bnxt_vnic_info *vnic; in bnxt_hwrm_cfa_ntuple_filter_alloc() local
4987 vnic = &bp->vnic_info[fltr->rxq + 1]; in bnxt_hwrm_cfa_ntuple_filter_alloc()
4988 req->dst_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_cfa_ntuple_filter_alloc()
5087 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_hwrm_clear_vnic_filter() local
5089 for (j = 0; j < vnic->uc_filter_count; j++) { in bnxt_hwrm_clear_vnic_filter()
5090 req->l2_filter_id = vnic->fw_l2_filter_id[j]; in bnxt_hwrm_clear_vnic_filter()
5094 vnic->uc_filter_count = 0; in bnxt_hwrm_clear_vnic_filter()
5102 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_tpa() local
5107 if (vnic->fw_vnic_id == INVALID_HW_RING_ID) in bnxt_hwrm_vnic_set_tpa()
5157 req->vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_tpa()
5257 static void bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic) in bnxt_fill_hw_rss_tbl() argument
5259 bool no_rss = !(vnic->flags & BNXT_VNIC_RSS_FLAG); in bnxt_fill_hw_rss_tbl()
5266 vnic->rss_table[i] = cpu_to_le16(vnic->fw_grp_ids[j]); in bnxt_fill_hw_rss_tbl()
5271 struct bnxt_vnic_info *vnic) in bnxt_fill_hw_rss_tbl_p5() argument
5273 __le16 *ring_tbl = vnic->rss_table; in bnxt_fill_hw_rss_tbl_p5()
5294 struct bnxt_vnic_info *vnic) in __bnxt_hwrm_vnic_set_rss() argument
5297 bnxt_fill_hw_rss_tbl_p5(bp, vnic); in __bnxt_hwrm_vnic_set_rss()
5299 bnxt_fill_hw_rss_tbl(bp, vnic); in __bnxt_hwrm_vnic_set_rss()
5311 req->ring_grp_tbl_addr = cpu_to_le64(vnic->rss_table_dma_addr); in __bnxt_hwrm_vnic_set_rss()
5312 req->hash_key_tbl_addr = cpu_to_le64(vnic->rss_hash_key_dma_addr); in __bnxt_hwrm_vnic_set_rss()
5317 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_rss() local
5322 vnic->fw_rss_cos_lb_ctx[0] == INVALID_HW_RING_ID) in bnxt_hwrm_vnic_set_rss()
5330 __bnxt_hwrm_vnic_set_rss(bp, req, vnic); in bnxt_hwrm_vnic_set_rss()
5331 req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]); in bnxt_hwrm_vnic_set_rss()
5337 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_rss_p5() local
5347 req->vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_rss_p5()
5351 __bnxt_hwrm_vnic_set_rss(bp, req, vnic); in bnxt_hwrm_vnic_set_rss_p5()
5352 ring_tbl_map = vnic->rss_table_dma_addr; in bnxt_hwrm_vnic_set_rss_p5()
5359 req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[i]); in bnxt_hwrm_vnic_set_rss_p5()
5372 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_hwrm_update_rss_hash_cfg() local
5380 req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]); in bnxt_hwrm_update_rss_hash_cfg()
5391 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_set_hds() local
5412 req->vnic_id = cpu_to_le32(vnic->fw_vnic_id); in bnxt_hwrm_vnic_set_hds()
5436 struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; in bnxt_hwrm_vnic_ctx_free() local
5439 if (vnic->fw_rss_cos_lb_ctx[j] != INVALID_HW_RING_ID) in bnxt_hwrm_vnic_ctx_free()
5475 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_cfg() local
5499 if (vnic->fw_rss_cos_lb_ctx[0] != INVALID_HW_RING_ID) { in bnxt_hwrm_vnic_cfg()
5500 req->rss_rule = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]); in bnxt_hwrm_vnic_cfg()
5503 } else if (vnic->flags & BNXT_VNIC_RFS_NEW_RSS_FLAG) { in bnxt_hwrm_vnic_cfg()
5514 (vnic->fw_rss_cos_lb_ctx[0] != INVALID_HW_RING_ID)) { in bnxt_hwrm_vnic_cfg()
5515 req->cos_rule = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[1]); in bnxt_hwrm_vnic_cfg()
5521 if (vnic->flags & BNXT_VNIC_RSS_FLAG) in bnxt_hwrm_vnic_cfg()
5523 else if (vnic->flags & BNXT_VNIC_RFS_FLAG) in bnxt_hwrm_vnic_cfg()
5534 req->vnic_id = cpu_to_le16(vnic->fw_vnic_id); in bnxt_hwrm_vnic_cfg()
5576 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in bnxt_hwrm_vnic_alloc() local
5596 vnic->fw_grp_ids[j] = bp->grp_info[grp_idx].fw_grp_id; in bnxt_hwrm_vnic_alloc()
5601 vnic->fw_rss_cos_lb_ctx[i] = INVALID_HW_RING_ID; in bnxt_hwrm_vnic_alloc()
5608 vnic->fw_vnic_id = le32_to_cpu(resp->vnic_id); in bnxt_hwrm_vnic_alloc()
6398 int cp, int stat, int vnic) in bnxt_hwrm_reserve_rings() argument
6402 vnic); in bnxt_hwrm_reserve_rings()
6405 vnic); in bnxt_hwrm_reserve_rings()
6469 int vnic = 1, grp = rx; in bnxt_need_reserve_rings() local
6485 vnic = rx + 1; in bnxt_need_reserve_rings()
6490 hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat || in bnxt_need_reserve_rings()
6507 int vnic = 1, stat; in __bnxt_reserve_rings() local
6516 vnic = rx + 1; in __bnxt_reserve_rings()
6522 rc = bnxt_hwrm_reserve_rings(bp, tx, rx, grp, cp, stat, vnic); in __bnxt_reserve_rings()
6531 vnic = hw_resc->resv_vnics; in __bnxt_reserve_rings()
6578 if (!tx || !rx || !cp || !grp || !vnic || !stat) in __bnxt_reserve_rings()
8636 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; in __bnxt_setup_vnic() local
8639 if (vnic->flags & BNXT_VNIC_RFS_NEW_RSS_FLAG) in __bnxt_setup_vnic()
8746 struct bnxt_vnic_info *vnic; in bnxt_alloc_rfs_vnics() local
8753 vnic = &bp->vnic_info[vnic_id]; in bnxt_alloc_rfs_vnics()
8754 vnic->flags |= BNXT_VNIC_RFS_FLAG; in bnxt_alloc_rfs_vnics()
8756 vnic->flags |= BNXT_VNIC_RFS_NEW_RSS_FLAG; in bnxt_alloc_rfs_vnics()
8808 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_init_chip() local
8873 vnic->uc_filter_count = 1; in bnxt_init_chip()
8875 vnic->rx_mask = 0; in bnxt_init_chip()
8880 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_BCAST; in bnxt_init_chip()
8883 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; in bnxt_init_chip()
8886 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; in bnxt_init_chip()
8887 vnic->mc_list_count = 0; in bnxt_init_chip()
8892 vnic->rx_mask |= mask; in bnxt_init_chip()
10971 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_mc_list_updated() local
10981 vnic->mc_list_count = 0; in bnxt_mc_list_updated()
10985 if (!ether_addr_equal(haddr, vnic->mc_list + off)) { in bnxt_mc_list_updated()
10986 memcpy(vnic->mc_list + off, haddr, ETH_ALEN); in bnxt_mc_list_updated()
10995 if (mc_count != vnic->mc_list_count) { in bnxt_mc_list_updated()
10996 vnic->mc_list_count = mc_count; in bnxt_mc_list_updated()
11005 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_uc_list_updated() local
11009 if (netdev_uc_count(dev) != (vnic->uc_filter_count - 1)) in bnxt_uc_list_updated()
11013 if (!ether_addr_equal(ha->addr, vnic->uc_list + off)) in bnxt_uc_list_updated()
11024 struct bnxt_vnic_info *vnic; in bnxt_set_rx_mode() local
11032 vnic = &bp->vnic_info[0]; in bnxt_set_rx_mode()
11033 mask = vnic->rx_mask; in bnxt_set_rx_mode()
11048 vnic->mc_list_count = 0; in bnxt_set_rx_mode()
11053 if (mask != vnic->rx_mask || uc_update || mc_update) { in bnxt_set_rx_mode()
11054 vnic->rx_mask = mask; in bnxt_set_rx_mode()
11064 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_cfg_rx_mode() local
11081 for (i = 1; i < vnic->uc_filter_count; i++) { in bnxt_cfg_rx_mode()
11082 req->l2_filter_id = vnic->fw_l2_filter_id[i]; in bnxt_cfg_rx_mode()
11088 vnic->uc_filter_count = 1; in bnxt_cfg_rx_mode()
11092 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; in bnxt_cfg_rx_mode()
11095 memcpy(vnic->uc_list + off, ha->addr, ETH_ALEN); in bnxt_cfg_rx_mode()
11097 vnic->uc_filter_count++; in bnxt_cfg_rx_mode()
11102 for (i = 1, off = 0; i < vnic->uc_filter_count; i++, off += ETH_ALEN) { in bnxt_cfg_rx_mode()
11103 rc = bnxt_hwrm_set_vnic_filter(bp, 0, i, vnic->uc_list + off); in bnxt_cfg_rx_mode()
11114 vnic->uc_filter_count = i; in bnxt_cfg_rx_mode()
11122 if ((vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS) && in bnxt_cfg_rx_mode()
11124 vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; in bnxt_cfg_rx_mode()
11126 if (rc && (vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_MCAST)) { in bnxt_cfg_rx_mode()
11129 vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_MCAST; in bnxt_cfg_rx_mode()
11130 vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; in bnxt_cfg_rx_mode()
11131 vnic->mc_list_count = 0; in bnxt_cfg_rx_mode()
12916 struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; in bnxt_rx_flow_steer() local
12920 for (j = 0; j < vnic->uc_filter_count; j++, off += ETH_ALEN) { in bnxt_rx_flow_steer()
12922 vnic->uc_list + off)) { in bnxt_rx_flow_steer()