Lines Matching refs:fcport
724 struct qedf_rport *fcport = NULL;
735 fcport = (struct qedf_rport *)&rp[1];
736 rdata = fcport->rdata;
781 if (test_bit(QEDF_RPORT_UPLOADING_CONNECTION, &fcport->flags)) {
877 struct qedf_rport *fcport = NULL;
891 list_for_each_entry_rcu(fcport, &qedf->fcports, peers) {
892 if (fcport && test_bit(QEDF_RPORT_SESSION_READY,
893 &fcport->flags)) {
894 if (fcport->rdata)
896 "Waiting for fcport %p portid=%06x.\n",
897 fcport, fcport->rdata->ids.port_id);
900 "Waiting for fcport %p.\n", fcport);
1015 struct qedf_rport *fcport;
1019 list_for_each_entry_rcu(fcport, &qedf->fcports, peers) {
1020 rdata = fcport->rdata;
1025 return fcport;
1030 /* Return NULL to caller to let them know fcport was not found */
1035 static int qedf_xmit_l2_frame(struct qedf_rport *fcport, struct fc_frame *fp)
1045 qedf_send_adisc(fcport, fp);
1073 struct qedf_rport *fcport;
1140 fcport = qedf_fcport_lookup(qedf, ntoh24(fh->fh_d_id));
1142 if (fcport && test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
1143 rc = qedf_xmit_l2_frame(fcport, fp);
1245 static int qedf_alloc_sq(struct qedf_ctx *qedf, struct qedf_rport *fcport)
1253 fcport->sq_mem_size = SQ_NUM_ENTRIES * sizeof(struct fcoe_wqe);
1254 fcport->sq_mem_size = ALIGN(fcport->sq_mem_size, QEDF_PAGE_SIZE);
1255 fcport->sq_pbl_size = (fcport->sq_mem_size / QEDF_PAGE_SIZE) *
1257 fcport->sq_pbl_size = fcport->sq_pbl_size + QEDF_PAGE_SIZE;
1259 fcport->sq = dma_alloc_coherent(&qedf->pdev->dev, fcport->sq_mem_size,
1260 &fcport->sq_dma, GFP_KERNEL);
1261 if (!fcport->sq) {
1267 fcport->sq_pbl = dma_alloc_coherent(&qedf->pdev->dev,
1268 fcport->sq_pbl_size,
1269 &fcport->sq_pbl_dma, GFP_KERNEL);
1270 if (!fcport->sq_pbl) {
1277 num_pages = fcport->sq_mem_size / QEDF_PAGE_SIZE;
1278 page = fcport->sq_dma;
1279 pbl = (u32 *)fcport->sq_pbl;
1292 dma_free_coherent(&qedf->pdev->dev, fcport->sq_mem_size, fcport->sq,
1293 fcport->sq_dma);
1298 static void qedf_free_sq(struct qedf_ctx *qedf, struct qedf_rport *fcport)
1300 if (fcport->sq_pbl)
1301 dma_free_coherent(&qedf->pdev->dev, fcport->sq_pbl_size,
1302 fcport->sq_pbl, fcport->sq_pbl_dma);
1303 if (fcport->sq)
1304 dma_free_coherent(&qedf->pdev->dev, fcport->sq_mem_size,
1305 fcport->sq, fcport->sq_dma);
1309 struct qedf_rport *fcport)
1314 uint16_t total_sqe = (fcport->sq_mem_size / sizeof(struct fcoe_wqe));
1317 "portid=%06x.\n", fcport->rdata->ids.port_id);
1318 rval = qed_ops->acquire_conn(qedf->cdev, &fcport->handle,
1319 &fcport->fw_cid, &fcport->p_doorbell);
1322 "for portid=%06x.\n", fcport->rdata->ids.port_id);
1328 "fw_cid=%08x handle=%d.\n", fcport->rdata->ids.port_id,
1329 fcport->fw_cid, fcport->handle);
1334 conn_info.sq_pbl_addr = fcport->sq_pbl_dma;
1336 conn_info.sq_curr_page_addr = (dma_addr_t)(*(u64 *)fcport->sq_pbl);
1338 (dma_addr_t)(*(u64 *)(fcport->sq_pbl + 8));
1345 conn_info.tx_max_fc_pay_len = fcport->rdata->maxframe_size;
1348 conn_info.rx_max_fc_pay_len = fcport->rdata->maxframe_size;
1360 fcport->sid = port_id;
1365 conn_info.max_conc_seqs_c3 = fcport->rdata->max_seq;
1368 port_id = fcport->rdata->rport->port_id;
1376 if (fcport->dev_type == QEDF_RPORT_TYPE_TAPE) {
1379 fcport->rdata->ids.port_id);
1383 ((fcport->rdata->sp_features & FC_SP_FT_SEQC) ? 1 : 0) <<
1387 rval = qed_ops->offload_conn(qedf->cdev, fcport->handle, &conn_info);
1390 "for portid=%06x.\n", fcport->rdata->ids.port_id);
1395 fcport->rdata->ids.port_id, total_sqe);
1397 spin_lock_init(&fcport->rport_lock);
1398 atomic_set(&fcport->free_sqes, total_sqe);
1401 qed_ops->release_conn(qedf->cdev, fcport->handle);
1408 struct qedf_rport *fcport)
1421 "port_id=%06x.\n", fcport->rdata->ids.port_id);
1423 qed_ops->destroy_conn(qedf->cdev, fcport->handle, term_params_dma);
1424 qed_ops->release_conn(qedf->cdev, fcport->handle);
1431 struct qedf_rport *fcport)
1433 struct fc_rport_priv *rdata = fcport->rdata;
1436 fcport->rdata->ids.port_id);
1439 qedf_flush_active_ios(fcport, -1);
1441 if (test_and_clear_bit(QEDF_RPORT_SESSION_READY, &fcport->flags))
1442 qedf_upload_connection(qedf, fcport);
1443 qedf_free_sq(qedf, fcport);
1444 fcport->rdata = NULL;
1445 fcport->qedf = NULL;
1461 struct qedf_rport *fcport;
1477 fcport = (struct qedf_rport *)&rp[1];
1478 fcport->qedf = qedf;
1491 if (test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
1524 fcport->rdata = rdata;
1525 fcport->rport = rport;
1527 rval = qedf_alloc_sq(qedf, fcport);
1529 qedf_cleanup_fcport(qedf, fcport);
1537 fcport->dev_type = QEDF_RPORT_TYPE_TAPE;
1542 fcport->dev_type = QEDF_RPORT_TYPE_DISK;
1545 rval = qedf_offload_connection(qedf, fcport);
1547 qedf_cleanup_fcport(qedf, fcport);
1551 /* Add fcport to list of qedf_ctx list of offloaded ports */
1553 list_add_rcu(&fcport->peers, &qedf->fcports);
1560 set_bit(QEDF_RPORT_SESSION_READY, &fcport->flags);
1592 fcport = (struct qedf_rport *)&rp[1];
1594 spin_lock_irqsave(&fcport->rport_lock, flags);
1595 /* Only free this fcport if it is offloaded already */
1596 if (test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags) &&
1598 &fcport->flags)) {
1600 &fcport->flags);
1601 spin_unlock_irqrestore(&fcport->rport_lock, flags);
1602 qedf_cleanup_fcport(qedf, fcport);
1604 * Remove fcport to list of qedf_ctx list of offloaded
1608 list_del_rcu(&fcport->peers);
1612 &fcport->flags);
1615 spin_unlock_irqrestore(&fcport->rport_lock, flags);
2467 struct qedf_rport *fcport;
2585 /* Get fcport associated with d_id if it exists */
2586 fcport = qedf_fcport_lookup(qedf, ntoh24(fh->fh_d_id));
2588 if (fcport && test_bit(QEDF_RPORT_UPLOADING_CONNECTION,
2589 &fcport->flags)) {
2804 struct qedf_rport *fcport;
2822 fcport = io_req->fcport;
2824 if (fcport == NULL) {
2826 "fcport is NULL for xid=0x%x io_req=%p.\n",
2832 * Check that fcport is offloaded. If it isn't then the spinlock
2835 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
2837 "Session not offloaded yet, fcport = %p.\n", fcport);
2841 spin_lock_irqsave(&fcport->rport_lock, flags);
2843 spin_unlock_irqrestore(&fcport->rport_lock, flags);
2847 atomic_inc(&fcport->free_sqes);
2864 atomic_inc(&fcport->free_sqes);
2870 atomic_inc(&fcport->free_sqes);
2876 atomic_inc(&fcport->free_sqes);
2882 atomic_inc(&fcport->free_sqes);
2887 atomic_inc(&fcport->free_sqes);
2892 atomic_inc(&fcport->free_sqes);
2898 atomic_inc(&fcport->free_sqes);