diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2017-03-02 16:15:51 +0100 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2017-03-03 14:41:36 +0100 |
commit | ce3d555e43e3795b5d9507fcfc76b7a0a92fd0d6 (patch) | |
tree | 3a9e9f8f6a62c7146fb391eae34481b2af4f7ff2 /drivers/net/qede/qede_rxtx.c | |
parent | 6b3e017e5d25f15da73f7700f7f2ac553ef1a2e9 (diff) |
Imported Upstream version 16.11.1
Change-Id: I1e965265578efaaf08e5628607f53d2386d2df9f
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/qede/qede_rxtx.c')
-rw-r--r-- | drivers/net/qede/qede_rxtx.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 2e181c8c..a34b6659 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -435,13 +435,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"); @@ -459,7 +461,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; } |