diff options
| -rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_cxt.c | 3 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_dev.c | 5 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_iscsi.c | 31 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_ll2.c | 11 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_ooo.c | 2 |
5 files changed, 44 insertions, 8 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c index d42d03df751a..7e3a6fed3da6 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c +++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c | |||
| @@ -422,8 +422,9 @@ static void qed_cxt_set_proto_cid_count(struct qed_hwfn *p_hwfn, | |||
| 422 | u32 page_sz = p_mgr->clients[ILT_CLI_CDUC].p_size.val; | 422 | u32 page_sz = p_mgr->clients[ILT_CLI_CDUC].p_size.val; |
| 423 | u32 cxt_size = CONN_CXT_SIZE(p_hwfn); | 423 | u32 cxt_size = CONN_CXT_SIZE(p_hwfn); |
| 424 | u32 elems_per_page = ILT_PAGE_IN_BYTES(page_sz) / cxt_size; | 424 | u32 elems_per_page = ILT_PAGE_IN_BYTES(page_sz) / cxt_size; |
| 425 | u32 align = elems_per_page * DQ_RANGE_ALIGN; | ||
| 425 | 426 | ||
| 426 | p_conn->cid_count = roundup(p_conn->cid_count, elems_per_page); | 427 | p_conn->cid_count = roundup(p_conn->cid_count, align); |
| 427 | } | 428 | } |
| 428 | } | 429 | } |
| 429 | 430 | ||
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index e2a081ceaf52..e518f914eab1 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c | |||
| @@ -2389,9 +2389,8 @@ qed_chain_alloc_sanity_check(struct qed_dev *cdev, | |||
| 2389 | * size/capacity fields are of a u32 type. | 2389 | * size/capacity fields are of a u32 type. |
| 2390 | */ | 2390 | */ |
| 2391 | if ((cnt_type == QED_CHAIN_CNT_TYPE_U16 && | 2391 | if ((cnt_type == QED_CHAIN_CNT_TYPE_U16 && |
| 2392 | chain_size > 0x10000) || | 2392 | chain_size > ((u32)U16_MAX + 1)) || |
| 2393 | (cnt_type == QED_CHAIN_CNT_TYPE_U32 && | 2393 | (cnt_type == QED_CHAIN_CNT_TYPE_U32 && chain_size > U32_MAX)) { |
| 2394 | chain_size > 0x100000000ULL)) { | ||
| 2395 | DP_NOTICE(cdev, | 2394 | DP_NOTICE(cdev, |
| 2396 | "The actual chain size (0x%llx) is larger than the maximal possible value\n", | 2395 | "The actual chain size (0x%llx) is larger than the maximal possible value\n", |
| 2397 | chain_size); | 2396 | chain_size); |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c index 3a44d6b395fa..098766f7fe88 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iscsi.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iscsi.c | |||
| @@ -190,6 +190,9 @@ qed_sp_iscsi_func_start(struct qed_hwfn *p_hwfn, | |||
| 190 | p_init->num_sq_pages_in_ring = p_params->num_sq_pages_in_ring; | 190 | p_init->num_sq_pages_in_ring = p_params->num_sq_pages_in_ring; |
| 191 | p_init->num_r2tq_pages_in_ring = p_params->num_r2tq_pages_in_ring; | 191 | p_init->num_r2tq_pages_in_ring = p_params->num_r2tq_pages_in_ring; |
| 192 | p_init->num_uhq_pages_in_ring = p_params->num_uhq_pages_in_ring; | 192 | p_init->num_uhq_pages_in_ring = p_params->num_uhq_pages_in_ring; |
| 193 | p_init->ooo_enable = p_params->ooo_enable; | ||
| 194 | p_init->ll2_rx_queue_id = p_hwfn->hw_info.resc_start[QED_LL2_QUEUE] + | ||
| 195 | p_params->ll2_ooo_queue_id; | ||
| 193 | p_init->func_params.log_page_size = p_params->log_page_size; | 196 | p_init->func_params.log_page_size = p_params->log_page_size; |
| 194 | val = p_params->num_tasks; | 197 | val = p_params->num_tasks; |
| 195 | p_init->func_params.num_tasks = cpu_to_le16(val); | 198 | p_init->func_params.num_tasks = cpu_to_le16(val); |
| @@ -786,6 +789,23 @@ static void qed_iscsi_release_connection(struct qed_hwfn *p_hwfn, | |||
| 786 | spin_unlock_bh(&p_hwfn->p_iscsi_info->lock); | 789 | spin_unlock_bh(&p_hwfn->p_iscsi_info->lock); |
| 787 | } | 790 | } |
| 788 | 791 | ||
| 792 | void qed_iscsi_free_connection(struct qed_hwfn *p_hwfn, | ||
| 793 | struct qed_iscsi_conn *p_conn) | ||
| 794 | { | ||
| 795 | qed_chain_free(p_hwfn->cdev, &p_conn->xhq); | ||
| 796 | qed_chain_free(p_hwfn->cdev, &p_conn->uhq); | ||
| 797 | qed_chain_free(p_hwfn->cdev, &p_conn->r2tq); | ||
| 798 | dma_free_coherent(&p_hwfn->cdev->pdev->dev, | ||
| 799 | sizeof(struct tcp_upload_params), | ||
| 800 | p_conn->tcp_upload_params_virt_addr, | ||
| 801 | p_conn->tcp_upload_params_phys_addr); | ||
| 802 | dma_free_coherent(&p_hwfn->cdev->pdev->dev, | ||
| 803 | sizeof(struct scsi_terminate_extra_params), | ||
| 804 | p_conn->queue_cnts_virt_addr, | ||
| 805 | p_conn->queue_cnts_phys_addr); | ||
| 806 | kfree(p_conn); | ||
| 807 | } | ||
| 808 | |||
| 789 | struct qed_iscsi_info *qed_iscsi_alloc(struct qed_hwfn *p_hwfn) | 809 | struct qed_iscsi_info *qed_iscsi_alloc(struct qed_hwfn *p_hwfn) |
| 790 | { | 810 | { |
| 791 | struct qed_iscsi_info *p_iscsi_info; | 811 | struct qed_iscsi_info *p_iscsi_info; |
| @@ -807,6 +827,17 @@ void qed_iscsi_setup(struct qed_hwfn *p_hwfn, | |||
| 807 | void qed_iscsi_free(struct qed_hwfn *p_hwfn, | 827 | void qed_iscsi_free(struct qed_hwfn *p_hwfn, |
| 808 | struct qed_iscsi_info *p_iscsi_info) | 828 | struct qed_iscsi_info *p_iscsi_info) |
| 809 | { | 829 | { |
| 830 | struct qed_iscsi_conn *p_conn = NULL; | ||
| 831 | |||
| 832 | while (!list_empty(&p_hwfn->p_iscsi_info->free_list)) { | ||
| 833 | p_conn = list_first_entry(&p_hwfn->p_iscsi_info->free_list, | ||
| 834 | struct qed_iscsi_conn, list_entry); | ||
| 835 | if (p_conn) { | ||
| 836 | list_del(&p_conn->list_entry); | ||
| 837 | qed_iscsi_free_connection(p_hwfn, p_conn); | ||
| 838 | } | ||
| 839 | } | ||
| 840 | |||
| 810 | kfree(p_iscsi_info); | 841 | kfree(p_iscsi_info); |
| 811 | } | 842 | } |
| 812 | 843 | ||
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index 5fb34db377c8..0d3cef409c96 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c | |||
| @@ -211,6 +211,8 @@ static void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn, | |||
| 211 | /* If need to reuse or there's no replacement buffer, repost this */ | 211 | /* If need to reuse or there's no replacement buffer, repost this */ |
| 212 | if (rc) | 212 | if (rc) |
| 213 | goto out_post; | 213 | goto out_post; |
| 214 | dma_unmap_single(&cdev->pdev->dev, buffer->phys_addr, | ||
| 215 | cdev->ll2->rx_size, DMA_FROM_DEVICE); | ||
| 214 | 216 | ||
| 215 | skb = build_skb(buffer->data, 0); | 217 | skb = build_skb(buffer->data, 0); |
| 216 | if (!skb) { | 218 | if (!skb) { |
| @@ -474,7 +476,7 @@ qed_ll2_rxq_completion_gsi(struct qed_hwfn *p_hwfn, | |||
| 474 | static int qed_ll2_rxq_completion_reg(struct qed_hwfn *p_hwfn, | 476 | static int qed_ll2_rxq_completion_reg(struct qed_hwfn *p_hwfn, |
| 475 | struct qed_ll2_info *p_ll2_conn, | 477 | struct qed_ll2_info *p_ll2_conn, |
| 476 | union core_rx_cqe_union *p_cqe, | 478 | union core_rx_cqe_union *p_cqe, |
| 477 | unsigned long lock_flags, | 479 | unsigned long *p_lock_flags, |
| 478 | bool b_last_cqe) | 480 | bool b_last_cqe) |
| 479 | { | 481 | { |
| 480 | struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; | 482 | struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; |
| @@ -495,10 +497,10 @@ static int qed_ll2_rxq_completion_reg(struct qed_hwfn *p_hwfn, | |||
| 495 | "Mismatch between active_descq and the LL2 Rx chain\n"); | 497 | "Mismatch between active_descq and the LL2 Rx chain\n"); |
| 496 | list_add_tail(&p_pkt->list_entry, &p_rx->free_descq); | 498 | list_add_tail(&p_pkt->list_entry, &p_rx->free_descq); |
| 497 | 499 | ||
| 498 | spin_unlock_irqrestore(&p_rx->lock, lock_flags); | 500 | spin_unlock_irqrestore(&p_rx->lock, *p_lock_flags); |
| 499 | qed_ll2b_complete_rx_packet(p_hwfn, p_ll2_conn->my_id, | 501 | qed_ll2b_complete_rx_packet(p_hwfn, p_ll2_conn->my_id, |
| 500 | p_pkt, &p_cqe->rx_cqe_fp, b_last_cqe); | 502 | p_pkt, &p_cqe->rx_cqe_fp, b_last_cqe); |
| 501 | spin_lock_irqsave(&p_rx->lock, lock_flags); | 503 | spin_lock_irqsave(&p_rx->lock, *p_lock_flags); |
| 502 | 504 | ||
| 503 | return 0; | 505 | return 0; |
| 504 | } | 506 | } |
| @@ -538,7 +540,8 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie) | |||
| 538 | break; | 540 | break; |
| 539 | case CORE_RX_CQE_TYPE_REGULAR: | 541 | case CORE_RX_CQE_TYPE_REGULAR: |
| 540 | rc = qed_ll2_rxq_completion_reg(p_hwfn, p_ll2_conn, | 542 | rc = qed_ll2_rxq_completion_reg(p_hwfn, p_ll2_conn, |
| 541 | cqe, flags, b_last_cqe); | 543 | cqe, &flags, |
| 544 | b_last_cqe); | ||
| 542 | break; | 545 | break; |
| 543 | default: | 546 | default: |
| 544 | rc = -EIO; | 547 | rc = -EIO; |
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ooo.c b/drivers/net/ethernet/qlogic/qed/qed_ooo.c index 7d731c6cb892..378afce58b3f 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ooo.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ooo.c | |||
| @@ -159,6 +159,8 @@ struct qed_ooo_info *qed_ooo_alloc(struct qed_hwfn *p_hwfn) | |||
| 159 | if (!p_ooo_info->ooo_history.p_cqes) | 159 | if (!p_ooo_info->ooo_history.p_cqes) |
| 160 | goto no_history_mem; | 160 | goto no_history_mem; |
| 161 | 161 | ||
| 162 | p_ooo_info->ooo_history.num_of_cqes = QED_MAX_NUM_OOO_HISTORY_ENTRIES; | ||
| 163 | |||
| 162 | return p_ooo_info; | 164 | return p_ooo_info; |
| 163 | 165 | ||
| 164 | no_history_mem: | 166 | no_history_mem: |
