Lines Matching full:mbox

60 	mutex_lock(&pfvf->mbox.lock);  in otx2_update_lmac_stats()
61 req = otx2_mbox_alloc_msg_cgx_stats(&pfvf->mbox); in otx2_update_lmac_stats()
63 mutex_unlock(&pfvf->mbox.lock); in otx2_update_lmac_stats()
67 otx2_sync_mbox_msg(&pfvf->mbox); in otx2_update_lmac_stats()
68 mutex_unlock(&pfvf->mbox.lock); in otx2_update_lmac_stats()
77 mutex_lock(&pfvf->mbox.lock); in otx2_update_lmac_fec_stats()
78 req = otx2_mbox_alloc_msg_cgx_fec_stats(&pfvf->mbox); in otx2_update_lmac_fec_stats()
80 otx2_sync_mbox_msg(&pfvf->mbox); in otx2_update_lmac_fec_stats()
81 mutex_unlock(&pfvf->mbox.lock); in otx2_update_lmac_fec_stats()
164 mutex_lock(&pfvf->mbox.lock); in otx2_hw_set_mac_addr()
165 req = otx2_mbox_alloc_msg_nix_set_mac_addr(&pfvf->mbox); in otx2_hw_set_mac_addr()
167 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_set_mac_addr()
173 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_hw_set_mac_addr()
174 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_set_mac_addr()
186 mutex_lock(&pfvf->mbox.lock); in otx2_hw_get_mac_addr()
187 req = otx2_mbox_alloc_msg_nix_get_mac_addr(&pfvf->mbox); in otx2_hw_get_mac_addr()
189 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_get_mac_addr()
193 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_hw_get_mac_addr()
195 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_get_mac_addr()
199 msghdr = otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); in otx2_hw_get_mac_addr()
201 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_get_mac_addr()
206 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_get_mac_addr()
244 mutex_lock(&pfvf->mbox.lock); in otx2_hw_set_mtu()
245 req = otx2_mbox_alloc_msg_nix_set_hw_frs(&pfvf->mbox); in otx2_hw_set_mtu()
247 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_set_mtu()
257 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_hw_set_mtu()
258 mutex_unlock(&pfvf->mbox.lock); in otx2_hw_set_mtu()
271 mutex_lock(&pfvf->mbox.lock); in otx2_config_pause_frm()
272 req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox); in otx2_config_pause_frm()
282 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_config_pause_frm()
284 mutex_unlock(&pfvf->mbox.lock); in otx2_config_pause_frm()
296 mutex_lock(&pfvf->mbox.lock); in otx2_set_flowkey_cfg()
297 req = otx2_mbox_alloc_msg_nix_rss_flowkey_cfg(&pfvf->mbox); in otx2_set_flowkey_cfg()
299 mutex_unlock(&pfvf->mbox.lock); in otx2_set_flowkey_cfg()
306 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_set_flowkey_cfg()
311 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); in otx2_set_flowkey_cfg()
319 mutex_unlock(&pfvf->mbox.lock); in otx2_set_flowkey_cfg()
327 struct mbox *mbox = &pfvf->mbox; in otx2_set_rss_table() local
331 mutex_lock(&mbox->lock); in otx2_set_rss_table()
339 aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox); in otx2_set_rss_table()
344 err = otx2_sync_mbox_msg(mbox); in otx2_set_rss_table()
346 mutex_unlock(&mbox->lock); in otx2_set_rss_table()
349 aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox); in otx2_set_rss_table()
351 mutex_unlock(&mbox->lock); in otx2_set_rss_table()
363 err = otx2_sync_mbox_msg(mbox); in otx2_set_rss_table()
364 mutex_unlock(&mbox->lock); in otx2_set_rss_table()
469 mutex_lock(&pfvf->mbox.lock); in otx2_setup_segmentation()
472 lso = otx2_mbox_alloc_msg_nix_lso_format_cfg(&pfvf->mbox); in otx2_setup_segmentation()
479 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_setup_segmentation()
484 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &lso->hdr); in otx2_setup_segmentation()
491 lso = otx2_mbox_alloc_msg_nix_lso_format_cfg(&pfvf->mbox); in otx2_setup_segmentation()
498 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_setup_segmentation()
503 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &lso->hdr); in otx2_setup_segmentation()
508 mutex_unlock(&pfvf->mbox.lock); in otx2_setup_segmentation()
511 mutex_unlock(&pfvf->mbox.lock); in otx2_setup_segmentation()
627 req = otx2_mbox_alloc_msg_nix_txschq_cfg(&pfvf->mbox); in otx2_txschq_config()
732 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_txschq_config()
741 mutex_lock(&pfvf->mbox.lock); in otx2_smq_flush()
743 req = otx2_mbox_alloc_msg_nix_txschq_cfg(&pfvf->mbox); in otx2_smq_flush()
745 mutex_unlock(&pfvf->mbox.lock); in otx2_smq_flush()
754 rc = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_smq_flush()
755 mutex_unlock(&pfvf->mbox.lock); in otx2_smq_flush()
768 req = otx2_mbox_alloc_msg_nix_txsch_alloc(&pfvf->mbox); in otx2_txsch_alloc()
781 rc = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_txsch_alloc()
786 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); in otx2_txsch_alloc()
809 mutex_lock(&pfvf->mbox.lock); in otx2_txschq_free_one()
811 free_req = otx2_mbox_alloc_msg_nix_txsch_free(&pfvf->mbox); in otx2_txschq_free_one()
813 mutex_unlock(&pfvf->mbox.lock); in otx2_txschq_free_one()
822 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_txschq_free_one()
828 mutex_unlock(&pfvf->mbox.lock); in otx2_txschq_free_one()
896 aq = otx2_mbox_alloc_msg_nix_aq_enq(&pfvf->mbox); in otx2_rq_init()
920 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_rq_init()
932 aq = otx2_mbox_alloc_msg_nix_aq_enq(&pfvf->mbox); in otx2_sq_aq_init()
957 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_sq_aq_init()
1115 aq = otx2_mbox_alloc_msg_nix_aq_enq(&pfvf->mbox); in otx2_cq_init()
1151 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_cq_init()
1228 nixlf = otx2_mbox_alloc_msg_nix_lf_alloc(&pfvf->mbox); in otx2_config_nix()
1249 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_config_nix()
1253 rsp = (struct nix_lf_alloc_rsp *)otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, in otx2_config_nix()
1388 aq = otx2_mbox_alloc_msg_npa_aq_enq(&pfvf->mbox); in otx2_aura_init()
1390 /* Shared mbox memory buffer is full, flush it and retry */ in otx2_aura_init()
1391 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_aura_init()
1394 aq = otx2_mbox_alloc_msg_npa_aq_enq(&pfvf->mbox); in otx2_aura_init()
1465 aq = otx2_mbox_alloc_msg_npa_aq_enq(&pfvf->mbox); in otx2_pool_init()
1467 /* Shared mbox memory buffer is full, flush it and retry */ in otx2_pool_init()
1468 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_pool_init()
1473 aq = otx2_mbox_alloc_msg_npa_aq_enq(&pfvf->mbox); in otx2_pool_init()
1565 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_sq_aura_pool_init()
1604 otx2_mbox_reset(&pfvf->mbox.mbox, 0); in otx2_sq_aura_pool_init()
1637 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_rq_aura_pool_init()
1662 otx2_mbox_reset(&pfvf->mbox.mbox, 0); in otx2_rq_aura_pool_init()
1687 npalf = otx2_mbox_alloc_msg_npa_lf_alloc(&pfvf->mbox); in otx2_config_npa()
1696 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_config_npa()
1699 int otx2_detach_resources(struct mbox *mbox) in otx2_detach_resources() argument
1703 mutex_lock(&mbox->lock); in otx2_detach_resources()
1704 detach = otx2_mbox_alloc_msg_detach_resources(mbox); in otx2_detach_resources()
1706 mutex_unlock(&mbox->lock); in otx2_detach_resources()
1714 otx2_sync_mbox_msg(mbox); in otx2_detach_resources()
1715 mutex_unlock(&mbox->lock); in otx2_detach_resources()
1726 mutex_lock(&pfvf->mbox.lock); in otx2_attach_npa_nix()
1728 attach = otx2_mbox_alloc_msg_attach_resources(&pfvf->mbox); in otx2_attach_npa_nix()
1730 mutex_unlock(&pfvf->mbox.lock); in otx2_attach_npa_nix()
1738 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_attach_npa_nix()
1740 mutex_unlock(&pfvf->mbox.lock); in otx2_attach_npa_nix()
1753 msix = otx2_mbox_alloc_msg_msix_offset(&pfvf->mbox); in otx2_attach_npa_nix()
1755 mutex_unlock(&pfvf->mbox.lock); in otx2_attach_npa_nix()
1759 err = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_attach_npa_nix()
1761 mutex_unlock(&pfvf->mbox.lock); in otx2_attach_npa_nix()
1764 mutex_unlock(&pfvf->mbox.lock); in otx2_attach_npa_nix()
1777 void otx2_ctx_disable(struct mbox *mbox, int type, bool npa) in otx2_ctx_disable() argument
1781 mutex_lock(&mbox->lock); in otx2_ctx_disable()
1784 req = otx2_mbox_alloc_msg_npa_hwctx_disable(mbox); in otx2_ctx_disable()
1786 req = otx2_mbox_alloc_msg_nix_hwctx_disable(mbox); in otx2_ctx_disable()
1789 mutex_unlock(&mbox->lock); in otx2_ctx_disable()
1795 if (otx2_sync_mbox_msg(mbox)) in otx2_ctx_disable()
1796 dev_err(mbox->pfvf->dev, "%s failed to disable context\n", in otx2_ctx_disable()
1799 mutex_unlock(&mbox->lock); in otx2_ctx_disable()
1807 req = otx2_mbox_alloc_msg_nix_bp_enable(&pfvf->mbox); in otx2_nix_config_bp()
1809 req = otx2_mbox_alloc_msg_nix_bp_disable(&pfvf->mbox); in otx2_nix_config_bp()
1823 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_nix_config_bp()
1832 req = otx2_mbox_alloc_msg_nix_cpt_bp_enable(&pfvf->mbox); in otx2_nix_cpt_config_bp()
1834 req = otx2_mbox_alloc_msg_nix_cpt_bp_disable(&pfvf->mbox); in otx2_nix_cpt_config_bp()
1848 return otx2_sync_mbox_msg(&pfvf->mbox); in otx2_nix_cpt_config_bp()
1852 /* Mbox message handlers */
1975 mutex_lock(&pfvf->mbox.lock); in otx2_get_max_mtu()
1977 req = otx2_mbox_alloc_msg_nix_get_hw_info(&pfvf->mbox); in otx2_get_max_mtu()
1983 rc = otx2_sync_mbox_msg(&pfvf->mbox); in otx2_get_max_mtu()
1986 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); in otx2_get_max_mtu()
2007 mutex_unlock(&pfvf->mbox.lock); in otx2_get_max_mtu()
2054 struct mbox *mbox = &pfvf->mbox; in otx2_set_hw_capabilities() local
2060 mutex_lock(&mbox->lock); in otx2_set_hw_capabilities()
2062 req = otx2_mbox_alloc_msg_get_hw_cap(mbox); in otx2_set_hw_capabilities()
2066 ret = otx2_sync_mbox_msg(mbox); in otx2_set_hw_capabilities()
2070 rsp = (struct get_hw_cap_rsp *)otx2_mbox_get_rsp(&pfvf->mbox.mbox, in otx2_set_hw_capabilities()
2080 mutex_unlock(&mbox->lock); in otx2_set_hw_capabilities()
2085 mutex_unlock(&mbox->lock); in otx2_set_hw_capabilities()