From: Harish Patil Date: Fri, 6 Jan 2017 08:16:47 +0000 (-0800) Subject: net/qede: fix PF fastpath status block index X-Git-Tag: spdx-start~4847 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9dd9cb4274e573d8bc927327f7a73f1a881746f6;p=dpdk.git net/qede: fix PF fastpath status block index Allocate double the number of fastpath status block index since the PF RX/TX queues are not sharing the status block. This is an interim solution till other parts of the code is modified to handle the same. Fixes: f1e4b6c0acee ("net/qede: fix status block index for VF queues") Signed-off-by: Harish Patil --- diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index aebe8cbace..f20881ca8e 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -431,13 +431,15 @@ int qede_alloc_fp_resc(struct qede_dev *qdev) struct ecore_dev *edev = &qdev->edev; struct qede_fastpath *fp; uint32_t num_sbs; - int rc, i; + uint16_t i; + uint16_t sb_idx; + int rc; if (IS_VF(edev)) ecore_vf_get_num_sbs(ECORE_LEADING_HWFN(edev), &num_sbs); else - num_sbs = (ecore_cxt_get_proto_cid_count - (ECORE_LEADING_HWFN(edev), PROTOCOLID_ETH, NULL)) / 2; + num_sbs = ecore_cxt_get_proto_cid_count + (ECORE_LEADING_HWFN(edev), PROTOCOLID_ETH, NULL); if (num_sbs == 0) { DP_ERR(edev, "No status blocks available\n"); @@ -455,7 +457,11 @@ int qede_alloc_fp_resc(struct qede_dev *qdev) for (i = 0; i < QEDE_QUEUE_CNT(qdev); i++) { fp = &qdev->fp_array[i]; - if (qede_alloc_mem_sb(qdev, fp->sb_info, i % num_sbs)) { + if (IS_VF(edev)) + sb_idx = i % num_sbs; + else + sb_idx = i; + if (qede_alloc_mem_sb(qdev, fp->sb_info, sb_idx)) { qede_free_fp_arrays(qdev); return -ENOMEM; }