| .. | .. |
|---|
| 181 | 181 | |
|---|
| 182 | 182 | /** |
|---|
| 183 | 183 | * bnx2i_get_rq_buf - copy RQ buffer contents to driver buffer |
|---|
| 184 | | - * @conn: iscsi connection on which RQ event occurred |
|---|
| 184 | + * @bnx2i_conn: iscsi connection on which RQ event occurred |
|---|
| 185 | 185 | * @ptr: driver buffer to which RQ buffer contents is to |
|---|
| 186 | 186 | * be copied |
|---|
| 187 | 187 | * @len: length of valid data inside RQ buf |
|---|
| .. | .. |
|---|
| 223 | 223 | |
|---|
| 224 | 224 | /** |
|---|
| 225 | 225 | * bnx2i_put_rq_buf - Replenish RQ buffer, if required ring on chip doorbell |
|---|
| 226 | | - * @conn: iscsi connection on which event to post |
|---|
| 226 | + * @bnx2i_conn: iscsi connection on which event to post |
|---|
| 227 | 227 | * @count: number of RQ buffer being posted to chip |
|---|
| 228 | 228 | * |
|---|
| 229 | 229 | * No need to ring hardware doorbell for 57710 family of devices |
|---|
| .. | .. |
|---|
| 253 | 253 | writew(ep->qp.rq_prod_idx, |
|---|
| 254 | 254 | ep->qp.ctx_base + CNIC_RECV_DOORBELL); |
|---|
| 255 | 255 | } |
|---|
| 256 | | - mmiowb(); |
|---|
| 257 | 256 | } |
|---|
| 258 | 257 | |
|---|
| 259 | 258 | |
|---|
| 260 | 259 | /** |
|---|
| 261 | 260 | * bnx2i_ring_sq_dbell - Ring SQ doorbell to wake-up the processing engine |
|---|
| 262 | | - * @conn: iscsi connection to which new SQ entries belong |
|---|
| 261 | + * @bnx2i_conn: iscsi connection to which new SQ entries belong |
|---|
| 263 | 262 | * @count: number of SQ WQEs to post |
|---|
| 264 | 263 | * |
|---|
| 265 | 264 | * SQ DB is updated in host memory and TX Doorbell is rung for 57710 family |
|---|
| .. | .. |
|---|
| 279 | 278 | bnx2i_ring_577xx_doorbell(bnx2i_conn); |
|---|
| 280 | 279 | } else |
|---|
| 281 | 280 | writew(count, ep->qp.ctx_base + CNIC_SEND_DOORBELL); |
|---|
| 282 | | - |
|---|
| 283 | | - mmiowb(); /* flush posted PCI writes */ |
|---|
| 284 | 281 | } |
|---|
| 285 | 282 | |
|---|
| 286 | 283 | |
|---|
| 287 | 284 | /** |
|---|
| 288 | 285 | * bnx2i_ring_dbell_update_sq_params - update SQ driver parameters |
|---|
| 289 | | - * @conn: iscsi connection to which new SQ entries belong |
|---|
| 286 | + * @bnx2i_conn: iscsi connection to which new SQ entries belong |
|---|
| 290 | 287 | * @count: number of SQ WQEs to post |
|---|
| 291 | 288 | * |
|---|
| 292 | 289 | * this routine will update SQ driver parameters and ring the doorbell |
|---|
| .. | .. |
|---|
| 323 | 320 | |
|---|
| 324 | 321 | /** |
|---|
| 325 | 322 | * bnx2i_send_iscsi_login - post iSCSI login request MP WQE to hardware |
|---|
| 326 | | - * @conn: iscsi connection |
|---|
| 327 | | - * @cmd: driver command structure which is requesting |
|---|
| 328 | | - * a WQE to sent to chip for further processing |
|---|
| 323 | + * @bnx2i_conn: iscsi connection |
|---|
| 324 | + * @task: transport layer's command structure pointer which is requesting |
|---|
| 325 | + * a WQE to sent to chip for further processing |
|---|
| 329 | 326 | * |
|---|
| 330 | 327 | * prepare and post an iSCSI Login request WQE to CNIC firmware |
|---|
| 331 | 328 | */ |
|---|
| .. | .. |
|---|
| 376 | 373 | |
|---|
| 377 | 374 | /** |
|---|
| 378 | 375 | * bnx2i_send_iscsi_tmf - post iSCSI task management request MP WQE to hardware |
|---|
| 379 | | - * @conn: iscsi connection |
|---|
| 376 | + * @bnx2i_conn: iscsi connection |
|---|
| 380 | 377 | * @mtask: driver command structure which is requesting |
|---|
| 381 | 378 | * a WQE to sent to chip for further processing |
|---|
| 382 | 379 | * |
|---|
| .. | .. |
|---|
| 450 | 447 | |
|---|
| 451 | 448 | /** |
|---|
| 452 | 449 | * bnx2i_send_iscsi_text - post iSCSI text WQE to hardware |
|---|
| 453 | | - * @conn: iscsi connection |
|---|
| 450 | + * @bnx2i_conn: iscsi connection |
|---|
| 454 | 451 | * @mtask: driver command structure which is requesting |
|---|
| 455 | 452 | * a WQE to sent to chip for further processing |
|---|
| 456 | 453 | * |
|---|
| .. | .. |
|---|
| 498 | 495 | |
|---|
| 499 | 496 | /** |
|---|
| 500 | 497 | * bnx2i_send_iscsi_scsicmd - post iSCSI scsicmd request WQE to hardware |
|---|
| 501 | | - * @conn: iscsi connection |
|---|
| 498 | + * @bnx2i_conn: iscsi connection |
|---|
| 502 | 499 | * @cmd: driver command structure which is requesting |
|---|
| 503 | 500 | * a WQE to sent to chip for further processing |
|---|
| 504 | 501 | * |
|---|
| .. | .. |
|---|
| 520 | 517 | |
|---|
| 521 | 518 | /** |
|---|
| 522 | 519 | * bnx2i_send_iscsi_nopout - post iSCSI NOPOUT request WQE to hardware |
|---|
| 523 | | - * @conn: iscsi connection |
|---|
| 524 | | - * @cmd: driver command structure which is requesting |
|---|
| 525 | | - * a WQE to sent to chip for further processing |
|---|
| 520 | + * @bnx2i_conn: iscsi connection |
|---|
| 521 | + * @task: transport layer's command structure pointer which is |
|---|
| 522 | + * requesting a WQE to sent to chip for further processing |
|---|
| 526 | 523 | * @datap: payload buffer pointer |
|---|
| 527 | 524 | * @data_len: payload data length |
|---|
| 528 | 525 | * @unsol: indicated whether nopout pdu is unsolicited pdu or |
|---|
| .. | .. |
|---|
| 582 | 579 | |
|---|
| 583 | 580 | /** |
|---|
| 584 | 581 | * bnx2i_send_iscsi_logout - post iSCSI logout request WQE to hardware |
|---|
| 585 | | - * @conn: iscsi connection |
|---|
| 586 | | - * @cmd: driver command structure which is requesting |
|---|
| 587 | | - * a WQE to sent to chip for further processing |
|---|
| 582 | + * @bnx2i_conn: iscsi connection |
|---|
| 583 | + * @task: transport layer's command structure pointer which is |
|---|
| 584 | + * requesting a WQE to sent to chip for further processing |
|---|
| 588 | 585 | * |
|---|
| 589 | 586 | * prepare and post logout request WQE to CNIC firmware |
|---|
| 590 | 587 | */ |
|---|
| .. | .. |
|---|
| 681 | 678 | |
|---|
| 682 | 679 | /** |
|---|
| 683 | 680 | * bnx2i_ep_ofld_timer - post iSCSI logout request WQE to hardware |
|---|
| 684 | | - * @data: endpoint (transport handle) structure pointer |
|---|
| 681 | + * @t: timer context used to fetch the endpoint (transport |
|---|
| 682 | + * handle) structure pointer |
|---|
| 685 | 683 | * |
|---|
| 686 | 684 | * routine to handle connection offload/destroy request timeout |
|---|
| 687 | 685 | */ |
|---|
| .. | .. |
|---|
| 1070 | 1068 | |
|---|
| 1071 | 1069 | /* Allocate memory area for actual SQ element */ |
|---|
| 1072 | 1070 | ep->qp.sq_virt = |
|---|
| 1073 | | - dma_zalloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, |
|---|
| 1074 | | - &ep->qp.sq_phys, GFP_KERNEL); |
|---|
| 1071 | + dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, |
|---|
| 1072 | + &ep->qp.sq_phys, GFP_KERNEL); |
|---|
| 1075 | 1073 | if (!ep->qp.sq_virt) { |
|---|
| 1076 | 1074 | printk(KERN_ALERT "bnx2i: unable to alloc SQ BD memory %d\n", |
|---|
| 1077 | 1075 | ep->qp.sq_mem_size); |
|---|
| .. | .. |
|---|
| 1106 | 1104 | |
|---|
| 1107 | 1105 | /* Allocate memory area for actual CQ element */ |
|---|
| 1108 | 1106 | ep->qp.cq_virt = |
|---|
| 1109 | | - dma_zalloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, |
|---|
| 1110 | | - &ep->qp.cq_phys, GFP_KERNEL); |
|---|
| 1107 | + dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, |
|---|
| 1108 | + &ep->qp.cq_phys, GFP_KERNEL); |
|---|
| 1111 | 1109 | if (!ep->qp.cq_virt) { |
|---|
| 1112 | 1110 | printk(KERN_ALERT "bnx2i: unable to alloc CQ BD memory %d\n", |
|---|
| 1113 | 1111 | ep->qp.cq_mem_size); |
|---|
| .. | .. |
|---|
| 1665 | 1663 | |
|---|
| 1666 | 1664 | /** |
|---|
| 1667 | 1665 | * bnx2i_unsol_pdu_adjust_rq - makes adjustments to RQ after unsol pdu is recvd |
|---|
| 1668 | | - * @conn: iscsi connection |
|---|
| 1666 | + * @bnx2i_conn: iscsi connection |
|---|
| 1669 | 1667 | * |
|---|
| 1670 | 1668 | * Firmware advances RQ producer index for every unsolicited PDU even if |
|---|
| 1671 | 1669 | * payload data length is '0'. This function makes corresponding |
|---|
| .. | .. |
|---|
| 1888 | 1886 | |
|---|
| 1889 | 1887 | /** |
|---|
| 1890 | 1888 | * bnx2i_queue_scsi_cmd_resp - queue cmd completion to the percpu thread |
|---|
| 1889 | + * @session: iscsi session |
|---|
| 1891 | 1890 | * @bnx2i_conn: bnx2i connection |
|---|
| 1891 | + * @cqe: pointer to newly DMA'ed CQE entry for processing |
|---|
| 1892 | 1892 | * |
|---|
| 1893 | 1893 | * this function is called by generic KCQ handler to queue all pending cmd |
|---|
| 1894 | 1894 | * completion CQEs |
|---|
| .. | .. |
|---|
| 1906 | 1906 | struct iscsi_task *task; |
|---|
| 1907 | 1907 | struct scsi_cmnd *sc; |
|---|
| 1908 | 1908 | int rc = 0; |
|---|
| 1909 | | - int cpu; |
|---|
| 1910 | 1909 | |
|---|
| 1911 | 1910 | spin_lock(&session->back_lock); |
|---|
| 1912 | 1911 | task = iscsi_itt_to_task(bnx2i_conn->cls_conn->dd_data, |
|---|
| .. | .. |
|---|
| 1917 | 1916 | } |
|---|
| 1918 | 1917 | sc = task->sc; |
|---|
| 1919 | 1918 | |
|---|
| 1920 | | - if (!blk_rq_cpu_valid(sc->request)) |
|---|
| 1921 | | - cpu = smp_processor_id(); |
|---|
| 1922 | | - else |
|---|
| 1923 | | - cpu = sc->request->cpu; |
|---|
| 1924 | | - |
|---|
| 1925 | 1919 | spin_unlock(&session->back_lock); |
|---|
| 1926 | 1920 | |
|---|
| 1927 | | - p = &per_cpu(bnx2i_percpu, cpu); |
|---|
| 1921 | + p = &per_cpu(bnx2i_percpu, blk_mq_rq_cpu(sc->request)); |
|---|
| 1928 | 1922 | spin_lock(&p->p_work_lock); |
|---|
| 1929 | 1923 | if (unlikely(!p->iothread)) { |
|---|
| 1930 | 1924 | rc = -EINVAL; |
|---|
| .. | .. |
|---|
| 2433 | 2427 | { |
|---|
| 2434 | 2428 | u32 cid_addr; |
|---|
| 2435 | 2429 | struct bnx2i_endpoint *ep; |
|---|
| 2436 | | - u32 cid_num; |
|---|
| 2437 | 2430 | |
|---|
| 2438 | 2431 | ep = bnx2i_find_ep_in_ofld_list(hba, ofld_kcqe->iscsi_conn_id); |
|---|
| 2439 | 2432 | if (!ep) { |
|---|
| .. | .. |
|---|
| 2468 | 2461 | } else { |
|---|
| 2469 | 2462 | ep->state = EP_STATE_OFLD_COMPL; |
|---|
| 2470 | 2463 | cid_addr = ofld_kcqe->iscsi_conn_context_id; |
|---|
| 2471 | | - cid_num = bnx2i_get_cid_num(ep); |
|---|
| 2472 | 2464 | ep->ep_cid = cid_addr; |
|---|
| 2473 | 2465 | ep->qp.ctx_base = NULL; |
|---|
| 2474 | 2466 | } |
|---|
| .. | .. |
|---|
| 2477 | 2469 | |
|---|
| 2478 | 2470 | /** |
|---|
| 2479 | 2471 | * bnx2i_indicate_kcqe - process iscsi conn update completion KCQE |
|---|
| 2480 | | - * @hba: adapter structure pointer |
|---|
| 2481 | | - * @update_kcqe: kcqe pointer |
|---|
| 2472 | + * @context: adapter structure pointer |
|---|
| 2473 | + * @kcqe: kcqe pointer |
|---|
| 2474 | + * @num_cqe: number of kcqes to process |
|---|
| 2482 | 2475 | * |
|---|
| 2483 | 2476 | * Generic KCQ event handler/dispatcher |
|---|
| 2484 | 2477 | */ |
|---|
| .. | .. |
|---|
| 2625 | 2618 | |
|---|
| 2626 | 2619 | /** |
|---|
| 2627 | 2620 | * bnx2i_cm_remote_close - process received TCP FIN |
|---|
| 2628 | | - * @hba: adapter structure pointer |
|---|
| 2629 | | - * @update_kcqe: kcqe pointer |
|---|
| 2621 | + * @cm_sk: cnic sock structure pointer |
|---|
| 2630 | 2622 | * |
|---|
| 2631 | 2623 | * function callback exported via bnx2i - cnic driver interface to indicate |
|---|
| 2632 | 2624 | * async TCP events such as FIN |
|---|
| .. | .. |
|---|
| 2642 | 2634 | |
|---|
| 2643 | 2635 | /** |
|---|
| 2644 | 2636 | * bnx2i_cm_remote_abort - process TCP RST and start conn cleanup |
|---|
| 2645 | | - * @hba: adapter structure pointer |
|---|
| 2646 | | - * @update_kcqe: kcqe pointer |
|---|
| 2637 | + * @cm_sk: cnic sock structure pointer |
|---|
| 2647 | 2638 | * |
|---|
| 2648 | 2639 | * function callback exported via bnx2i - cnic driver interface to |
|---|
| 2649 | 2640 | * indicate async TCP events (RST) sent by the peer. |
|---|
| .. | .. |
|---|
| 2680 | 2671 | } |
|---|
| 2681 | 2672 | |
|---|
| 2682 | 2673 | |
|---|
| 2683 | | -/** |
|---|
| 2674 | +/* |
|---|
| 2684 | 2675 | * bnx2i_cnic_cb - global template of bnx2i - cnic driver interface structure |
|---|
| 2685 | 2676 | * carrying callback function pointers |
|---|
| 2686 | | - * |
|---|
| 2687 | 2677 | */ |
|---|
| 2688 | 2678 | struct cnic_ulp_ops bnx2i_cnic_cb = { |
|---|
| 2689 | 2679 | .cnic_init = bnx2i_ulp_init, |
|---|
| .. | .. |
|---|
| 2726 | 2716 | reg_base = pci_resource_start(ep->hba->pcidev, |
|---|
| 2727 | 2717 | BNX2X_DOORBELL_PCI_BAR); |
|---|
| 2728 | 2718 | reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF); |
|---|
| 2729 | | - ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); |
|---|
| 2719 | + ep->qp.ctx_base = ioremap(reg_base + reg_off, 4); |
|---|
| 2730 | 2720 | if (!ep->qp.ctx_base) |
|---|
| 2731 | 2721 | return -ENOMEM; |
|---|
| 2732 | 2722 | goto arm_cq; |
|---|
| .. | .. |
|---|
| 2747 | 2737 | /* 5709 device in normal node and 5706/5708 devices */ |
|---|
| 2748 | 2738 | reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num); |
|---|
| 2749 | 2739 | |
|---|
| 2750 | | - ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off, |
|---|
| 2740 | + ep->qp.ctx_base = ioremap(ep->hba->reg_base + reg_off, |
|---|
| 2751 | 2741 | MB_KERNEL_CTX_SIZE); |
|---|
| 2752 | 2742 | if (!ep->qp.ctx_base) |
|---|
| 2753 | 2743 | return -ENOMEM; |
|---|