Lines Matching +full:hsi +full:- +full:mac

3  * Copyright 2009-2013 Broadcom Corporation
10 * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
35 tl->type = type; in bnx2x_add_tlv()
36 tl->length = length; in bnx2x_add_tlv()
43 mutex_lock(&bp->vf2pf_mutex); in bnx2x_vfpf_prep()
49 memset(bp->vf2pf_mbox, 0, sizeof(struct bnx2x_vf_mbx_msg)); in bnx2x_vfpf_prep()
52 bnx2x_add_tlv(bp, &first_tlv->tl, 0, type, length); in bnx2x_vfpf_prep()
55 first_tlv->resp_msg_offset = sizeof(bp->vf2pf_mbox->req); in bnx2x_vfpf_prep()
63 first_tlv->tl.type); in bnx2x_vfpf_finalize()
65 mutex_unlock(&bp->vf2pf_mutex); in bnx2x_vfpf_finalize()
75 if (tlv->type == req_tlv) in bnx2x_search_tlv_list()
78 if (!tlv->length) { in bnx2x_search_tlv_list()
83 tlvs_list += tlv->length; in bnx2x_search_tlv_list()
85 } while (tlv->type != CHANNEL_TLV_LIST_END); in bnx2x_search_tlv_list()
98 while (tlv->type != CHANNEL_TLV_LIST_END) { in bnx2x_dp_tlv_list()
101 tlv->type, tlv->length); in bnx2x_dp_tlv_list()
104 tlvs_list += tlv->length; in bnx2x_dp_tlv_list()
120 tlv->type, tlv->length); in bnx2x_dp_tlv_list()
134 case -ENOMEM: in bnx2x_pfvf_status_codes()
150 return -EINVAL; in bnx2x_send_msg2pf()
157 if (bp->old_bulletin.valid_bitmap & 1 << CHANNEL_DOWN) { in bnx2x_send_msg2pf()
160 return -EINVAL; in bnx2x_send_msg2pf()
165 &zone_data->non_trigger.vf_pf_channel.msg_addr_lo); in bnx2x_send_msg2pf()
167 &zone_data->non_trigger.vf_pf_channel.msg_addr_hi); in bnx2x_send_msg2pf()
173 writeb_relaxed(1, &zone_data->trigger.vf_pf_channel.addr_valid); in bnx2x_send_msg2pf()
178 tout -= 1; in bnx2x_send_msg2pf()
180 /* progress indicator - HV can take its own sweet time in in bnx2x_send_msg2pf()
188 return -EAGAIN; in bnx2x_send_msg2pf()
201 me_reg = readl(bp->doorbells); in bnx2x_get_vf_id()
209 } while (tout-- > 0); in bnx2x_get_vf_id()
213 return -EINVAL; in bnx2x_get_vf_id()
226 struct vfpf_acquire_tlv *req = &bp->vf2pf_mbox->req.acquire; in bnx2x_vfpf_acquire()
227 struct pfvf_acquire_resp_tlv *resp = &bp->vf2pf_mbox->resp.acquire_resp; in bnx2x_vfpf_acquire()
234 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_ACQUIRE, sizeof(*req)); in bnx2x_vfpf_acquire()
237 rc = -EAGAIN; in bnx2x_vfpf_acquire()
241 req->vfdev_info.vf_id = vf_id; in bnx2x_vfpf_acquire()
242 req->vfdev_info.vf_os = 0; in bnx2x_vfpf_acquire()
243 req->vfdev_info.fp_hsi_ver = ETH_FP_HSI_VERSION; in bnx2x_vfpf_acquire()
245 req->resc_request.num_rxqs = rx_count; in bnx2x_vfpf_acquire()
246 req->resc_request.num_txqs = tx_count; in bnx2x_vfpf_acquire()
247 req->resc_request.num_sbs = bp->igu_sb_cnt; in bnx2x_vfpf_acquire()
248 req->resc_request.num_mac_filters = VF_ACQUIRE_MAC_FILTERS; in bnx2x_vfpf_acquire()
249 req->resc_request.num_mc_filters = VF_ACQUIRE_MC_FILTERS; in bnx2x_vfpf_acquire()
250 req->resc_request.num_vlan_filters = VF_ACQUIRE_VLAN_FILTERS; in bnx2x_vfpf_acquire()
253 req->bulletin_addr = bp->pf2vf_bulletin_mapping; in bnx2x_vfpf_acquire()
256 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, in bnx2x_vfpf_acquire()
260 req->vfdev_info.caps |= VF_CAP_SUPPORT_EXT_BULLETIN; in bnx2x_vfpf_acquire()
262 req->vfdev_info.caps |= VF_CAP_SUPPORT_VLAN_FILTER; in bnx2x_vfpf_acquire()
266 req->first_tlv.tl.length + sizeof(struct channel_tlv), in bnx2x_vfpf_acquire()
278 &resp->hdr.status, in bnx2x_vfpf_acquire()
279 bp->vf2pf_mbox_mapping); in bnx2x_vfpf_acquire()
286 memcpy(&bp->acquire_resp, resp, sizeof(bp->acquire_resp)); in bnx2x_vfpf_acquire()
293 if (bp->acquire_resp.hdr.status == PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_acquire()
296 } else if (bp->acquire_resp.hdr.status == in bnx2x_vfpf_acquire()
303 req->resc_request.num_txqs = in bnx2x_vfpf_acquire()
304 min(req->resc_request.num_txqs, in bnx2x_vfpf_acquire()
305 bp->acquire_resp.resc.num_txqs); in bnx2x_vfpf_acquire()
306 req->resc_request.num_rxqs = in bnx2x_vfpf_acquire()
307 min(req->resc_request.num_rxqs, in bnx2x_vfpf_acquire()
308 bp->acquire_resp.resc.num_rxqs); in bnx2x_vfpf_acquire()
309 req->resc_request.num_sbs = in bnx2x_vfpf_acquire()
310 min(req->resc_request.num_sbs, in bnx2x_vfpf_acquire()
311 bp->acquire_resp.resc.num_sbs); in bnx2x_vfpf_acquire()
312 req->resc_request.num_mac_filters = in bnx2x_vfpf_acquire()
313 min(req->resc_request.num_mac_filters, in bnx2x_vfpf_acquire()
314 bp->acquire_resp.resc.num_mac_filters); in bnx2x_vfpf_acquire()
315 req->resc_request.num_vlan_filters = in bnx2x_vfpf_acquire()
316 min(req->resc_request.num_vlan_filters, in bnx2x_vfpf_acquire()
317 bp->acquire_resp.resc.num_vlan_filters); in bnx2x_vfpf_acquire()
318 req->resc_request.num_mc_filters = in bnx2x_vfpf_acquire()
319 min(req->resc_request.num_mc_filters, in bnx2x_vfpf_acquire()
320 bp->acquire_resp.resc.num_mc_filters); in bnx2x_vfpf_acquire()
323 memset(&bp->vf2pf_mbox->resp, 0, in bnx2x_vfpf_acquire()
329 if (fp_hsi_resp && !fp_hsi_resp->is_supported) in bnx2x_vfpf_acquire()
330 …BNX2X_ERR("Old hypervisor - doesn't support current fastpath HSI version; Need to downgrade VF dri… in bnx2x_vfpf_acquire()
333 bp->acquire_resp.hdr.status); in bnx2x_vfpf_acquire()
334 rc = -EAGAIN; in bnx2x_vfpf_acquire()
344 memcpy(bp->phys_port_id, phys_port_resp->id, ETH_ALEN); in bnx2x_vfpf_acquire()
345 bp->flags |= HAS_PHYS_PORT_ID; in bnx2x_vfpf_acquire()
350 * supported by such a hypervisor [i.e., v0-v2]. in bnx2x_vfpf_acquire()
355 BNX2X_ERR("Old hypervisor - need to downgrade VF's driver\n"); in bnx2x_vfpf_acquire()
360 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_acquire()
363 rc = -EINVAL; in bnx2x_vfpf_acquire()
368 bp->common.chip_id |= (bp->acquire_resp.pfdev_info.chip_num & 0xffff); in bnx2x_vfpf_acquire()
369 bp->link_params.chip_id = bp->common.chip_id; in bnx2x_vfpf_acquire()
370 bp->db_size = bp->acquire_resp.pfdev_info.db_size; in bnx2x_vfpf_acquire()
371 bp->common.int_block = INT_BLOCK_IGU; in bnx2x_vfpf_acquire()
372 bp->common.chip_port_mode = CHIP_2_PORT_MODE; in bnx2x_vfpf_acquire()
373 bp->igu_dsb_id = -1; in bnx2x_vfpf_acquire()
374 bp->mf_ov = 0; in bnx2x_vfpf_acquire()
375 bp->mf_mode = 0; in bnx2x_vfpf_acquire()
376 bp->common.flash_size = 0; in bnx2x_vfpf_acquire()
377 bp->flags |= in bnx2x_vfpf_acquire()
379 bp->igu_sb_cnt = bp->acquire_resp.resc.num_sbs; in bnx2x_vfpf_acquire()
380 bp->igu_base_sb = bp->acquire_resp.resc.hw_sbs[0].hw_sb_id; in bnx2x_vfpf_acquire()
381 bp->vlan_credit = bp->acquire_resp.resc.num_vlan_filters; in bnx2x_vfpf_acquire()
383 strscpy(bp->fw_ver, bp->acquire_resp.pfdev_info.fw_ver, in bnx2x_vfpf_acquire()
384 sizeof(bp->fw_ver)); in bnx2x_vfpf_acquire()
386 if (is_valid_ether_addr(bp->acquire_resp.resc.current_mac_addr)) in bnx2x_vfpf_acquire()
387 eth_hw_addr_set(bp->dev, in bnx2x_vfpf_acquire()
388 bp->acquire_resp.resc.current_mac_addr); in bnx2x_vfpf_acquire()
391 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_acquire()
397 struct vfpf_release_tlv *req = &bp->vf2pf_mbox->req.release; in bnx2x_vfpf_release()
398 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_release()
402 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_RELEASE, sizeof(*req)); in bnx2x_vfpf_release()
405 rc = -EAGAIN; in bnx2x_vfpf_release()
409 req->vf_id = vf_id; in bnx2x_vfpf_release()
412 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_release()
419 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_release()
425 if (resp->hdr.status == PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_release()
430 BNX2X_ERR("PF failed our release request - are we out of sync? Response status: %d\n", in bnx2x_vfpf_release()
431 resp->hdr.status); in bnx2x_vfpf_release()
432 rc = -EAGAIN; in bnx2x_vfpf_release()
436 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_release()
444 struct vfpf_init_tlv *req = &bp->vf2pf_mbox->req.init; in bnx2x_vfpf_init()
445 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_init()
449 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_INIT, sizeof(*req)); in bnx2x_vfpf_init()
453 req->sb_addr[i] = (dma_addr_t)bnx2x_fp(bp, i, in bnx2x_vfpf_init()
456 /* statistics - requests only supports single queue for now */ in bnx2x_vfpf_init()
457 req->stats_addr = bp->fw_stats_data_mapping + in bnx2x_vfpf_init()
460 req->stats_stride = sizeof(struct per_queue_stats); in bnx2x_vfpf_init()
463 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_init()
469 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_init()
473 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_init()
475 resp->hdr.status); in bnx2x_vfpf_init()
476 rc = -EAGAIN; in bnx2x_vfpf_init()
482 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_init()
487 /* CLOSE VF - opposite to INIT_VF */
490 struct vfpf_close_tlv *req = &bp->vf2pf_mbox->req.close; in bnx2x_vfpf_close_vf()
491 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_close_vf()
505 /* remove mac */ in bnx2x_vfpf_close_vf()
506 bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr, bp->fp->index, false); in bnx2x_vfpf_close_vf()
509 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_CLOSE, sizeof(*req)); in bnx2x_vfpf_close_vf()
511 req->vf_id = vf_id; in bnx2x_vfpf_close_vf()
514 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_close_vf()
520 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_close_vf()
525 else if (resp->hdr.status != PFVF_STATUS_SUCCESS) in bnx2x_vfpf_close_vf()
527 resp->hdr.status); in bnx2x_vfpf_close_vf()
529 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_close_vf()
532 if (!bp->nic_stopped) { in bnx2x_vfpf_close_vf()
540 bp->nic_stopped = true; in bnx2x_vfpf_close_vf()
548 u8 func_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_leading_vfq_init()
550 /* mac */ in bnx2x_leading_vfq_init()
551 bnx2x_init_mac_obj(bp, &q->mac_obj, in bnx2x_leading_vfq_init()
552 cl_id, q->cid, func_id, in bnx2x_leading_vfq_init()
556 &vf->filter_state, in bnx2x_leading_vfq_init()
558 &vf->vf_macs_pool); in bnx2x_leading_vfq_init()
560 bnx2x_init_vlan_obj(bp, &q->vlan_obj, in bnx2x_leading_vfq_init()
561 cl_id, q->cid, func_id, in bnx2x_leading_vfq_init()
565 &vf->filter_state, in bnx2x_leading_vfq_init()
567 &vf->vf_vlans_pool); in bnx2x_leading_vfq_init()
568 /* vlan-mac */ in bnx2x_leading_vfq_init()
569 bnx2x_init_vlan_mac_obj(bp, &q->vlan_mac_obj, in bnx2x_leading_vfq_init()
570 cl_id, q->cid, func_id, in bnx2x_leading_vfq_init()
574 &vf->filter_state, in bnx2x_leading_vfq_init()
576 &vf->vf_macs_pool, in bnx2x_leading_vfq_init()
577 &vf->vf_vlans_pool); in bnx2x_leading_vfq_init()
579 bnx2x_init_mcast_obj(bp, &vf->mcast_obj, cl_id, in bnx2x_leading_vfq_init()
580 q->cid, func_id, func_id, in bnx2x_leading_vfq_init()
584 &vf->filter_state, in bnx2x_leading_vfq_init()
588 bnx2x_init_rss_config_obj(bp, &vf->rss_conf_obj, cl_id, q->cid, in bnx2x_leading_vfq_init()
593 &vf->filter_state, in bnx2x_leading_vfq_init()
596 vf->leading_rss = cl_id; in bnx2x_leading_vfq_init()
597 q->is_leading = true; in bnx2x_leading_vfq_init()
598 q->sp_initialized = true; in bnx2x_leading_vfq_init()
605 struct vfpf_setup_q_tlv *req = &bp->vf2pf_mbox->req.setup_q; in bnx2x_vfpf_setup_q()
606 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_setup_q()
607 u8 fp_idx = fp->index; in bnx2x_vfpf_setup_q()
612 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_SETUP_Q, sizeof(*req)); in bnx2x_vfpf_setup_q()
615 if (fp->mode != TPA_MODE_DISABLED) { in bnx2x_vfpf_setup_q()
618 if (fp->mode == TPA_MODE_GRO) in bnx2x_vfpf_setup_q()
632 req->vf_qid = fp_idx; in bnx2x_vfpf_setup_q()
633 req->param_valid = VFPF_RXQ_VALID | VFPF_TXQ_VALID; in bnx2x_vfpf_setup_q()
636 req->rxq.rcq_addr = fp->rx_comp_mapping; in bnx2x_vfpf_setup_q()
637 req->rxq.rcq_np_addr = fp->rx_comp_mapping + BCM_PAGE_SIZE; in bnx2x_vfpf_setup_q()
638 req->rxq.rxq_addr = fp->rx_desc_mapping; in bnx2x_vfpf_setup_q()
639 req->rxq.sge_addr = fp->rx_sge_mapping; in bnx2x_vfpf_setup_q()
640 req->rxq.vf_sb = fp_idx; in bnx2x_vfpf_setup_q()
641 req->rxq.sb_index = HC_INDEX_ETH_RX_CQ_CONS; in bnx2x_vfpf_setup_q()
642 req->rxq.hc_rate = bp->rx_ticks ? 1000000/bp->rx_ticks : 0; in bnx2x_vfpf_setup_q()
643 req->rxq.mtu = bp->dev->mtu; in bnx2x_vfpf_setup_q()
644 req->rxq.buf_sz = fp->rx_buf_size; in bnx2x_vfpf_setup_q()
645 req->rxq.sge_buf_sz = BCM_PAGE_SIZE * PAGES_PER_SGE; in bnx2x_vfpf_setup_q()
646 req->rxq.tpa_agg_sz = tpa_agg_size; in bnx2x_vfpf_setup_q()
647 req->rxq.max_sge_pkt = SGE_PAGE_ALIGN(bp->dev->mtu) >> SGE_PAGE_SHIFT; in bnx2x_vfpf_setup_q()
648 req->rxq.max_sge_pkt = ((req->rxq.max_sge_pkt + PAGES_PER_SGE - 1) & in bnx2x_vfpf_setup_q()
649 (~(PAGES_PER_SGE-1))) >> PAGES_PER_SGE_SHIFT; in bnx2x_vfpf_setup_q()
650 req->rxq.flags = flags; in bnx2x_vfpf_setup_q()
651 req->rxq.drop_flags = 0; in bnx2x_vfpf_setup_q()
652 req->rxq.cache_line_log = BNX2X_RX_ALIGN_SHIFT; in bnx2x_vfpf_setup_q()
653 req->rxq.stat_id = -1; /* No stats at the moment */ in bnx2x_vfpf_setup_q()
656 req->txq.txq_addr = fp->txdata_ptr[FIRST_TX_COS_INDEX]->tx_desc_mapping; in bnx2x_vfpf_setup_q()
657 req->txq.vf_sb = fp_idx; in bnx2x_vfpf_setup_q()
658 req->txq.sb_index = HC_INDEX_ETH_TX_CQ_CONS_COS0; in bnx2x_vfpf_setup_q()
659 req->txq.hc_rate = bp->tx_ticks ? 1000000/bp->tx_ticks : 0; in bnx2x_vfpf_setup_q()
660 req->txq.flags = flags; in bnx2x_vfpf_setup_q()
661 req->txq.traffic_type = LLFC_TRAFFIC_TYPE_NW; in bnx2x_vfpf_setup_q()
664 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_setup_q()
670 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_setup_q()
675 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_setup_q()
677 fp_idx, resp->hdr.status); in bnx2x_vfpf_setup_q()
678 rc = -EINVAL; in bnx2x_vfpf_setup_q()
681 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_setup_q()
688 struct vfpf_q_op_tlv *req = &bp->vf2pf_mbox->req.q_op; in bnx2x_vfpf_teardown_queue()
689 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_teardown_queue()
693 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_TEARDOWN_Q, in bnx2x_vfpf_teardown_queue()
696 req->vf_qid = qidx; in bnx2x_vfpf_teardown_queue()
699 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_teardown_queue()
705 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_teardown_queue()
714 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_teardown_queue()
716 resp->hdr.status); in bnx2x_vfpf_teardown_queue()
717 rc = -EINVAL; in bnx2x_vfpf_teardown_queue()
721 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_teardown_queue()
726 /* request pf to add a mac for the vf */
729 struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters; in bnx2x_vfpf_config_mac()
730 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_config_mac()
731 struct pf_vf_bulletin_content bulletin = bp->pf2vf_bulletin->content; in bnx2x_vfpf_config_mac()
735 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_SET_Q_FILTERS, in bnx2x_vfpf_config_mac()
738 req->flags = VFPF_SET_Q_FILTERS_MAC_VLAN_CHANGED; in bnx2x_vfpf_config_mac()
739 req->vf_qid = vf_qid; in bnx2x_vfpf_config_mac()
740 req->n_mac_vlan_filters = 1; in bnx2x_vfpf_config_mac()
742 req->filters[0].flags = VFPF_Q_FILTER_DEST_MAC_VALID; in bnx2x_vfpf_config_mac()
744 req->filters[0].flags |= VFPF_Q_FILTER_SET; in bnx2x_vfpf_config_mac()
746 /* sample bulletin board for new mac */ in bnx2x_vfpf_config_mac()
749 /* copy mac from device to request */ in bnx2x_vfpf_config_mac()
750 memcpy(req->filters[0].mac, addr, ETH_ALEN); in bnx2x_vfpf_config_mac()
753 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_config_mac()
760 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_config_mac()
766 /* failure may mean PF was configured with a new mac for us */ in bnx2x_vfpf_config_mac()
767 while (resp->hdr.status == PFVF_STATUS_FAILURE) { in bnx2x_vfpf_config_mac()
769 "vfpf SET MAC failed. Check bulletin board for new posts\n"); in bnx2x_vfpf_config_mac()
771 /* copy mac from bulletin to device */ in bnx2x_vfpf_config_mac()
772 eth_hw_addr_set(bp->dev, bulletin.mac); in bnx2x_vfpf_config_mac()
776 /* copy mac from device to request */ in bnx2x_vfpf_config_mac()
777 memcpy(req->filters[0].mac, bp->dev->dev_addr, in bnx2x_vfpf_config_mac()
781 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, in bnx2x_vfpf_config_mac()
782 bp->vf2pf_mbox_mapping); in bnx2x_vfpf_config_mac()
789 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_config_mac()
790 BNX2X_ERR("vfpf SET MAC failed: %d\n", resp->hdr.status); in bnx2x_vfpf_config_mac()
791 rc = -EINVAL; in bnx2x_vfpf_config_mac()
794 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_config_mac()
803 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_config_rss()
804 struct vfpf_rss_tlv *req = &bp->vf2pf_mbox->req.update_rss; in bnx2x_vfpf_config_rss()
808 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_UPDATE_RSS, in bnx2x_vfpf_config_rss()
812 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_config_rss()
815 memcpy(req->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE); in bnx2x_vfpf_config_rss()
816 memcpy(req->rss_key, params->rss_key, sizeof(params->rss_key)); in bnx2x_vfpf_config_rss()
817 req->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE; in bnx2x_vfpf_config_rss()
818 req->rss_key_size = T_ETH_RSS_KEY; in bnx2x_vfpf_config_rss()
819 req->rss_result_mask = params->rss_result_mask; in bnx2x_vfpf_config_rss()
822 if (params->rss_flags & (1 << BNX2X_RSS_MODE_DISABLED)) in bnx2x_vfpf_config_rss()
823 req->rss_flags |= VFPF_RSS_MODE_DISABLED; in bnx2x_vfpf_config_rss()
824 if (params->rss_flags & (1 << BNX2X_RSS_MODE_REGULAR)) in bnx2x_vfpf_config_rss()
825 req->rss_flags |= VFPF_RSS_MODE_REGULAR; in bnx2x_vfpf_config_rss()
826 if (params->rss_flags & (1 << BNX2X_RSS_SET_SRCH)) in bnx2x_vfpf_config_rss()
827 req->rss_flags |= VFPF_RSS_SET_SRCH; in bnx2x_vfpf_config_rss()
828 if (params->rss_flags & (1 << BNX2X_RSS_IPV4)) in bnx2x_vfpf_config_rss()
829 req->rss_flags |= VFPF_RSS_IPV4; in bnx2x_vfpf_config_rss()
830 if (params->rss_flags & (1 << BNX2X_RSS_IPV4_TCP)) in bnx2x_vfpf_config_rss()
831 req->rss_flags |= VFPF_RSS_IPV4_TCP; in bnx2x_vfpf_config_rss()
832 if (params->rss_flags & (1 << BNX2X_RSS_IPV4_UDP)) in bnx2x_vfpf_config_rss()
833 req->rss_flags |= VFPF_RSS_IPV4_UDP; in bnx2x_vfpf_config_rss()
834 if (params->rss_flags & (1 << BNX2X_RSS_IPV6)) in bnx2x_vfpf_config_rss()
835 req->rss_flags |= VFPF_RSS_IPV6; in bnx2x_vfpf_config_rss()
836 if (params->rss_flags & (1 << BNX2X_RSS_IPV6_TCP)) in bnx2x_vfpf_config_rss()
837 req->rss_flags |= VFPF_RSS_IPV6_TCP; in bnx2x_vfpf_config_rss()
838 if (params->rss_flags & (1 << BNX2X_RSS_IPV6_UDP)) in bnx2x_vfpf_config_rss()
839 req->rss_flags |= VFPF_RSS_IPV6_UDP; in bnx2x_vfpf_config_rss()
841 DP(BNX2X_MSG_IOV, "rss flags %x\n", req->rss_flags); in bnx2x_vfpf_config_rss()
847 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_config_rss()
853 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_config_rss()
859 "Failed to send rss message to PF over VF-PF channel [%d]\n", in bnx2x_vfpf_config_rss()
860 resp->hdr.status); in bnx2x_vfpf_config_rss()
863 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_config_rss()
871 struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters; in bnx2x_vfpf_set_mcast()
872 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_set_mcast()
876 if (bp->state != BNX2X_STATE_OPEN) { in bnx2x_vfpf_set_mcast()
877 DP(NETIF_MSG_IFUP, "state is %x, returning\n", bp->state); in bnx2x_vfpf_set_mcast()
878 return -EINVAL; in bnx2x_vfpf_set_mcast()
882 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_SET_Q_FILTERS, in bnx2x_vfpf_set_mcast()
886 DP(NETIF_MSG_IFUP, "dev->flags = %x\n", dev->flags); in bnx2x_vfpf_set_mcast()
891 "VF supports not more than %d multicast MAC addresses\n", in bnx2x_vfpf_set_mcast()
893 rc = -EINVAL; in bnx2x_vfpf_set_mcast()
898 DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n", in bnx2x_vfpf_set_mcast()
900 memcpy(req->multicast[i], bnx2x_mc_addr(ha), ETH_ALEN); in bnx2x_vfpf_set_mcast()
904 req->n_multicast = i; in bnx2x_vfpf_set_mcast()
905 req->flags |= VFPF_SET_Q_FILTERS_MULTICAST_CHANGED; in bnx2x_vfpf_set_mcast()
906 req->vf_qid = 0; in bnx2x_vfpf_set_mcast()
909 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_set_mcast()
914 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_set_mcast()
920 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_set_mcast()
922 resp->hdr.status); in bnx2x_vfpf_set_mcast()
923 rc = -EINVAL; in bnx2x_vfpf_set_mcast()
926 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_set_mcast()
934 struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters; in bnx2x_vfpf_update_vlan()
935 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_update_vlan()
938 if (!(bp->acquire_resp.pfdev_info.pf_cap & PFVF_CAP_VLAN_FILTER)) { in bnx2x_vfpf_update_vlan()
944 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_SET_Q_FILTERS, in bnx2x_vfpf_update_vlan()
947 req->flags = VFPF_SET_Q_FILTERS_MAC_VLAN_CHANGED; in bnx2x_vfpf_update_vlan()
948 req->vf_qid = vf_qid; in bnx2x_vfpf_update_vlan()
949 req->n_mac_vlan_filters = 1; in bnx2x_vfpf_update_vlan()
951 req->filters[0].flags = VFPF_Q_FILTER_VLAN_TAG_VALID; in bnx2x_vfpf_update_vlan()
954 req->filters[0].flags |= VFPF_Q_FILTER_SET; in bnx2x_vfpf_update_vlan()
959 if (bp->shadow_bulletin.content.valid_bitmap & 1 << VLAN_VALID) { in bnx2x_vfpf_update_vlan()
961 rc = -EINVAL; in bnx2x_vfpf_update_vlan()
965 req->filters[0].vlan_tag = vid; in bnx2x_vfpf_update_vlan()
968 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_update_vlan()
975 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_update_vlan()
981 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_update_vlan()
984 rc = -EINVAL; in bnx2x_vfpf_update_vlan()
987 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_update_vlan()
994 int mode = bp->rx_mode; in bnx2x_vfpf_storm_rx_mode()
995 struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters; in bnx2x_vfpf_storm_rx_mode()
996 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; in bnx2x_vfpf_storm_rx_mode()
1000 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_SET_Q_FILTERS, in bnx2x_vfpf_storm_rx_mode()
1007 req->rx_mask = VFPF_RX_MASK_ACCEPT_NONE; in bnx2x_vfpf_storm_rx_mode()
1012 req->rx_mask = VFPF_RX_MASK_ACCEPT_MATCHED_MULTICAST; in bnx2x_vfpf_storm_rx_mode()
1013 req->rx_mask |= VFPF_RX_MASK_ACCEPT_MATCHED_UNICAST; in bnx2x_vfpf_storm_rx_mode()
1014 req->rx_mask |= VFPF_RX_MASK_ACCEPT_BROADCAST; in bnx2x_vfpf_storm_rx_mode()
1016 req->rx_mask |= VFPF_RX_MASK_ACCEPT_ANY_VLAN; in bnx2x_vfpf_storm_rx_mode()
1019 if (bp->accept_any_vlan) in bnx2x_vfpf_storm_rx_mode()
1020 req->rx_mask |= VFPF_RX_MASK_ACCEPT_ANY_VLAN; in bnx2x_vfpf_storm_rx_mode()
1022 req->flags |= VFPF_SET_Q_FILTERS_RX_MASK_CHANGED; in bnx2x_vfpf_storm_rx_mode()
1023 req->vf_qid = 0; in bnx2x_vfpf_storm_rx_mode()
1026 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, in bnx2x_vfpf_storm_rx_mode()
1032 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); in bnx2x_vfpf_storm_rx_mode()
1036 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in bnx2x_vfpf_storm_rx_mode()
1037 BNX2X_ERR("Set Rx mode failed: %d\n", resp->hdr.status); in bnx2x_vfpf_storm_rx_mode()
1038 rc = -EINVAL; in bnx2x_vfpf_storm_rx_mode()
1041 bnx2x_vfpf_finalize(bp, &req->first_tlv); in bnx2x_vfpf_storm_rx_mode()
1063 /* enable vf_pf mailbox (aka vf-pf-channel) */
1088 if (!bp->dmae_ready) { in bnx2x_copy32_vf_dmae()
1128 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_single_tlv()
1132 type = mbx->first_tlv.tl.type; in bnx2x_vf_mbx_resp_single_tlv()
1136 bnx2x_add_tlv(bp, &mbx->msg->resp, 0, type, length); in bnx2x_vf_mbx_resp_single_tlv()
1137 bnx2x_add_tlv(bp, &mbx->msg->resp, length, CHANNEL_TLV_LIST_END, in bnx2x_vf_mbx_resp_single_tlv()
1145 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_send_msg()
1146 struct pfvf_general_resp_tlv *resp = &mbx->msg->resp.general_resp; in bnx2x_vf_mbx_resp_send_msg()
1153 mbx->vf_addr_hi, mbx->vf_addr_lo, mbx->first_tlv.resp_msg_offset); in bnx2x_vf_mbx_resp_send_msg()
1155 resp->hdr.status = bnx2x_pfvf_status_codes(vf_rc); in bnx2x_vf_mbx_resp_send_msg()
1158 vf_addr = HILO_U64(mbx->vf_addr_hi, mbx->vf_addr_lo) + in bnx2x_vf_mbx_resp_send_msg()
1159 mbx->first_tlv.resp_msg_offset; in bnx2x_vf_mbx_resp_send_msg()
1160 pf_addr = mbx->msg_mapping + in bnx2x_vf_mbx_resp_send_msg()
1168 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1171 (sizeof(union pfvf_tlvs) - sizeof(u64))/4); in bnx2x_vf_mbx_resp_send_msg()
1174 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1177 vf_addr -= sizeof(u64); in bnx2x_vf_mbx_resp_send_msg()
1178 pf_addr -= sizeof(u64); in bnx2x_vf_mbx_resp_send_msg()
1181 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1183 /* copy the response header including status-done field, in bnx2x_vf_mbx_resp_send_msg()
1186 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1192 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_resp_send_msg()
1196 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1220 if (!(bp->flags & HAS_PHYS_PORT_ID)) in bnx2x_vf_mbx_resp_phys_port()
1228 memcpy(port_id->id, bp->phys_port_id, ETH_ALEN); in bnx2x_vf_mbx_resp_phys_port()
1248 fp_hsi->is_supported = (vf->fp_hsi > ETH_FP_HSI_VERSION) ? 0 : 1; in bnx2x_vf_mbx_resp_fp_hsi_ver()
1260 struct pfvf_acquire_resp_tlv *resp = &mbx->msg->resp.acquire_resp; in bnx2x_vf_mbx_acquire_resp()
1261 struct pf_vf_resc *resc = &resp->resc; in bnx2x_vf_mbx_acquire_resp()
1268 resp->pfdev_info.chip_num = bp->common.chip_id; in bnx2x_vf_mbx_acquire_resp()
1269 resp->pfdev_info.db_size = bp->db_size; in bnx2x_vf_mbx_acquire_resp()
1270 resp->pfdev_info.indices_per_sb = HC_SB_MAX_INDICES_E2; in bnx2x_vf_mbx_acquire_resp()
1271 resp->pfdev_info.pf_cap = (PFVF_CAP_RSS | in bnx2x_vf_mbx_acquire_resp()
1275 bnx2x_fill_fw_str(bp, resp->pfdev_info.fw_ver, in bnx2x_vf_mbx_acquire_resp()
1276 sizeof(resp->pfdev_info.fw_ver)); in bnx2x_vf_mbx_acquire_resp()
1283 resc->num_rxqs = vf_rxq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1285 resc->num_txqs = vf_txq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1287 resc->num_sbs = vf_sb_count(vf); in bnx2x_vf_mbx_acquire_resp()
1288 resc->num_mac_filters = vf_mac_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1289 resc->num_vlan_filters = vf_vlan_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1290 resc->num_mc_filters = 0; in bnx2x_vf_mbx_acquire_resp()
1295 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_acquire_resp()
1298 resc->hw_qid[i] = in bnx2x_vf_mbx_acquire_resp()
1302 resc->hw_sbs[i].hw_sb_id = vf_igu_sb(vf, i); in bnx2x_vf_mbx_acquire_resp()
1303 resc->hw_sbs[i].sb_qid = vf_hc_qzone(vf, i); in bnx2x_vf_mbx_acquire_resp()
1306 /* if a mac has been set for this vf, supply it */ in bnx2x_vf_mbx_acquire_resp()
1307 if (bulletin->valid_bitmap & 1 << MAC_ADDR_VALID) { in bnx2x_vf_mbx_acquire_resp()
1308 memcpy(resc->current_mac_addr, bulletin->mac, in bnx2x_vf_mbx_acquire_resp()
1314 …DP(BNX2X_MSG_IOV, "VF[%d] ACQUIRE_RESPONSE: pfdev_info- chip_num=0x%x, db_size=%d, idx_per_sb=%d, … in bnx2x_vf_mbx_acquire_resp()
1315 "resources- n_rxq-%d, n_txq-%d, n_sbs-%d, n_macs-%d, n_vlans-%d, n_mcs-%d, fw_ver: '%s'\n", in bnx2x_vf_mbx_acquire_resp()
1316 vf->abs_vfid, in bnx2x_vf_mbx_acquire_resp()
1317 resp->pfdev_info.chip_num, in bnx2x_vf_mbx_acquire_resp()
1318 resp->pfdev_info.db_size, in bnx2x_vf_mbx_acquire_resp()
1319 resp->pfdev_info.indices_per_sb, in bnx2x_vf_mbx_acquire_resp()
1320 resp->pfdev_info.pf_cap, in bnx2x_vf_mbx_acquire_resp()
1321 resc->num_rxqs, in bnx2x_vf_mbx_acquire_resp()
1322 resc->num_txqs, in bnx2x_vf_mbx_acquire_resp()
1323 resc->num_sbs, in bnx2x_vf_mbx_acquire_resp()
1324 resc->num_mac_filters, in bnx2x_vf_mbx_acquire_resp()
1325 resc->num_vlan_filters, in bnx2x_vf_mbx_acquire_resp()
1326 resc->num_mc_filters, in bnx2x_vf_mbx_acquire_resp()
1327 resp->pfdev_info.fw_ver); in bnx2x_vf_mbx_acquire_resp()
1329 DP_CONT(BNX2X_MSG_IOV, "hw_qids- [ "); in bnx2x_vf_mbx_acquire_resp()
1331 DP_CONT(BNX2X_MSG_IOV, "%d ", resc->hw_qid[i]); in bnx2x_vf_mbx_acquire_resp()
1332 DP_CONT(BNX2X_MSG_IOV, "], sb_info- [ "); in bnx2x_vf_mbx_acquire_resp()
1335 resc->hw_sbs[i].hw_sb_id, in bnx2x_vf_mbx_acquire_resp()
1336 resc->hw_sbs[i].sb_qid); in bnx2x_vf_mbx_acquire_resp()
1341 bnx2x_add_tlv(bp, &mbx->msg->resp, 0, CHANNEL_TLV_ACQUIRE, length); in bnx2x_vf_mbx_acquire_resp()
1347 if (bnx2x_search_tlv_list(bp, &mbx->msg->req, in bnx2x_vf_mbx_acquire_resp()
1349 bnx2x_vf_mbx_resp_phys_port(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1351 /* `New' vfs will want to know if fastpath HSI is supported, since in bnx2x_vf_mbx_acquire_resp()
1355 bnx2x_vf_mbx_resp_fp_hsi_ver(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1357 bnx2x_add_tlv(bp, &mbx->msg->resp, length, CHANNEL_TLV_LIST_END, in bnx2x_vf_mbx_acquire_resp()
1372 if (!acquire->bulletin_addr || in bnx2x_vf_mbx_is_windows_vm()
1373 acquire->resc_request.num_mc_filters == 32 || in bnx2x_vf_mbx_is_windows_vm()
1374 ((acquire->vfdev_info.vf_os & VF_OS_MASK) == in bnx2x_vf_mbx_is_windows_vm()
1388 if (bnx2x_search_tlv_list(bp, &mbx->msg->req, in bnx2x_vf_mbx_acquire_chk_dorq()
1393 if (bnx2x_vf_mbx_is_windows_vm(bp, &mbx->msg->req.acquire)) in bnx2x_vf_mbx_acquire_chk_dorq()
1396 return -EOPNOTSUPP; in bnx2x_vf_mbx_acquire_chk_dorq()
1403 struct vfpf_acquire_tlv *acquire = &mbx->msg->req.acquire; in bnx2x_vf_mbx_acquire()
1407 …"VF[%d] ACQUIRE: vfdev_info- vf_id %d, vf_os %d resources- n_rxq-%d, n_txq-%d, n_sbs-%d, n_macs-%d… in bnx2x_vf_mbx_acquire()
1408 vf->abs_vfid, acquire->vfdev_info.vf_id, acquire->vfdev_info.vf_os, in bnx2x_vf_mbx_acquire()
1409 acquire->resc_request.num_rxqs, acquire->resc_request.num_txqs, in bnx2x_vf_mbx_acquire()
1410 acquire->resc_request.num_sbs, acquire->resc_request.num_mac_filters, in bnx2x_vf_mbx_acquire()
1411 acquire->resc_request.num_vlan_filters, in bnx2x_vf_mbx_acquire()
1412 acquire->resc_request.num_mc_filters); in bnx2x_vf_mbx_acquire()
1415 * CIDs incorrectly requiring a VF-flr [VM reboot] in order to recover in bnx2x_vf_mbx_acquire()
1421 "VF [%d] - Can't support acquire request due to doorbell mismatch. Please update VM driver\n", in bnx2x_vf_mbx_acquire()
1422 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1426 /* Verify the VF fastpath HSI can be supported by the loaded FW. in bnx2x_vf_mbx_acquire()
1429 if (bnx2x_vf_mbx_is_windows_vm(bp, &mbx->msg->req.acquire)) in bnx2x_vf_mbx_acquire()
1430 vf->fp_hsi = acquire->vfdev_info.fp_hsi_ver; in bnx2x_vf_mbx_acquire()
1432 vf->fp_hsi = max_t(u8, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1434 if (vf->fp_hsi > ETH_FP_HSI_VERSION) { in bnx2x_vf_mbx_acquire()
1436 …"VF [%d] - Can't support acquire request since VF requests a FW version which is too new [%02x > %… in bnx2x_vf_mbx_acquire()
1437 vf->abs_vfid, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1439 rc = -EINVAL; in bnx2x_vf_mbx_acquire()
1444 rc = bnx2x_vf_acquire(bp, vf, &acquire->resc_request); in bnx2x_vf_mbx_acquire()
1447 vf->bulletin_map = acquire->bulletin_addr; in bnx2x_vf_mbx_acquire()
1448 if (acquire->vfdev_info.caps & VF_CAP_SUPPORT_EXT_BULLETIN) { in bnx2x_vf_mbx_acquire()
1450 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1451 vf->cfg_flags |= VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1453 vf->cfg_flags &= ~VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1456 if (acquire->vfdev_info.caps & VF_CAP_SUPPORT_VLAN_FILTER) { in bnx2x_vf_mbx_acquire()
1458 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1459 vf->cfg_flags |= VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1461 vf->cfg_flags &= ~VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1472 struct vfpf_init_tlv *init = &mbx->msg->req.init; in bnx2x_vf_mbx_init_vf()
1476 vf->fw_stat_map = init->stats_addr; in bnx2x_vf_mbx_init_vf()
1477 vf->stats_stride = init->stats_stride; in bnx2x_vf_mbx_init_vf()
1478 rc = bnx2x_vf_init(bp, vf, (dma_addr_t *)init->sb_addr); in bnx2x_vf_mbx_init_vf()
1481 if (init->flags & VFPF_INIT_FLG_STATS_COALESCE) in bnx2x_vf_mbx_init_vf()
1482 vf->cfg_flags |= VF_CFG_STATS_COALESCE; in bnx2x_vf_mbx_init_vf()
1485 if (vf->cfg_flags & VF_CFG_EXT_BULLETIN) in bnx2x_vf_mbx_init_vf()
1486 bnx2x_iov_link_update_vf(bp, vf->index); in bnx2x_vf_mbx_init_vf()
1492 /* convert MBX queue-flags to standard SP queue-flags */
1523 struct vfpf_setup_q_tlv *setup_q = &mbx->msg->req.setup_q; in bnx2x_vf_mbx_setup_q()
1528 if (setup_q->vf_qid >= vf_rxq_count(vf)) { in bnx2x_vf_mbx_setup_q()
1530 setup_q->vf_qid, vf_rxq_count(vf)); in bnx2x_vf_mbx_setup_q()
1531 rc = -EINVAL; in bnx2x_vf_mbx_setup_q()
1538 if (setup_q->param_valid & (VFPF_RXQ_VALID|VFPF_TXQ_VALID)) { in bnx2x_vf_mbx_setup_q()
1539 struct bnx2x_vf_queue *q = vfq_get(vf, setup_q->vf_qid); in bnx2x_vf_mbx_setup_q()
1548 /* re-init the VF operation context */ in bnx2x_vf_mbx_setup_q()
1555 __set_bit(BNX2X_Q_FLG_ACTIVE, &setup_p->flags); in bnx2x_vf_mbx_setup_q()
1557 if (setup_q->param_valid & VFPF_TXQ_VALID) { in bnx2x_vf_mbx_setup_q()
1559 &setup_p->txq_params; in bnx2x_vf_mbx_setup_q()
1564 q->sb_idx = setup_q->txq.vf_sb; in bnx2x_vf_mbx_setup_q()
1567 init_p->tx.hc_rate = setup_q->txq.hc_rate; in bnx2x_vf_mbx_setup_q()
1568 init_p->tx.sb_cq_index = setup_q->txq.sb_index; in bnx2x_vf_mbx_setup_q()
1570 bnx2x_vf_mbx_set_q_flags(bp, setup_q->txq.flags, in bnx2x_vf_mbx_setup_q()
1571 &init_p->tx.flags); in bnx2x_vf_mbx_setup_q()
1573 /* tx setup - flags */ in bnx2x_vf_mbx_setup_q()
1574 bnx2x_vf_mbx_set_q_flags(bp, setup_q->txq.flags, in bnx2x_vf_mbx_setup_q()
1575 &setup_p->flags); in bnx2x_vf_mbx_setup_q()
1577 /* tx setup - general, nothing */ in bnx2x_vf_mbx_setup_q()
1579 /* tx setup - tx */ in bnx2x_vf_mbx_setup_q()
1580 txq_params->dscr_map = setup_q->txq.txq_addr; in bnx2x_vf_mbx_setup_q()
1581 txq_params->sb_cq_index = setup_q->txq.sb_index; in bnx2x_vf_mbx_setup_q()
1582 txq_params->traffic_type = setup_q->txq.traffic_type; in bnx2x_vf_mbx_setup_q()
1585 q->index, q->sb_idx); in bnx2x_vf_mbx_setup_q()
1588 if (setup_q->param_valid & VFPF_RXQ_VALID) { in bnx2x_vf_mbx_setup_q()
1590 &setup_p->rxq_params; in bnx2x_vf_mbx_setup_q()
1597 q->sb_idx = setup_q->rxq.vf_sb; in bnx2x_vf_mbx_setup_q()
1600 init_p->rx.hc_rate = setup_q->rxq.hc_rate; in bnx2x_vf_mbx_setup_q()
1601 init_p->rx.sb_cq_index = setup_q->rxq.sb_index; in bnx2x_vf_mbx_setup_q()
1602 bnx2x_vf_mbx_set_q_flags(bp, setup_q->rxq.flags, in bnx2x_vf_mbx_setup_q()
1603 &init_p->rx.flags); in bnx2x_vf_mbx_setup_q()
1605 /* rx setup - flags */ in bnx2x_vf_mbx_setup_q()
1606 bnx2x_vf_mbx_set_q_flags(bp, setup_q->rxq.flags, in bnx2x_vf_mbx_setup_q()
1607 &setup_p->flags); in bnx2x_vf_mbx_setup_q()
1609 /* rx setup - general */ in bnx2x_vf_mbx_setup_q()
1610 setup_p->gen_params.mtu = setup_q->rxq.mtu; in bnx2x_vf_mbx_setup_q()
1612 /* rx setup - rx */ in bnx2x_vf_mbx_setup_q()
1613 rxq_params->drop_flags = setup_q->rxq.drop_flags; in bnx2x_vf_mbx_setup_q()
1614 rxq_params->dscr_map = setup_q->rxq.rxq_addr; in bnx2x_vf_mbx_setup_q()
1615 rxq_params->sge_map = setup_q->rxq.sge_addr; in bnx2x_vf_mbx_setup_q()
1616 rxq_params->rcq_map = setup_q->rxq.rcq_addr; in bnx2x_vf_mbx_setup_q()
1617 rxq_params->rcq_np_map = setup_q->rxq.rcq_np_addr; in bnx2x_vf_mbx_setup_q()
1618 rxq_params->buf_sz = setup_q->rxq.buf_sz; in bnx2x_vf_mbx_setup_q()
1619 rxq_params->tpa_agg_sz = setup_q->rxq.tpa_agg_sz; in bnx2x_vf_mbx_setup_q()
1620 rxq_params->max_sges_pkt = setup_q->rxq.max_sge_pkt; in bnx2x_vf_mbx_setup_q()
1621 rxq_params->sge_buf_sz = setup_q->rxq.sge_buf_sz; in bnx2x_vf_mbx_setup_q()
1622 rxq_params->cache_line_log = in bnx2x_vf_mbx_setup_q()
1623 setup_q->rxq.cache_line_log; in bnx2x_vf_mbx_setup_q()
1624 rxq_params->sb_cq_index = setup_q->rxq.sb_index; in bnx2x_vf_mbx_setup_q()
1626 /* rx setup - multicast engine */ in bnx2x_vf_mbx_setup_q()
1628 u8 mcast_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_vf_mbx_setup_q()
1630 rxq_params->mcast_engine_id = mcast_id; in bnx2x_vf_mbx_setup_q()
1631 __set_bit(BNX2X_Q_FLG_MCAST, &setup_p->flags); in bnx2x_vf_mbx_setup_q()
1635 q->index, q->sb_idx); in bnx2x_vf_mbx_setup_q()
1640 rc = bnx2x_vf_queue_setup(bp, vf, q->index, &qctor); in bnx2x_vf_mbx_setup_q()
1657 fl = kzalloc(struct_size(fl, filters, tlv->n_mac_vlan_filters), in bnx2x_vf_mbx_macvlan_list()
1660 return -ENOMEM; in bnx2x_vf_mbx_macvlan_list()
1662 for (i = 0, j = 0; i < tlv->n_mac_vlan_filters; i++) { in bnx2x_vf_mbx_macvlan_list()
1663 struct vfpf_q_mac_vlan_filter *msg_filter = &tlv->filters[i]; in bnx2x_vf_mbx_macvlan_list()
1665 if ((msg_filter->flags & type_flag) != type_flag) in bnx2x_vf_mbx_macvlan_list()
1667 memset(&fl->filters[j], 0, sizeof(fl->filters[j])); in bnx2x_vf_mbx_macvlan_list()
1669 fl->filters[j].mac = msg_filter->mac; in bnx2x_vf_mbx_macvlan_list()
1670 fl->filters[j].type |= BNX2X_VF_FILTER_MAC; in bnx2x_vf_mbx_macvlan_list()
1673 fl->filters[j].vid = msg_filter->vlan_tag; in bnx2x_vf_mbx_macvlan_list()
1674 fl->filters[j].type |= BNX2X_VF_FILTER_VLAN; in bnx2x_vf_mbx_macvlan_list()
1676 fl->filters[j].add = !!(msg_filter->flags & VFPF_Q_FILTER_SET); in bnx2x_vf_mbx_macvlan_list()
1677 fl->count++; in bnx2x_vf_mbx_macvlan_list()
1680 if (!fl->count) in bnx2x_vf_mbx_macvlan_list()
1693 for (i = 0; i < filters->n_mac_vlan_filters; i++) in bnx2x_vf_filters_contain()
1694 if ((filters->filters[i].flags & flags) == flags) in bnx2x_vf_filters_contain()
1703 DP(msglvl, "MAC-VLAN[%d] -- flags=0x%x\n", idx, filter->flags); in bnx2x_vf_mbx_dp_q_filter()
1704 if (filter->flags & VFPF_Q_FILTER_VLAN_TAG_VALID) in bnx2x_vf_mbx_dp_q_filter()
1705 DP_CONT(msglvl, ", vlan=%d", filter->vlan_tag); in bnx2x_vf_mbx_dp_q_filter()
1706 if (filter->flags & VFPF_Q_FILTER_DEST_MAC_VALID) in bnx2x_vf_mbx_dp_q_filter()
1707 DP_CONT(msglvl, ", MAC=%pM", filter->mac); in bnx2x_vf_mbx_dp_q_filter()
1716 if (filters->flags & VFPF_SET_Q_FILTERS_MAC_VLAN_CHANGED) in bnx2x_vf_mbx_dp_q_filters()
1717 for (i = 0; i < filters->n_mac_vlan_filters; i++) in bnx2x_vf_mbx_dp_q_filters()
1719 &filters->filters[i]); in bnx2x_vf_mbx_dp_q_filters()
1721 if (filters->flags & VFPF_SET_Q_FILTERS_RX_MASK_CHANGED) in bnx2x_vf_mbx_dp_q_filters()
1722 DP(msglvl, "RX-MASK=0x%x\n", filters->rx_mask); in bnx2x_vf_mbx_dp_q_filters()
1724 if (filters->flags & VFPF_SET_Q_FILTERS_MULTICAST_CHANGED) in bnx2x_vf_mbx_dp_q_filters()
1725 for (i = 0; i < filters->n_multicast; i++) in bnx2x_vf_mbx_dp_q_filters()
1726 DP(msglvl, "MULTICAST=%pM\n", filters->multicast[i]); in bnx2x_vf_mbx_dp_q_filters()
1738 &BP_VF_MBX(bp, vf->index)->msg->req.set_q_filters; in bnx2x_vf_mbx_qfilters()
1740 /* check for any mac/vlan changes */ in bnx2x_vf_mbx_qfilters()
1741 if (msg->flags & VFPF_SET_Q_FILTERS_MAC_VLAN_CHANGED) { in bnx2x_vf_mbx_qfilters()
1744 /* build vlan-mac list */ in bnx2x_vf_mbx_qfilters()
1752 /* set vlan-mac list */ in bnx2x_vf_mbx_qfilters()
1754 msg->vf_qid, in bnx2x_vf_mbx_qfilters()
1760 /* build mac list */ in bnx2x_vf_mbx_qfilters()
1769 /* set mac list */ in bnx2x_vf_mbx_qfilters()
1771 msg->vf_qid, in bnx2x_vf_mbx_qfilters()
1788 msg->vf_qid, in bnx2x_vf_mbx_qfilters()
1796 if (msg->flags & VFPF_SET_Q_FILTERS_RX_MASK_CHANGED) { in bnx2x_vf_mbx_qfilters()
1799 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_qfilters()
1802 if (msg->rx_mask != VFPF_RX_MASK_ACCEPT_NONE) { in bnx2x_vf_mbx_qfilters()
1814 if (!(bulletin->valid_bitmap & (1 << VLAN_VALID)) && in bnx2x_vf_mbx_qfilters()
1815 (!(vf->cfg_flags & VF_CFG_VLAN_FILTER) || in bnx2x_vf_mbx_qfilters()
1816 msg->rx_mask & VFPF_RX_MASK_ACCEPT_ANY_VLAN)) in bnx2x_vf_mbx_qfilters()
1819 /* set rx-mode */ in bnx2x_vf_mbx_qfilters()
1820 rc = bnx2x_vf_rxmode(bp, vf, msg->vf_qid, accept); in bnx2x_vf_mbx_qfilters()
1825 if (msg->flags & VFPF_SET_Q_FILTERS_MULTICAST_CHANGED) { in bnx2x_vf_mbx_qfilters()
1827 rc = bnx2x_vf_mcast(bp, vf, msg->multicast, in bnx2x_vf_mbx_qfilters()
1828 msg->n_multicast, false); in bnx2x_vf_mbx_qfilters()
1835 vf->abs_vfid, msg->vf_qid, rc); in bnx2x_vf_mbx_qfilters()
1843 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_mac()
1846 /* if a mac was already set for this VF via the set vf mac ndo, we only in bnx2x_filters_validate_mac()
1847 * accept mac configurations of that mac. Why accept them at all? in bnx2x_filters_validate_mac()
1848 * because PF may have been unable to configure the mac at the time in bnx2x_filters_validate_mac()
1851 if (bulletin->valid_bitmap & 1 << MAC_ADDR_VALID) { in bnx2x_filters_validate_mac()
1855 for (i = 0; i < filters->n_mac_vlan_filters; i++) { in bnx2x_filters_validate_mac()
1856 if (!(filters->filters[i].flags & in bnx2x_filters_validate_mac()
1860 /* once a mac was set by ndo can only accept in bnx2x_filters_validate_mac()
1861 * a single mac... in bnx2x_filters_validate_mac()
1865 vf->abs_vfid, in bnx2x_filters_validate_mac()
1866 filters->n_mac_vlan_filters); in bnx2x_filters_validate_mac()
1867 rc = -EPERM; in bnx2x_filters_validate_mac()
1871 filter = &filters->filters[i]; in bnx2x_filters_validate_mac()
1874 /* ...and only the mac set by the ndo */ in bnx2x_filters_validate_mac()
1876 !ether_addr_equal(filter->mac, bulletin->mac)) { in bnx2x_filters_validate_mac()
1877 …BNX2X_ERR("VF[%d] requested the addition of a mac address not matching the one configured by set_v… in bnx2x_filters_validate_mac()
1878 vf->abs_vfid); in bnx2x_filters_validate_mac()
1880 rc = -EPERM; in bnx2x_filters_validate_mac()
1893 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_vlan()
1897 if (bulletin->valid_bitmap & 1 << VLAN_VALID) { in bnx2x_filters_validate_vlan()
1903 vf->abs_vfid); in bnx2x_filters_validate_vlan()
1904 rc = -EPERM; in bnx2x_filters_validate_vlan()
1910 if (filters->vf_qid > vf_rxq_count(vf)) { in bnx2x_filters_validate_vlan()
1911 rc = -EPERM; in bnx2x_filters_validate_vlan()
1923 struct vfpf_set_q_filters_tlv *filters = &mbx->msg->req.set_q_filters; in bnx2x_vf_mbx_set_q_filters()
1935 vf->abs_vfid, in bnx2x_vf_mbx_set_q_filters()
1936 filters->vf_qid); in bnx2x_vf_mbx_set_q_filters()
1949 int qid = mbx->msg->req.q_op.vf_qid; in bnx2x_vf_mbx_teardown_q()
1953 vf->abs_vfid, qid); in bnx2x_vf_mbx_teardown_q()
1964 DP(BNX2X_MSG_IOV, "VF[%d] VF_CLOSE\n", vf->abs_vfid); in bnx2x_vf_mbx_close_vf()
1975 DP(BNX2X_MSG_IOV, "VF[%d] VF_RELEASE\n", vf->abs_vfid); in bnx2x_vf_mbx_release_vf()
1985 struct vfpf_rss_tlv *rss_tlv = &mbx->msg->req.update_rss; in bnx2x_vf_mbx_update_rss()
1988 if (rss_tlv->ind_table_size != T_ETH_INDIRECTION_TABLE_SIZE || in bnx2x_vf_mbx_update_rss()
1989 rss_tlv->rss_key_size != T_ETH_RSS_KEY) { in bnx2x_vf_mbx_update_rss()
1991 vf->index); in bnx2x_vf_mbx_update_rss()
1992 rc = -EINVAL; in bnx2x_vf_mbx_update_rss()
1999 memcpy(rss.ind_table, rss_tlv->ind_table, in bnx2x_vf_mbx_update_rss()
2001 memcpy(rss.rss_key, rss_tlv->rss_key, sizeof(rss_tlv->rss_key)); in bnx2x_vf_mbx_update_rss()
2002 rss.rss_obj = &vf->rss_conf_obj; in bnx2x_vf_mbx_update_rss()
2003 rss.rss_result_mask = rss_tlv->rss_result_mask; in bnx2x_vf_mbx_update_rss()
2009 if (rss_tlv->rss_flags & VFPF_RSS_MODE_DISABLED) in bnx2x_vf_mbx_update_rss()
2011 if (rss_tlv->rss_flags & VFPF_RSS_MODE_REGULAR) in bnx2x_vf_mbx_update_rss()
2013 if (rss_tlv->rss_flags & VFPF_RSS_SET_SRCH) in bnx2x_vf_mbx_update_rss()
2015 if (rss_tlv->rss_flags & VFPF_RSS_IPV4) in bnx2x_vf_mbx_update_rss()
2017 if (rss_tlv->rss_flags & VFPF_RSS_IPV4_TCP) in bnx2x_vf_mbx_update_rss()
2019 if (rss_tlv->rss_flags & VFPF_RSS_IPV4_UDP) in bnx2x_vf_mbx_update_rss()
2021 if (rss_tlv->rss_flags & VFPF_RSS_IPV6) in bnx2x_vf_mbx_update_rss()
2023 if (rss_tlv->rss_flags & VFPF_RSS_IPV6_TCP) in bnx2x_vf_mbx_update_rss()
2025 if (rss_tlv->rss_flags & VFPF_RSS_IPV6_UDP) in bnx2x_vf_mbx_update_rss()
2028 if ((!(rss_tlv->rss_flags & VFPF_RSS_IPV4_TCP) && in bnx2x_vf_mbx_update_rss()
2029 rss_tlv->rss_flags & VFPF_RSS_IPV4_UDP) || in bnx2x_vf_mbx_update_rss()
2030 (!(rss_tlv->rss_flags & VFPF_RSS_IPV6_TCP) && in bnx2x_vf_mbx_update_rss()
2031 rss_tlv->rss_flags & VFPF_RSS_IPV6_UDP)) { in bnx2x_vf_mbx_update_rss()
2033 rc = -EINVAL; in bnx2x_vf_mbx_update_rss()
2047 if (tpa_tlv->tpa_client_info.max_sges_for_packet > in bnx2x_validate_tpa_params()
2049 rc = -EINVAL; in bnx2x_validate_tpa_params()
2051 tpa_tlv->tpa_client_info.max_sges_for_packet, in bnx2x_validate_tpa_params()
2055 if (tpa_tlv->tpa_client_info.max_tpa_queues > MAX_AGG_QS(bp)) { in bnx2x_validate_tpa_params()
2056 rc = -EINVAL; in bnx2x_validate_tpa_params()
2058 tpa_tlv->tpa_client_info.max_tpa_queues, in bnx2x_validate_tpa_params()
2069 struct vfpf_tpa_tlv *tpa_tlv = &mbx->msg->req.update_tpa; in bnx2x_vf_mbx_update_tpa()
2078 tpa_tlv->tpa_client_info.complete_on_both_clients; in bnx2x_vf_mbx_update_tpa()
2080 tpa_tlv->tpa_client_info.dont_verify_thr; in bnx2x_vf_mbx_update_tpa()
2082 tpa_tlv->tpa_client_info.max_agg_size; in bnx2x_vf_mbx_update_tpa()
2084 tpa_tlv->tpa_client_info.max_sges_for_packet; in bnx2x_vf_mbx_update_tpa()
2086 tpa_tlv->tpa_client_info.max_tpa_queues; in bnx2x_vf_mbx_update_tpa()
2088 tpa_tlv->tpa_client_info.sge_buff_size; in bnx2x_vf_mbx_update_tpa()
2090 tpa_tlv->tpa_client_info.sge_pause_thr_high; in bnx2x_vf_mbx_update_tpa()
2092 tpa_tlv->tpa_client_info.sge_pause_thr_low; in bnx2x_vf_mbx_update_tpa()
2094 tpa_tlv->tpa_client_info.tpa_mode; in bnx2x_vf_mbx_update_tpa()
2096 tpa_tlv->tpa_client_info.update_ipv4; in bnx2x_vf_mbx_update_tpa()
2098 tpa_tlv->tpa_client_info.update_ipv6; in bnx2x_vf_mbx_update_tpa()
2112 if (vf->state == VF_LOST) { in bnx2x_vf_mbx_request()
2118 "VF 0x%x lost, not handling the request\n", vf->abs_vfid); in bnx2x_vf_mbx_request()
2120 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2125 if (bnx2x_tlv_supported(mbx->first_tlv.tl.type)) { in bnx2x_vf_mbx_request()
2129 bnx2x_lock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2132 switch (mbx->first_tlv.tl.type) { in bnx2x_vf_mbx_request()
2163 /* unknown TLV - this may belong to a VF driver from the future in bnx2x_vf_mbx_request()
2164 * - a version written after this PF driver was written, which in bnx2x_vf_mbx_request()
2169 BNX2X_ERR("unknown TLV. type %d length %d vf->state was %d. first 20 bytes of mailbox buffer:\n", in bnx2x_vf_mbx_request()
2170 mbx->first_tlv.tl.type, mbx->first_tlv.tl.length, in bnx2x_vf_mbx_request()
2171 vf->state); in bnx2x_vf_mbx_request()
2174 mbx->msg->req.tlv_buf_size.tlv_buffer[i]); in bnx2x_vf_mbx_request()
2178 if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { in bnx2x_vf_mbx_request()
2186 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2188 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2199 vfpf_event->vf_id, vfpf_event->msg_addr_hi, vfpf_event->msg_addr_lo); in bnx2x_vf_mbx_schedule()
2203 if (vfpf_event->vf_id - BP_VFDB(bp)->sriov.first_vf_in_pf > in bnx2x_vf_mbx_schedule()
2206 vfpf_event->vf_id, BNX2X_NR_VIRTFN(bp)); in bnx2x_vf_mbx_schedule()
2210 vf_idx = bnx2x_vf_idx_by_abs_fid(bp, vfpf_event->vf_id); in bnx2x_vf_mbx_schedule()
2213 mutex_lock(&BP_VFDB(bp)->event_mutex); in bnx2x_vf_mbx_schedule()
2214 BP_VF_MBX(bp, vf_idx)->vf_addr_hi = in bnx2x_vf_mbx_schedule()
2215 le32_to_cpu(vfpf_event->msg_addr_hi); in bnx2x_vf_mbx_schedule()
2216 BP_VF_MBX(bp, vf_idx)->vf_addr_lo = in bnx2x_vf_mbx_schedule()
2217 le32_to_cpu(vfpf_event->msg_addr_lo); in bnx2x_vf_mbx_schedule()
2218 BP_VFDB(bp)->event_occur |= (1ULL << vf_idx); in bnx2x_vf_mbx_schedule()
2219 mutex_unlock(&BP_VFDB(bp)->event_mutex); in bnx2x_vf_mbx_schedule()
2224 /* handle new vf-pf messages */
2235 mutex_lock(&vfdb->event_mutex); in bnx2x_vf_mbx()
2236 events = vfdb->event_occur; in bnx2x_vf_mbx()
2237 vfdb->event_occur = 0; in bnx2x_vf_mbx()
2238 mutex_unlock(&vfdb->event_mutex); in bnx2x_vf_mbx()
2250 vf_idx, mbx->vf_addr_hi, mbx->vf_addr_lo, in bnx2x_vf_mbx()
2251 mbx->first_tlv.resp_msg_offset); in bnx2x_vf_mbx()
2254 rc = bnx2x_copy32_vf_dmae(bp, true, mbx->msg_mapping, in bnx2x_vf_mbx()
2255 vf->abs_vfid, mbx->vf_addr_hi, in bnx2x_vf_mbx()
2256 mbx->vf_addr_lo, in bnx2x_vf_mbx()
2260 vf->abs_vfid); in bnx2x_vf_mbx()
2266 mbx->first_tlv = mbx->msg->req.first_tlv; in bnx2x_vf_mbx()
2271 memset(&mbx->msg->resp, 0, sizeof(union pfvf_tlvs)); in bnx2x_vf_mbx()
2284 bulletin->length = support_long ? BULLETIN_CONTENT_SIZE : in bnx2x_vf_bulletin_finalize()
2286 bulletin->crc = bnx2x_crc_vf_bulletin(bulletin); in bnx2x_vf_bulletin_finalize()
2293 dma_addr_t pf_addr = BP_VF_BULLETIN_DMA(bp)->mapping + in bnx2x_post_vf_bulletin()
2304 bulletin->version++; in bnx2x_post_vf_bulletin()
2312 U64_LO(vf_addr), bulletin->length / 4); in bnx2x_post_vf_bulletin()