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

1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
3 * Copyright (c) 2015-2017 QLogic Corporation
4 * Copyright (c) 2019-2020 Marvell International Ltd.
15 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_prep()
23 mutex_lock(&(p_iov->mutex)); in qed_vf_pf_prep()
31 p_iov->offset = (u8 *)p_iov->vf2pf_request; in qed_vf_pf_prep()
33 /* Clear mailbox - both request and reply */ in qed_vf_pf_prep()
34 memset(p_iov->vf2pf_request, 0, sizeof(union vfpf_tlvs)); in qed_vf_pf_prep()
35 memset(p_iov->pf2vf_reply, 0, sizeof(union pfvf_tlvs)); in qed_vf_pf_prep()
38 p_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, type, length); in qed_vf_pf_prep()
41 ((struct vfpf_first_tlv *)p_tlv)->reply_address = in qed_vf_pf_prep()
42 (u64)p_iov->pf2vf_reply_phys; in qed_vf_pf_prep()
49 union pfvf_tlvs *resp = p_hwfn->vf_iov_info->pf2vf_reply; in qed_vf_pf_req_end()
53 req_status, resp->default_resp.hdr.status); in qed_vf_pf_req_end()
55 mutex_unlock(&(p_hwfn->vf_iov_info->mutex)); in qed_vf_pf_req_end()
65 union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request; in qed_send_msg2pf()
81 "VF -> PF [%02x] message: [%08x, %08x] --> %p, %08x --> %p\n", in qed_send_msg2pf()
82 GET_FIELD(p_hwfn->hw_info.concrete_fid, in qed_send_msg2pf()
84 upper_32_bits(p_hwfn->vf_iov_info->vf2pf_request_phys), in qed_send_msg2pf()
85 lower_32_bits(p_hwfn->vf_iov_info->vf2pf_request_phys), in qed_send_msg2pf()
86 &zone_data->non_trigger.vf_pf_msg_addr, in qed_send_msg2pf()
87 *((u32 *)&trigger), &zone_data->trigger); in qed_send_msg2pf()
90 (uintptr_t)&zone_data->non_trigger.vf_pf_msg_addr.lo, in qed_send_msg2pf()
91 lower_32_bits(p_hwfn->vf_iov_info->vf2pf_request_phys)); in qed_send_msg2pf()
94 (uintptr_t)&zone_data->non_trigger.vf_pf_msg_addr.hi, in qed_send_msg2pf()
95 upper_32_bits(p_hwfn->vf_iov_info->vf2pf_request_phys)); in qed_send_msg2pf()
102 REG_WR(p_hwfn, (uintptr_t)&zone_data->trigger, *((u32 *)&trigger)); in qed_send_msg2pf()
109 while (!*done && iter--) { in qed_send_msg2pf()
115 while (!*done && iter--) { in qed_send_msg2pf()
122 "VF <-- PF Timeout [Type %d]\n", in qed_send_msg2pf()
123 p_req->first_tlv.tl.type); in qed_send_msg2pf()
124 rc = -EBUSY; in qed_send_msg2pf()
130 *done, p_req->first_tlv.tl.type); in qed_send_msg2pf()
134 *done, p_req->first_tlv.tl.type); in qed_send_msg2pf()
143 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_add_qid()
147 if (!(p_iov->acquire_resp.pfdev_info.capabilities & in qed_vf_pf_add_qid()
151 p_qid_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_add_qid()
153 p_qid_tlv->qid = p_cid->qid_usage_idx; in qed_vf_pf_add_qid()
158 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in _qed_vf_pf_release()
168 qed_add_tlv(p_hwfn, &p_iov->offset, in _qed_vf_pf_release()
171 resp = &p_iov->pf2vf_reply->default_resp; in _qed_vf_pf_release()
172 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in _qed_vf_pf_release()
174 if (!rc && resp->hdr.status != PFVF_STATUS_SUCCESS) in _qed_vf_pf_release()
175 rc = -EAGAIN; in _qed_vf_pf_release()
181 p_hwfn->b_int_enabled = 0; in _qed_vf_pf_release()
183 if (p_iov->vf2pf_request) in _qed_vf_pf_release()
184 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in _qed_vf_pf_release()
186 p_iov->vf2pf_request, in _qed_vf_pf_release()
187 p_iov->vf2pf_request_phys); in _qed_vf_pf_release()
188 if (p_iov->pf2vf_reply) in _qed_vf_pf_release()
189 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in _qed_vf_pf_release()
191 p_iov->pf2vf_reply, p_iov->pf2vf_reply_phys); in _qed_vf_pf_release()
193 if (p_iov->bulletin.p_virt) { in _qed_vf_pf_release()
195 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in _qed_vf_pf_release()
197 p_iov->bulletin.p_virt, p_iov->bulletin.phys); in _qed_vf_pf_release()
200 kfree(p_hwfn->vf_iov_info); in _qed_vf_pf_release()
201 p_hwfn->vf_iov_info = NULL; in _qed_vf_pf_release()
218 …"PF unwilling to fulfill resource request: rxq [%02x/%02x] txq [%02x/%02x] sbs [%02x/%02x] mac [%0… in qed_vf_pf_acquire_reduce_resc()
219 p_req->num_rxqs, in qed_vf_pf_acquire_reduce_resc()
220 p_resp->num_rxqs, in qed_vf_pf_acquire_reduce_resc()
221 p_req->num_rxqs, in qed_vf_pf_acquire_reduce_resc()
222 p_resp->num_txqs, in qed_vf_pf_acquire_reduce_resc()
223 p_req->num_sbs, in qed_vf_pf_acquire_reduce_resc()
224 p_resp->num_sbs, in qed_vf_pf_acquire_reduce_resc()
225 p_req->num_mac_filters, in qed_vf_pf_acquire_reduce_resc()
226 p_resp->num_mac_filters, in qed_vf_pf_acquire_reduce_resc()
227 p_req->num_vlan_filters, in qed_vf_pf_acquire_reduce_resc()
228 p_resp->num_vlan_filters, in qed_vf_pf_acquire_reduce_resc()
229 p_req->num_mc_filters, in qed_vf_pf_acquire_reduce_resc()
230 p_resp->num_mc_filters, p_req->num_cids, p_resp->num_cids); in qed_vf_pf_acquire_reduce_resc()
233 p_req->num_txqs = p_resp->num_txqs; in qed_vf_pf_acquire_reduce_resc()
234 p_req->num_rxqs = p_resp->num_rxqs; in qed_vf_pf_acquire_reduce_resc()
235 p_req->num_sbs = p_resp->num_sbs; in qed_vf_pf_acquire_reduce_resc()
236 p_req->num_mac_filters = p_resp->num_mac_filters; in qed_vf_pf_acquire_reduce_resc()
237 p_req->num_vlan_filters = p_resp->num_vlan_filters; in qed_vf_pf_acquire_reduce_resc()
238 p_req->num_mc_filters = p_resp->num_mc_filters; in qed_vf_pf_acquire_reduce_resc()
239 p_req->num_cids = p_resp->num_cids; in qed_vf_pf_acquire_reduce_resc()
244 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_acquire()
245 struct pfvf_acquire_resp_tlv *resp = &p_iov->pf2vf_reply->acquire_resp; in qed_vf_pf_acquire()
246 struct pf_vf_pfdev_info *pfdev_info = &resp->pfdev_info; in qed_vf_pf_acquire()
255 p_resc = &req->resc_request; in qed_vf_pf_acquire()
258 req->vfdev_info.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_vf_pf_acquire()
260 p_resc->num_rxqs = QED_MAX_VF_CHAINS_PER_PF; in qed_vf_pf_acquire()
261 p_resc->num_txqs = QED_MAX_VF_CHAINS_PER_PF; in qed_vf_pf_acquire()
262 p_resc->num_sbs = QED_MAX_VF_CHAINS_PER_PF; in qed_vf_pf_acquire()
263 p_resc->num_mac_filters = QED_ETH_VF_NUM_MAC_FILTERS; in qed_vf_pf_acquire()
264 p_resc->num_vlan_filters = QED_ETH_VF_NUM_VLAN_FILTERS; in qed_vf_pf_acquire()
265 p_resc->num_cids = QED_ETH_VF_DEFAULT_NUM_CIDS; in qed_vf_pf_acquire()
267 req->vfdev_info.os_type = VFPF_ACQUIRE_OS_LINUX; in qed_vf_pf_acquire()
268 req->vfdev_info.fw_major = FW_MAJOR_VERSION; in qed_vf_pf_acquire()
269 req->vfdev_info.fw_minor = FW_MINOR_VERSION; in qed_vf_pf_acquire()
270 req->vfdev_info.fw_revision = FW_REVISION_VERSION; in qed_vf_pf_acquire()
271 req->vfdev_info.fw_engineering = FW_ENGINEERING_VERSION; in qed_vf_pf_acquire()
272 req->vfdev_info.eth_fp_hsi_major = ETH_HSI_VER_MAJOR; in qed_vf_pf_acquire()
273 req->vfdev_info.eth_fp_hsi_minor = ETH_HSI_VER_MINOR; in qed_vf_pf_acquire()
275 /* Fill capability field with any non-deprecated config we support */ in qed_vf_pf_acquire()
276 req->vfdev_info.capabilities |= VFPF_ACQUIRE_CAP_100G; in qed_vf_pf_acquire()
279 if (p_iov->b_doorbell_bar) { in qed_vf_pf_acquire()
280 req->vfdev_info.capabilities |= VFPF_ACQUIRE_CAP_PHYSICAL_BAR | in qed_vf_pf_acquire()
282 p_resc->num_cids = QED_ETH_VF_MAX_NUM_CIDS; in qed_vf_pf_acquire()
286 req->bulletin_addr = p_iov->bulletin.phys; in qed_vf_pf_acquire()
287 req->bulletin_size = p_iov->bulletin.size; in qed_vf_pf_acquire()
290 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_acquire()
297 /* Clear response buffer, as this might be a re-send */ in qed_vf_pf_acquire()
298 memset(p_iov->pf2vf_reply, 0, sizeof(union pfvf_tlvs)); in qed_vf_pf_acquire()
301 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_acquire()
303 /* Re-try acquire in case of vf-pf hw channel timeout */ in qed_vf_pf_acquire()
304 if (retry_cnt && rc == -EBUSY) { in qed_vf_pf_acquire()
307 retry_cnt--; in qed_vf_pf_acquire()
315 memcpy(&p_iov->acquire_resp, resp, sizeof(p_iov->acquire_resp)); in qed_vf_pf_acquire()
319 if (resp->hdr.status == PFVF_STATUS_SUCCESS) { in qed_vf_pf_acquire()
321 if (!(resp->pfdev_info.capabilities & in qed_vf_pf_acquire()
324 * but we don't care - simply mark it as in qed_vf_pf_acquire()
327 req->vfdev_info.capabilities |= in qed_vf_pf_acquire()
332 } else if (resp->hdr.status == PFVF_STATUS_NO_RESOURCE && in qed_vf_pf_acquire()
335 &resp->resc); in qed_vf_pf_acquire()
336 } else if (resp->hdr.status == PFVF_STATUS_NOT_SUPPORTED) { in qed_vf_pf_acquire()
337 if (pfdev_info->major_fp_hsi && in qed_vf_pf_acquire()
338 (pfdev_info->major_fp_hsi != ETH_HSI_VER_MAJOR)) { in qed_vf_pf_acquire()
340 …"PF uses an incompatible fastpath HSI %02x.%02x [VF requires %02x.%02x]. Please change to a VF dri… in qed_vf_pf_acquire()
341 pfdev_info->major_fp_hsi, in qed_vf_pf_acquire()
342 pfdev_info->minor_fp_hsi, in qed_vf_pf_acquire()
345 pfdev_info->major_fp_hsi); in qed_vf_pf_acquire()
346 rc = -EINVAL; in qed_vf_pf_acquire()
350 if (!pfdev_info->major_fp_hsi) { in qed_vf_pf_acquire()
351 if (req->vfdev_info.capabilities & in qed_vf_pf_acquire()
355 rc = -EINVAL; in qed_vf_pf_acquire()
359 "PF is old - try re-acquire to see if it supports FW-version override\n"); in qed_vf_pf_acquire()
360 req->vfdev_info.capabilities |= in qed_vf_pf_acquire()
370 rc = -EINVAL; in qed_vf_pf_acquire()
375 resp->hdr.status); in qed_vf_pf_acquire()
376 rc = -EAGAIN; in qed_vf_pf_acquire()
382 if (req->vfdev_info.capabilities & VFPF_ACQUIRE_CAP_PRE_FP_HSI) in qed_vf_pf_acquire()
383 p_iov->b_pre_fp_hsi = true; in qed_vf_pf_acquire()
385 /* In case PF doesn't support multi-queue Tx, update the number of in qed_vf_pf_acquire()
389 if (!(resp->pfdev_info.capabilities & PFVF_ACQUIRE_CAP_QUEUE_QIDS)) in qed_vf_pf_acquire()
390 resp->resc.num_cids = resp->resc.num_rxqs + resp->resc.num_txqs; in qed_vf_pf_acquire()
393 p_iov->bulletin.size = resp->bulletin_size; in qed_vf_pf_acquire()
396 p_hwfn->cdev->type = resp->pfdev_info.dev_type; in qed_vf_pf_acquire()
397 p_hwfn->cdev->chip_rev = resp->pfdev_info.chip_rev; in qed_vf_pf_acquire()
399 p_hwfn->cdev->chip_num = pfdev_info->chip_num & 0xffff; in qed_vf_pf_acquire()
403 if (resp->pfdev_info.capabilities & PFVF_ACQUIRE_CAP_100G) { in qed_vf_pf_acquire()
405 p_hwfn->cdev->num_hwfns = 2; in qed_vf_pf_acquire()
409 if (!p_iov->b_pre_fp_hsi && in qed_vf_pf_acquire()
410 (resp->pfdev_info.minor_fp_hsi < ETH_HSI_VER_MINOR)) { in qed_vf_pf_acquire()
412 "PF is using older fastpath HSI; %02x.%02x is configured\n", in qed_vf_pf_acquire()
413 ETH_HSI_VER_MAJOR, resp->pfdev_info.minor_fp_hsi); in qed_vf_pf_acquire()
431 bar_size = p_hwfn->vf_iov_info->acquire_resp.pfdev_info.bar_size; in qed_vf_hw_bar_size()
439 struct qed_hwfn *p_lead = QED_LEADING_HWFN(p_hwfn->cdev); in qed_vf_hw_prepare()
444 /* Set number of hwfns - might be overridden once leading hwfn learns in qed_vf_hw_prepare()
448 p_hwfn->cdev->num_hwfns = 1; in qed_vf_hw_prepare()
451 p_hwfn->hw_info.opaque_fid = (u16)REG_RD(p_hwfn, reg); in qed_vf_hw_prepare()
454 p_hwfn->hw_info.concrete_fid = REG_RD(p_hwfn, reg); in qed_vf_hw_prepare()
459 return -ENOMEM; in qed_vf_hw_prepare()
461 /* Doorbells are tricky; Upper-layer has alreday set the hwfn doorbell in qed_vf_hw_prepare()
465 if (!p_hwfn->doorbells) { in qed_vf_hw_prepare()
466 p_hwfn->doorbells = (u8 __iomem *)p_hwfn->regview + in qed_vf_hw_prepare()
469 /* For leading hw-function, value is always correct, but need in qed_vf_hw_prepare()
473 p_iov->b_doorbell_bar = true; in qed_vf_hw_prepare()
476 * received indication that mapped-bars are supported. in qed_vf_hw_prepare()
478 if (p_lead->vf_iov_info->b_doorbell_bar) in qed_vf_hw_prepare()
479 p_iov->b_doorbell_bar = true; in qed_vf_hw_prepare()
481 p_hwfn->doorbells = (u8 __iomem *) in qed_vf_hw_prepare()
482 p_hwfn->regview + PXP_VF_BAR0_START_DQ; in qed_vf_hw_prepare()
486 p_iov->vf2pf_request = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_vf_hw_prepare()
488 &p_iov->vf2pf_request_phys, in qed_vf_hw_prepare()
490 if (!p_iov->vf2pf_request) in qed_vf_hw_prepare()
493 p_iov->pf2vf_reply = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_vf_hw_prepare()
495 &p_iov->pf2vf_reply_phys, in qed_vf_hw_prepare()
497 if (!p_iov->pf2vf_reply) in qed_vf_hw_prepare()
503 p_iov->vf2pf_request, in qed_vf_hw_prepare()
504 (u64)p_iov->vf2pf_request_phys, in qed_vf_hw_prepare()
505 p_iov->pf2vf_reply, (u64)p_iov->pf2vf_reply_phys); in qed_vf_hw_prepare()
508 p_iov->bulletin.size = sizeof(struct qed_bulletin_content); in qed_vf_hw_prepare()
509 p_iov->bulletin.p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_vf_hw_prepare()
510 p_iov->bulletin.size, in qed_vf_hw_prepare()
511 &p_iov->bulletin.phys, in qed_vf_hw_prepare()
513 if (!p_iov->bulletin.p_virt) in qed_vf_hw_prepare()
518 p_iov->bulletin.p_virt, in qed_vf_hw_prepare()
519 (u64)p_iov->bulletin.phys, p_iov->bulletin.size); in qed_vf_hw_prepare()
521 mutex_init(&p_iov->mutex); in qed_vf_hw_prepare()
523 p_hwfn->vf_iov_info = p_iov; in qed_vf_hw_prepare()
525 p_hwfn->hw_info.personality = QED_PCI_ETH; in qed_vf_hw_prepare()
530 * acquisition would succeed - but the VF would have no way knowing in qed_vf_hw_prepare()
532 * know how to split it for 2nd hw-function. in qed_vf_hw_prepare()
533 * In this case we re-try without the indication of the mapped in qed_vf_hw_prepare()
536 if (!rc && p_iov->b_doorbell_bar && in qed_vf_hw_prepare()
538 (p_hwfn->cdev->num_hwfns > 1)) { in qed_vf_hw_prepare()
543 p_iov->b_doorbell_bar = false; in qed_vf_hw_prepare()
544 p_hwfn->doorbells = (u8 __iomem *)p_hwfn->regview + in qed_vf_hw_prepare()
550 "Regview [%p], Doorbell [%p], Device-doorbell [%p]\n", in qed_vf_hw_prepare()
551 p_hwfn->regview, p_hwfn->doorbells, p_hwfn->cdev->doorbells); in qed_vf_hw_prepare()
556 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_vf_hw_prepare()
558 p_iov->pf2vf_reply, p_iov->pf2vf_reply_phys); in qed_vf_hw_prepare()
560 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_vf_hw_prepare()
562 p_iov->vf2pf_request, p_iov->vf2pf_request_phys); in qed_vf_hw_prepare()
566 return -ENOMEM; in qed_vf_hw_prepare()
578 if (p_src->b_update_mode) { in __qed_vf_prep_tunn_req_tlv()
579 p_req->tun_mode_update_mask |= BIT(mask); in __qed_vf_prep_tunn_req_tlv()
581 if (p_src->b_mode_enabled) in __qed_vf_prep_tunn_req_tlv()
582 p_req->tunn_mode |= BIT(mask); in __qed_vf_prep_tunn_req_tlv()
585 *p_cls = p_src->tun_cls; in __qed_vf_prep_tunn_req_tlv()
595 if (p_port->b_update_port) { in qed_vf_prep_tunn_req_tlv()
597 *p_udp_port = p_port->port; in qed_vf_prep_tunn_req_tlv()
605 if (p_tun->vxlan.b_mode_enabled) in qed_vf_set_vf_start_tunn_update_param()
606 p_tun->vxlan.b_update_mode = true; in qed_vf_set_vf_start_tunn_update_param()
607 if (p_tun->l2_geneve.b_mode_enabled) in qed_vf_set_vf_start_tunn_update_param()
608 p_tun->l2_geneve.b_update_mode = true; in qed_vf_set_vf_start_tunn_update_param()
609 if (p_tun->ip_geneve.b_mode_enabled) in qed_vf_set_vf_start_tunn_update_param()
610 p_tun->ip_geneve.b_update_mode = true; in qed_vf_set_vf_start_tunn_update_param()
611 if (p_tun->l2_gre.b_mode_enabled) in qed_vf_set_vf_start_tunn_update_param()
612 p_tun->l2_gre.b_update_mode = true; in qed_vf_set_vf_start_tunn_update_param()
613 if (p_tun->ip_gre.b_mode_enabled) in qed_vf_set_vf_start_tunn_update_param()
614 p_tun->ip_gre.b_update_mode = true; in qed_vf_set_vf_start_tunn_update_param()
616 p_tun->b_update_rx_cls = true; in qed_vf_set_vf_start_tunn_update_param()
617 p_tun->b_update_tx_cls = true; in qed_vf_set_vf_start_tunn_update_param()
626 p_tun->b_mode_enabled = tunn_mode; in __qed_vf_update_tunn_param()
627 p_tun->tun_cls = tunn_cls; in __qed_vf_update_tunn_param()
629 p_tun->b_mode_enabled = false; in __qed_vf_update_tunn_param()
638 u16 feat_mask = p_resp->tunn_feature_mask; in qed_vf_update_tunn_param()
640 __qed_vf_update_tunn_param(&p_tun->vxlan, feat_mask, in qed_vf_update_tunn_param()
641 p_resp->vxlan_mode, p_resp->vxlan_clss, in qed_vf_update_tunn_param()
643 __qed_vf_update_tunn_param(&p_tun->l2_geneve, feat_mask, in qed_vf_update_tunn_param()
644 p_resp->l2geneve_mode, in qed_vf_update_tunn_param()
645 p_resp->l2geneve_clss, in qed_vf_update_tunn_param()
647 __qed_vf_update_tunn_param(&p_tun->ip_geneve, feat_mask, in qed_vf_update_tunn_param()
648 p_resp->ipgeneve_mode, in qed_vf_update_tunn_param()
649 p_resp->ipgeneve_clss, in qed_vf_update_tunn_param()
651 __qed_vf_update_tunn_param(&p_tun->l2_gre, feat_mask, in qed_vf_update_tunn_param()
652 p_resp->l2gre_mode, p_resp->l2gre_clss, in qed_vf_update_tunn_param()
654 __qed_vf_update_tunn_param(&p_tun->ip_gre, feat_mask, in qed_vf_update_tunn_param()
655 p_resp->ipgre_mode, p_resp->ipgre_clss, in qed_vf_update_tunn_param()
657 p_tun->geneve_port.port = p_resp->geneve_udp_port; in qed_vf_update_tunn_param()
658 p_tun->vxlan_port.port = p_resp->vxlan_udp_port; in qed_vf_update_tunn_param()
662 p_tun->vxlan.b_mode_enabled, p_tun->l2_geneve.b_mode_enabled, in qed_vf_update_tunn_param()
663 p_tun->ip_geneve.b_mode_enabled, in qed_vf_update_tunn_param()
664 p_tun->l2_gre.b_mode_enabled, p_tun->ip_gre.b_mode_enabled); in qed_vf_update_tunn_param()
670 struct qed_tunnel_info *p_tun = &p_hwfn->cdev->tunnel; in qed_vf_pf_tunnel_param_update()
671 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_tunnel_param_update()
679 if (p_src->b_update_rx_cls && p_src->b_update_tx_cls) in qed_vf_pf_tunnel_param_update()
680 p_req->update_tun_cls = 1; in qed_vf_pf_tunnel_param_update()
682 qed_vf_prep_tunn_req_tlv(p_req, &p_src->vxlan, QED_MODE_VXLAN_TUNN, in qed_vf_pf_tunnel_param_update()
683 &p_req->vxlan_clss, &p_src->vxlan_port, in qed_vf_pf_tunnel_param_update()
684 &p_req->update_vxlan_port, in qed_vf_pf_tunnel_param_update()
685 &p_req->vxlan_port); in qed_vf_pf_tunnel_param_update()
686 qed_vf_prep_tunn_req_tlv(p_req, &p_src->l2_geneve, in qed_vf_pf_tunnel_param_update()
688 &p_req->l2geneve_clss, &p_src->geneve_port, in qed_vf_pf_tunnel_param_update()
689 &p_req->update_geneve_port, in qed_vf_pf_tunnel_param_update()
690 &p_req->geneve_port); in qed_vf_pf_tunnel_param_update()
691 __qed_vf_prep_tunn_req_tlv(p_req, &p_src->ip_geneve, in qed_vf_pf_tunnel_param_update()
693 &p_req->ipgeneve_clss); in qed_vf_pf_tunnel_param_update()
694 __qed_vf_prep_tunn_req_tlv(p_req, &p_src->l2_gre, in qed_vf_pf_tunnel_param_update()
695 QED_MODE_L2GRE_TUNN, &p_req->l2gre_clss); in qed_vf_pf_tunnel_param_update()
696 __qed_vf_prep_tunn_req_tlv(p_req, &p_src->ip_gre, in qed_vf_pf_tunnel_param_update()
697 QED_MODE_IPGRE_TUNN, &p_req->ipgre_clss); in qed_vf_pf_tunnel_param_update()
700 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_tunnel_param_update()
704 p_resp = &p_iov->pf2vf_reply->tunn_param_resp; in qed_vf_pf_tunnel_param_update()
705 rc = qed_send_msg2pf(p_hwfn, &p_resp->hdr.status); in qed_vf_pf_tunnel_param_update()
710 if (p_resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_tunnel_param_update()
713 rc = -EINVAL; in qed_vf_pf_tunnel_param_update()
730 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_rxq_start()
733 u8 rx_qid = p_cid->rel.queue_id; in qed_vf_pf_rxq_start()
739 req->rx_qid = rx_qid; in qed_vf_pf_rxq_start()
740 req->cqe_pbl_addr = cqe_pbl_addr; in qed_vf_pf_rxq_start()
741 req->cqe_pbl_size = cqe_pbl_size; in qed_vf_pf_rxq_start()
742 req->rxq_addr = bd_chain_phys_addr; in qed_vf_pf_rxq_start()
743 req->hw_sb = p_cid->sb_igu_id; in qed_vf_pf_rxq_start()
744 req->sb_index = p_cid->sb_idx; in qed_vf_pf_rxq_start()
745 req->bd_max_bytes = bd_max_bytes; in qed_vf_pf_rxq_start()
746 req->stat_id = -1; in qed_vf_pf_rxq_start()
751 if (p_iov->b_pre_fp_hsi) { in qed_vf_pf_rxq_start()
752 u8 hw_qid = p_iov->acquire_resp.resc.hw_qid[rx_qid]; in qed_vf_pf_rxq_start()
756 p_hwfn->regview + in qed_vf_pf_rxq_start()
757 MSTORM_QZONE_START(p_hwfn->cdev) + in qed_vf_pf_rxq_start()
768 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_rxq_start()
771 resp = &p_iov->pf2vf_reply->queue_start; in qed_vf_pf_rxq_start()
772 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_rxq_start()
776 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_rxq_start()
777 rc = -EINVAL; in qed_vf_pf_rxq_start()
782 if (!p_iov->b_pre_fp_hsi) { in qed_vf_pf_rxq_start()
785 *pp_prod = (u8 __iomem *)p_hwfn->regview + resp->offset; in qed_vf_pf_rxq_start()
788 rx_qid, *pp_prod, resp->offset); in qed_vf_pf_rxq_start()
803 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_rxq_stop()
811 req->rx_qid = p_cid->rel.queue_id; in qed_vf_pf_rxq_stop()
812 req->num_rxqs = 1; in qed_vf_pf_rxq_stop()
813 req->cqe_completion = cqe_completion; in qed_vf_pf_rxq_stop()
818 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_rxq_stop()
821 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_rxq_stop()
822 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_rxq_stop()
826 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_rxq_stop()
827 rc = -EINVAL; in qed_vf_pf_rxq_stop()
843 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_txq_start()
846 u16 qid = p_cid->rel.queue_id; in qed_vf_pf_txq_start()
852 req->tx_qid = qid; in qed_vf_pf_txq_start()
855 req->pbl_addr = pbl_addr; in qed_vf_pf_txq_start()
856 req->pbl_size = pbl_size; in qed_vf_pf_txq_start()
857 req->hw_sb = p_cid->sb_igu_id; in qed_vf_pf_txq_start()
858 req->sb_index = p_cid->sb_idx; in qed_vf_pf_txq_start()
863 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_txq_start()
866 resp = &p_iov->pf2vf_reply->queue_start; in qed_vf_pf_txq_start()
867 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_txq_start()
871 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_txq_start()
872 rc = -EINVAL; in qed_vf_pf_txq_start()
879 if (!p_iov->b_pre_fp_hsi) { in qed_vf_pf_txq_start()
880 *pp_doorbell = (u8 __iomem *)p_hwfn->doorbells + resp->offset; in qed_vf_pf_txq_start()
882 u8 cid = p_iov->acquire_resp.resc.cid[qid]; in qed_vf_pf_txq_start()
884 *pp_doorbell = (u8 __iomem *)p_hwfn->doorbells + in qed_vf_pf_txq_start()
891 qid, p_cid->qid_usage_idx, *pp_doorbell, resp->offset); in qed_vf_pf_txq_start()
900 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_txq_stop()
908 req->tx_qid = p_cid->rel.queue_id; in qed_vf_pf_txq_stop()
909 req->num_txqs = 1; in qed_vf_pf_txq_stop()
914 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_txq_stop()
917 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_txq_stop()
918 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_txq_stop()
922 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_txq_stop()
923 rc = -EINVAL; in qed_vf_pf_txq_stop()
940 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_vport_start()
948 req->mtu = mtu; in qed_vf_pf_vport_start()
949 req->vport_id = vport_id; in qed_vf_pf_vport_start()
950 req->inner_vlan_removal = inner_vlan_removal; in qed_vf_pf_vport_start()
951 req->tpa_mode = tpa_mode; in qed_vf_pf_vport_start()
952 req->max_buffers_per_cqe = max_buffers_per_cqe; in qed_vf_pf_vport_start()
953 req->only_untagged = only_untagged; in qed_vf_pf_vport_start()
956 for (i = 0; i < p_hwfn->vf_iov_info->acquire_resp.resc.num_sbs; i++) { in qed_vf_pf_vport_start()
957 struct qed_sb_info *p_sb = p_hwfn->vf_iov_info->sbs_info[i]; in qed_vf_pf_vport_start()
960 req->sb_addr[i] = p_sb->sb_phys; in qed_vf_pf_vport_start()
964 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_vport_start()
967 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_vport_start()
968 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_vport_start()
972 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_vport_start()
973 rc = -EINVAL; in qed_vf_pf_vport_start()
985 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_vport_stop()
986 struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_vport_stop()
994 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_vport_stop()
997 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_vport_stop()
1001 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_vport_stop()
1002 rc = -EINVAL; in qed_vf_pf_vport_stop()
1019 return !!(p_data->update_vport_active_rx_flg || in qed_vf_handle_vp_update_is_needed()
1020 p_data->update_vport_active_tx_flg); in qed_vf_handle_vp_update_is_needed()
1022 return !!p_data->update_tx_switching_flg; in qed_vf_handle_vp_update_is_needed()
1024 return !!p_data->update_inner_vlan_removal_flg; in qed_vf_handle_vp_update_is_needed()
1026 return !!p_data->update_accept_any_vlan_flg; in qed_vf_handle_vp_update_is_needed()
1028 return !!p_data->update_approx_mcast_flg; in qed_vf_handle_vp_update_is_needed()
1030 return !!(p_data->accept_flags.update_rx_mode_config || in qed_vf_handle_vp_update_is_needed()
1031 p_data->accept_flags.update_tx_mode_config); in qed_vf_handle_vp_update_is_needed()
1033 return !!p_data->rss_params; in qed_vf_handle_vp_update_is_needed()
1035 return !!p_data->sge_tpa_params; in qed_vf_handle_vp_update_is_needed()
1037 DP_INFO(p_hwfn, "Unexpected vport-update TLV[%d]\n", in qed_vf_handle_vp_update_is_needed()
1047 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_handle_vp_update_tlvs_resp()
1057 qed_iov_search_list_tlvs(p_hwfn, p_iov->pf2vf_reply, in qed_vf_handle_vp_update_tlvs_resp()
1059 if (p_resp && p_resp->hdr.status) in qed_vf_handle_vp_update_tlvs_resp()
1063 (p_resp && p_resp->hdr.status) ? "succeeded" in qed_vf_handle_vp_update_tlvs_resp()
1071 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_vport_update()
1078 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_vport_update()
1080 update_rx = p_params->update_vport_active_rx_flg; in qed_vf_pf_vport_update()
1081 update_tx = p_params->update_vport_active_tx_flg; in qed_vf_pf_vport_update()
1091 p_act_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_vport_update()
1096 p_act_tlv->update_rx = update_rx; in qed_vf_pf_vport_update()
1097 p_act_tlv->active_rx = p_params->vport_active_rx_flg; in qed_vf_pf_vport_update()
1101 p_act_tlv->update_tx = update_tx; in qed_vf_pf_vport_update()
1102 p_act_tlv->active_tx = p_params->vport_active_tx_flg; in qed_vf_pf_vport_update()
1106 if (p_params->update_tx_switching_flg) { in qed_vf_pf_vport_update()
1111 p_tx_switch_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_vport_update()
1114 p_tx_switch_tlv->tx_switching = p_params->tx_switching_flg; in qed_vf_pf_vport_update()
1117 if (p_params->update_approx_mcast_flg) { in qed_vf_pf_vport_update()
1121 p_mcast_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_vport_update()
1124 memcpy(p_mcast_tlv->bins, p_params->bins, in qed_vf_pf_vport_update()
1128 update_rx = p_params->accept_flags.update_rx_mode_config; in qed_vf_pf_vport_update()
1129 update_tx = p_params->accept_flags.update_tx_mode_config; in qed_vf_pf_vport_update()
1136 p_accept_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, tlv, size); in qed_vf_pf_vport_update()
1139 p_accept_tlv->update_rx_mode = update_rx; in qed_vf_pf_vport_update()
1140 p_accept_tlv->rx_accept_filter = in qed_vf_pf_vport_update()
1141 p_params->accept_flags.rx_accept_filter; in qed_vf_pf_vport_update()
1145 p_accept_tlv->update_tx_mode = update_tx; in qed_vf_pf_vport_update()
1146 p_accept_tlv->tx_accept_filter = in qed_vf_pf_vport_update()
1147 p_params->accept_flags.tx_accept_filter; in qed_vf_pf_vport_update()
1151 if (p_params->rss_params) { in qed_vf_pf_vport_update()
1152 struct qed_rss_params *rss_params = p_params->rss_params; in qed_vf_pf_vport_update()
1158 &p_iov->offset, in qed_vf_pf_vport_update()
1161 if (rss_params->update_rss_config) in qed_vf_pf_vport_update()
1162 p_rss_tlv->update_rss_flags |= in qed_vf_pf_vport_update()
1164 if (rss_params->update_rss_capabilities) in qed_vf_pf_vport_update()
1165 p_rss_tlv->update_rss_flags |= in qed_vf_pf_vport_update()
1167 if (rss_params->update_rss_ind_table) in qed_vf_pf_vport_update()
1168 p_rss_tlv->update_rss_flags |= in qed_vf_pf_vport_update()
1170 if (rss_params->update_rss_key) in qed_vf_pf_vport_update()
1171 p_rss_tlv->update_rss_flags |= VFPF_UPDATE_RSS_KEY_FLAG; in qed_vf_pf_vport_update()
1173 p_rss_tlv->rss_enable = rss_params->rss_enable; in qed_vf_pf_vport_update()
1174 p_rss_tlv->rss_caps = rss_params->rss_caps; in qed_vf_pf_vport_update()
1175 p_rss_tlv->rss_table_size_log = rss_params->rss_table_size_log; in qed_vf_pf_vport_update()
1178 1 << p_rss_tlv->rss_table_size_log); in qed_vf_pf_vport_update()
1182 p_queue = rss_params->rss_ind_table[i]; in qed_vf_pf_vport_update()
1183 p_rss_tlv->rss_ind_table[i] = p_queue->rel.queue_id; in qed_vf_pf_vport_update()
1185 memcpy(p_rss_tlv->rss_key, rss_params->rss_key, in qed_vf_pf_vport_update()
1186 sizeof(rss_params->rss_key)); in qed_vf_pf_vport_update()
1189 if (p_params->update_accept_any_vlan_flg) { in qed_vf_pf_vport_update()
1194 p_any_vlan_tlv = qed_add_tlv(p_hwfn, &p_iov->offset, tlv, size); in qed_vf_pf_vport_update()
1196 p_any_vlan_tlv->accept_any_vlan = p_params->accept_any_vlan; in qed_vf_pf_vport_update()
1197 p_any_vlan_tlv->update_accept_any_vlan_flg = in qed_vf_pf_vport_update()
1198 p_params->update_accept_any_vlan_flg; in qed_vf_pf_vport_update()
1202 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_vport_update()
1205 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_vport_update()
1209 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_vport_update()
1210 rc = -EINVAL; in qed_vf_pf_vport_update()
1224 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_reset()
1233 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_reset()
1236 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_reset()
1237 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_reset()
1241 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_reset()
1242 rc = -EAGAIN; in qed_vf_pf_reset()
1246 p_hwfn->b_int_enabled = 0; in qed_vf_pf_reset()
1263 if (p_filter_cmd->opcode == QED_FILTER_ADD) { in qed_vf_pf_filter_mcast()
1264 for (i = 0; i < p_filter_cmd->num_mc_addrs; i++) { in qed_vf_pf_filter_mcast()
1267 bit = qed_mcast_bin_from_mac(p_filter_cmd->mac[i]); in qed_vf_pf_filter_mcast()
1278 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_filter_ucast()
1285 req->opcode = (u8)p_ucast->opcode; in qed_vf_pf_filter_ucast()
1286 req->type = (u8)p_ucast->type; in qed_vf_pf_filter_ucast()
1287 memcpy(req->mac, p_ucast->mac, ETH_ALEN); in qed_vf_pf_filter_ucast()
1288 req->vlan = p_ucast->vlan; in qed_vf_pf_filter_ucast()
1291 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_filter_ucast()
1294 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_filter_ucast()
1295 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_filter_ucast()
1299 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_filter_ucast()
1300 rc = -EAGAIN; in qed_vf_pf_filter_ucast()
1312 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_int_cleanup()
1313 struct pfvf_def_resp_tlv *resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_int_cleanup()
1321 qed_add_tlv(p_hwfn, &p_iov->offset, in qed_vf_pf_int_cleanup()
1324 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_int_cleanup()
1328 if (resp->hdr.status != PFVF_STATUS_SUCCESS) { in qed_vf_pf_int_cleanup()
1329 rc = -EINVAL; in qed_vf_pf_int_cleanup()
1342 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_get_coalesce()
1349 req->qid = p_cid->rel.queue_id; in qed_vf_pf_get_coalesce()
1350 req->is_rx = p_cid->b_is_rx ? 1 : 0; in qed_vf_pf_get_coalesce()
1352 qed_add_tlv(p_hwfn, &p_iov->offset, CHANNEL_TLV_LIST_END, in qed_vf_pf_get_coalesce()
1354 resp = &p_iov->pf2vf_reply->read_coal_resp; in qed_vf_pf_get_coalesce()
1356 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_get_coalesce()
1360 if (resp->hdr.status != PFVF_STATUS_SUCCESS) in qed_vf_pf_get_coalesce()
1363 *p_coal = resp->coal; in qed_vf_pf_get_coalesce()
1374 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_bulletin_update_mac()
1380 return -EINVAL; in qed_vf_pf_bulletin_update_mac()
1385 ether_addr_copy(p_req->mac, p_mac); in qed_vf_pf_bulletin_update_mac()
1387 "Requesting bulletin update for MAC[%pM]\n", p_mac); in qed_vf_pf_bulletin_update_mac()
1390 qed_add_tlv(p_hwfn, &p_iov->offset, CHANNEL_TLV_LIST_END, in qed_vf_pf_bulletin_update_mac()
1393 p_resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_bulletin_update_mac()
1394 rc = qed_send_msg2pf(p_hwfn, &p_resp->hdr.status); in qed_vf_pf_bulletin_update_mac()
1403 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_pf_set_coalesce()
1411 req->rx_coal = rx_coal; in qed_vf_pf_set_coalesce()
1412 req->tx_coal = tx_coal; in qed_vf_pf_set_coalesce()
1413 req->qid = p_cid->rel.queue_id; in qed_vf_pf_set_coalesce()
1418 rx_coal, tx_coal, req->qid); in qed_vf_pf_set_coalesce()
1421 qed_add_tlv(p_hwfn, &p_iov->offset, CHANNEL_TLV_LIST_END, in qed_vf_pf_set_coalesce()
1424 resp = &p_iov->pf2vf_reply->default_resp; in qed_vf_pf_set_coalesce()
1425 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status); in qed_vf_pf_set_coalesce()
1429 if (resp->hdr.status != PFVF_STATUS_SUCCESS) in qed_vf_pf_set_coalesce()
1433 p_hwfn->cdev->rx_coalesce_usecs = rx_coal; in qed_vf_pf_set_coalesce()
1436 p_hwfn->cdev->tx_coalesce_usecs = tx_coal; in qed_vf_pf_set_coalesce()
1445 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_get_igu_sb_id()
1452 return p_iov->acquire_resp.resc.hw_sbs[sb_id].hw_sb_id; in qed_vf_get_igu_sb_id()
1458 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_set_sb_info()
1470 p_iov->sbs_info[sb_id] = p_sb; in qed_vf_set_sb_info()
1475 struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info; in qed_vf_read_bulletin()
1479 crc_size = sizeof(p_iov->bulletin.p_virt->crc); in qed_vf_read_bulletin()
1483 memcpy(&shadow, p_iov->bulletin.p_virt, p_iov->bulletin.size); in qed_vf_read_bulletin()
1486 if (shadow.version == p_iov->bulletin_shadow.version) in qed_vf_read_bulletin()
1491 p_iov->bulletin.size - crc_size); in qed_vf_read_bulletin()
1493 return -EAGAIN; in qed_vf_read_bulletin()
1496 memcpy(&p_iov->bulletin_shadow, &shadow, p_iov->bulletin.size); in qed_vf_read_bulletin()
1512 p_params->speed.autoneg = p_bulletin->req_autoneg; in __qed_vf_get_link_params()
1513 p_params->speed.advertised_speeds = p_bulletin->req_adv_speed; in __qed_vf_get_link_params()
1514 p_params->speed.forced_speed = p_bulletin->req_forced_speed; in __qed_vf_get_link_params()
1515 p_params->pause.autoneg = p_bulletin->req_autoneg_pause; in __qed_vf_get_link_params()
1516 p_params->pause.forced_rx = p_bulletin->req_forced_rx; in __qed_vf_get_link_params()
1517 p_params->pause.forced_tx = p_bulletin->req_forced_tx; in __qed_vf_get_link_params()
1518 p_params->loopback_mode = p_bulletin->req_loopback; in __qed_vf_get_link_params()
1525 &(p_hwfn->vf_iov_info->bulletin_shadow)); in qed_vf_get_link_params()
1534 p_link->link_up = p_bulletin->link_up; in __qed_vf_get_link_state()
1535 p_link->speed = p_bulletin->speed; in __qed_vf_get_link_state()
1536 p_link->full_duplex = p_bulletin->full_duplex; in __qed_vf_get_link_state()
1537 p_link->an = p_bulletin->autoneg; in __qed_vf_get_link_state()
1538 p_link->an_complete = p_bulletin->autoneg_complete; in __qed_vf_get_link_state()
1539 p_link->parallel_detection = p_bulletin->parallel_detection; in __qed_vf_get_link_state()
1540 p_link->pfc_enabled = p_bulletin->pfc_enabled; in __qed_vf_get_link_state()
1541 p_link->partner_adv_speed = p_bulletin->partner_adv_speed; in __qed_vf_get_link_state()
1542 p_link->partner_tx_flow_ctrl_en = p_bulletin->partner_tx_flow_ctrl_en; in __qed_vf_get_link_state()
1543 p_link->partner_rx_flow_ctrl_en = p_bulletin->partner_rx_flow_ctrl_en; in __qed_vf_get_link_state()
1544 p_link->partner_adv_pause = p_bulletin->partner_adv_pause; in __qed_vf_get_link_state()
1545 p_link->sfp_tx_fault = p_bulletin->sfp_tx_fault; in __qed_vf_get_link_state()
1552 &(p_hwfn->vf_iov_info->bulletin_shadow)); in qed_vf_get_link_state()
1560 p_link_caps->speed_capabilities = p_bulletin->capability_speed; in __qed_vf_get_link_caps()
1567 &(p_hwfn->vf_iov_info->bulletin_shadow)); in qed_vf_get_link_caps()
1572 *num_rxqs = p_hwfn->vf_iov_info->acquire_resp.resc.num_rxqs; in qed_vf_get_num_rxqs()
1577 *num_txqs = p_hwfn->vf_iov_info->acquire_resp.resc.num_txqs; in qed_vf_get_num_txqs()
1582 *num_cids = p_hwfn->vf_iov_info->acquire_resp.resc.num_cids; in qed_vf_get_num_cids()
1588 p_hwfn->vf_iov_info->acquire_resp.pfdev_info.port_mac, ETH_ALEN); in qed_vf_get_port_mac()
1595 p_vf = p_hwfn->vf_iov_info; in qed_vf_get_num_vlan_filters()
1596 *num_vlan_filters = p_vf->acquire_resp.resc.num_vlan_filters; in qed_vf_get_num_vlan_filters()
1601 struct qed_vf_iov *p_vf = p_hwfn->vf_iov_info; in qed_vf_get_num_mac_filters()
1603 *num_mac_filters = p_vf->acquire_resp.resc.num_mac_filters; in qed_vf_get_num_mac_filters()
1606 bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac) in qed_vf_check_mac() argument
1610 bulletin = &p_hwfn->vf_iov_info->bulletin_shadow; in qed_vf_check_mac()
1611 if (!(bulletin->valid_bitmap & (1 << MAC_ADDR_FORCED))) in qed_vf_check_mac()
1614 /* Forbid VF from changing a MAC enforced by PF */ in qed_vf_check_mac()
1615 if (ether_addr_equal(bulletin->mac, mac)) in qed_vf_check_mac()
1626 bulletin = &hwfn->vf_iov_info->bulletin_shadow; in qed_vf_bulletin_get_forced_mac()
1628 if (bulletin->valid_bitmap & (1 << MAC_ADDR_FORCED)) { in qed_vf_bulletin_get_forced_mac()
1631 } else if (bulletin->valid_bitmap & (1 << VFPF_BULLETIN_MAC_ADDR)) { in qed_vf_bulletin_get_forced_mac()
1638 ether_addr_copy(dst_mac, bulletin->mac); in qed_vf_bulletin_get_forced_mac()
1649 p_bulletin = &p_hwfn->vf_iov_info->bulletin_shadow; in qed_vf_bulletin_get_udp_ports()
1651 *p_vxlan_port = p_bulletin->vxlan_udp_port; in qed_vf_bulletin_get_udp_ports()
1652 *p_geneve_port = p_bulletin->geneve_udp_port; in qed_vf_bulletin_get_udp_ports()
1661 info = &p_hwfn->vf_iov_info->acquire_resp.pfdev_info; in qed_vf_get_fw_version()
1663 *fw_major = info->fw_major; in qed_vf_get_fw_version()
1664 *fw_minor = info->fw_minor; in qed_vf_get_fw_version()
1665 *fw_rev = info->fw_rev; in qed_vf_get_fw_version()
1666 *fw_eng = info->fw_eng; in qed_vf_get_fw_version()
1671 struct qed_eth_cb_ops *ops = hwfn->cdev->protocol_ops.eth; in qed_handle_bulletin_change()
1672 u8 mac[ETH_ALEN], is_mac_exist, is_mac_forced; in qed_handle_bulletin_change() local
1673 void *cookie = hwfn->cdev->ops_cookie; in qed_handle_bulletin_change()
1677 is_mac_exist = qed_vf_bulletin_get_forced_mac(hwfn, mac, in qed_handle_bulletin_change()
1680 ops->force_mac(cookie, mac, !!is_mac_forced); in qed_handle_bulletin_change()
1682 ops->ports_update(cookie, vxlan_port, geneve_port); in qed_handle_bulletin_change()
1694 if (test_and_clear_bit(QED_IOV_WQ_STOP_WQ_FLAG, &hwfn->iov_task_flags)) in qed_iov_vf_task()
1700 &hwfn->iov_task_flags)) in qed_iov_vf_task()
1705 /* As VF is polling bulletin board, need to constantly re-schedule */ in qed_iov_vf_task()
1706 queue_delayed_work(hwfn->iov_wq, &hwfn->iov_task, HZ); in qed_iov_vf_task()