Skip to content

Commit 1e6a1cd

Browse files
committed
Merge branch 'qed-fixes'
Yuval Mintz says: ==================== qed: Fixes series This address several different issues in qed. The more significant portions: Patch #1 would cause timeout when qedr utilizes the highest CIDs availble for it [or when future qede adapters would utilize queues in some constellations]. Patch #4 fixes a leak of mapped addresses; When iommu is enabled, offloaded storage protocols might eventually run out of resources and fail to map additional buffers. Patches #6,#7 were missing in the initial iSCSI infrastructure submissions, and would hamper qedi's stability when it reaches out-of-order scenarios. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents a8aa395 + 6b116b1 commit 1e6a1cd

File tree

5 files changed

+44
-8
lines changed

5 files changed

+44
-8
lines changed

drivers/net/ethernet/qlogic/qed/qed_cxt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ static void qed_cxt_set_proto_cid_count(struct qed_hwfn *p_hwfn,
422422
u32 page_sz = p_mgr->clients[ILT_CLI_CDUC].p_size.val;
423423
u32 cxt_size = CONN_CXT_SIZE(p_hwfn);
424424
u32 elems_per_page = ILT_PAGE_IN_BYTES(page_sz) / cxt_size;
425+
u32 align = elems_per_page * DQ_RANGE_ALIGN;
425426

426-
p_conn->cid_count = roundup(p_conn->cid_count, elems_per_page);
427+
p_conn->cid_count = roundup(p_conn->cid_count, align);
427428
}
428429
}
429430

drivers/net/ethernet/qlogic/qed/qed_dev.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,9 +2389,8 @@ qed_chain_alloc_sanity_check(struct qed_dev *cdev,
23892389
* size/capacity fields are of a u32 type.
23902390
*/
23912391
if ((cnt_type == QED_CHAIN_CNT_TYPE_U16 &&
2392-
chain_size > 0x10000) ||
2393-
(cnt_type == QED_CHAIN_CNT_TYPE_U32 &&
2394-
chain_size > 0x100000000ULL)) {
2392+
chain_size > ((u32)U16_MAX + 1)) ||
2393+
(cnt_type == QED_CHAIN_CNT_TYPE_U32 && chain_size > U32_MAX)) {
23952394
DP_NOTICE(cdev,
23962395
"The actual chain size (0x%llx) is larger than the maximal possible value\n",
23972396
chain_size);

drivers/net/ethernet/qlogic/qed/qed_iscsi.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ qed_sp_iscsi_func_start(struct qed_hwfn *p_hwfn,
190190
p_init->num_sq_pages_in_ring = p_params->num_sq_pages_in_ring;
191191
p_init->num_r2tq_pages_in_ring = p_params->num_r2tq_pages_in_ring;
192192
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;
193196
p_init->func_params.log_page_size = p_params->log_page_size;
194197
val = p_params->num_tasks;
195198
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,
786789
spin_unlock_bh(&p_hwfn->p_iscsi_info->lock);
787790
}
788791

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+
789809
struct qed_iscsi_info *qed_iscsi_alloc(struct qed_hwfn *p_hwfn)
790810
{
791811
struct qed_iscsi_info *p_iscsi_info;
@@ -807,6 +827,17 @@ void qed_iscsi_setup(struct qed_hwfn *p_hwfn,
807827
void qed_iscsi_free(struct qed_hwfn *p_hwfn,
808828
struct qed_iscsi_info *p_iscsi_info)
809829
{
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+
810841
kfree(p_iscsi_info);
811842
}
812843

drivers/net/ethernet/qlogic/qed/qed_ll2.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ static void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn,
211211
/* If need to reuse or there's no replacement buffer, repost this */
212212
if (rc)
213213
goto out_post;
214+
dma_unmap_single(&cdev->pdev->dev, buffer->phys_addr,
215+
cdev->ll2->rx_size, DMA_FROM_DEVICE);
214216

215217
skb = build_skb(buffer->data, 0);
216218
if (!skb) {
@@ -474,7 +476,7 @@ qed_ll2_rxq_completion_gsi(struct qed_hwfn *p_hwfn,
474476
static int qed_ll2_rxq_completion_reg(struct qed_hwfn *p_hwfn,
475477
struct qed_ll2_info *p_ll2_conn,
476478
union core_rx_cqe_union *p_cqe,
477-
unsigned long lock_flags,
479+
unsigned long *p_lock_flags,
478480
bool b_last_cqe)
479481
{
480482
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,
495497
"Mismatch between active_descq and the LL2 Rx chain\n");
496498
list_add_tail(&p_pkt->list_entry, &p_rx->free_descq);
497499

498-
spin_unlock_irqrestore(&p_rx->lock, lock_flags);
500+
spin_unlock_irqrestore(&p_rx->lock, *p_lock_flags);
499501
qed_ll2b_complete_rx_packet(p_hwfn, p_ll2_conn->my_id,
500502
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);
502504

503505
return 0;
504506
}
@@ -538,7 +540,8 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie)
538540
break;
539541
case CORE_RX_CQE_TYPE_REGULAR:
540542
rc = qed_ll2_rxq_completion_reg(p_hwfn, p_ll2_conn,
541-
cqe, flags, b_last_cqe);
543+
cqe, &flags,
544+
b_last_cqe);
542545
break;
543546
default:
544547
rc = -EIO;

drivers/net/ethernet/qlogic/qed/qed_ooo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ struct qed_ooo_info *qed_ooo_alloc(struct qed_hwfn *p_hwfn)
159159
if (!p_ooo_info->ooo_history.p_cqes)
160160
goto no_history_mem;
161161

162+
p_ooo_info->ooo_history.num_of_cqes = QED_MAX_NUM_OOO_HISTORY_ENTRIES;
163+
162164
return p_ooo_info;
163165

164166
no_history_mem:

0 commit comments

Comments
 (0)