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;
891 list_for_each_entry_rcu(fcport, &qedf->fcports, peers) {
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);
1016 struct qedf_rport *fcport;
1020 list_for_each_entry_rcu(fcport, &qedf->fcports, peers) {
1021 rdata = fcport->rdata;
1026 return fcport;
1031 /* Return NULL to caller to let them know fcport was not found */
1036 static int qedf_xmit_l2_frame(struct qedf_rport *fcport, struct fc_frame *fp)
1046 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);
1243 static int qedf_alloc_sq(struct qedf_ctx *qedf, struct qedf_rport *fcport)
1251 fcport->sq_mem_size = SQ_NUM_ENTRIES * sizeof(struct fcoe_wqe);
1252 fcport->sq_mem_size = ALIGN(fcport->sq_mem_size, QEDF_PAGE_SIZE);
1253 fcport->sq_pbl_size = (fcport->sq_mem_size / QEDF_PAGE_SIZE) *
1255 fcport->sq_pbl_size = fcport->sq_pbl_size + QEDF_PAGE_SIZE;
1257 fcport->sq = dma_alloc_coherent(&qedf->pdev->dev, fcport->sq_mem_size,
1258 &fcport->sq_dma, GFP_KERNEL);
1259 if (!fcport->sq) {
1265 fcport->sq_pbl = dma_alloc_coherent(&qedf->pdev->dev,
1266 fcport->sq_pbl_size,
1267 &fcport->sq_pbl_dma, GFP_KERNEL);
1268 if (!fcport->sq_pbl) {
1275 num_pages = fcport->sq_mem_size / QEDF_PAGE_SIZE;
1276 page = fcport->sq_dma;
1277 pbl = (u32 *)fcport->sq_pbl;
1290 dma_free_coherent(&qedf->pdev->dev, fcport->sq_mem_size, fcport->sq,
1291 fcport->sq_dma);
1296 static void qedf_free_sq(struct qedf_ctx *qedf, struct qedf_rport *fcport)
1298 if (fcport->sq_pbl)
1299 dma_free_coherent(&qedf->pdev->dev, fcport->sq_pbl_size,
1300 fcport->sq_pbl, fcport->sq_pbl_dma);
1301 if (fcport->sq)
1302 dma_free_coherent(&qedf->pdev->dev, fcport->sq_mem_size,
1303 fcport->sq, fcport->sq_dma);
1307 struct qedf_rport *fcport)
1312 uint16_t total_sqe = (fcport->sq_mem_size / sizeof(struct fcoe_wqe));
1315 "portid=%06x.\n", fcport->rdata->ids.port_id);
1316 rval = qed_ops->acquire_conn(qedf->cdev, &fcport->handle,
1317 &fcport->fw_cid, &fcport->p_doorbell);
1320 "for portid=%06x.\n", fcport->rdata->ids.port_id);
1326 "fw_cid=%08x handle=%d.\n", fcport->rdata->ids.port_id,
1327 fcport->fw_cid, fcport->handle);
1332 conn_info.sq_pbl_addr = fcport->sq_pbl_dma;
1334 conn_info.sq_curr_page_addr = (dma_addr_t)(*(u64 *)fcport->sq_pbl);
1336 (dma_addr_t)(*(u64 *)(fcport->sq_pbl + 8));
1343 conn_info.tx_max_fc_pay_len = fcport->rdata->maxframe_size;
1346 conn_info.rx_max_fc_pay_len = fcport->rdata->maxframe_size;
1358 fcport->sid = port_id;
1363 conn_info.max_conc_seqs_c3 = fcport->rdata->max_seq;
1366 port_id = fcport->rdata->rport->port_id;
1374 if (fcport->dev_type == QEDF_RPORT_TYPE_TAPE) {
1377 fcport->rdata->ids.port_id);
1381 ((fcport->rdata->sp_features & FC_SP_FT_SEQC) ? 1 : 0) <<
1385 rval = qed_ops->offload_conn(qedf->cdev, fcport->handle, &conn_info);
1388 "for portid=%06x.\n", fcport->rdata->ids.port_id);
1393 fcport->rdata->ids.port_id, total_sqe);
1395 spin_lock_init(&fcport->rport_lock);
1396 atomic_set(&fcport->free_sqes, total_sqe);
1399 qed_ops->release_conn(qedf->cdev, fcport->handle);
1406 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);
2469 struct qedf_rport *fcport;
2587 /* Get fcport associated with d_id if it exists */
2588 fcport = qedf_fcport_lookup(qedf, ntoh24(fh->fh_d_id));
2590 if (fcport && test_bit(QEDF_RPORT_UPLOADING_CONNECTION,
2591 &fcport->flags)) {
2806 struct qedf_rport *fcport;
2824 fcport = io_req->fcport;
2826 if (fcport == NULL) {
2828 "fcport is NULL for xid=0x%x io_req=%p.\n",
2834 * Check that fcport is offloaded. If it isn't then the spinlock
2837 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) {
2839 "Session not offloaded yet, fcport = %p.\n", fcport);
2843 spin_lock_irqsave(&fcport->rport_lock, flags);
2845 spin_unlock_irqrestore(&fcport->rport_lock, flags);
2849 atomic_inc(&fcport->free_sqes);
2866 atomic_inc(&fcport->free_sqes);
2872 atomic_inc(&fcport->free_sqes);
2878 atomic_inc(&fcport->free_sqes);
2884 atomic_inc(&fcport->free_sqes);
2889 atomic_inc(&fcport->free_sqes);
2894 atomic_inc(&fcport->free_sqes);
2900 atomic_inc(&fcport->free_sqes);