1 From ce6badc60736f5e78a295f30fe84c3e40ad0c330 Mon Sep 17 00:00:00 2001
2 From: Nelson Escobar <neescoba@cisco.com>
3 Date: Fri, 18 Mar 2016 11:33:34 -0700
4 Subject: [PATCH 20/22] enic: fix Rx descriptor limit
6 On initialization, the rq descriptor count was set to the limit
7 of the vic. When the requested number of rx descriptors was
8 less than this count, enic_alloc_rq() was incorrectly setting
9 the count to the lower value. This results in later calls to
10 enic_alloc_rq() incorrectly using the lower value as the adapter
13 Fixes: fefed3d1e62c ("enic: new driver")
15 Signed-off-by: Nelson Escobar <neescoba@cisco.com>
16 Reviewed-by: John Daley <johndale@cisco.com>
18 drivers/net/enic/enic_main.c | 14 ++++++--------
19 1 file changed, 6 insertions(+), 8 deletions(-)
21 diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
22 index e30672c..2f79cf0 100644
23 --- a/drivers/net/enic/enic_main.c
24 +++ b/drivers/net/enic/enic_main.c
25 @@ -524,24 +524,22 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
26 "policy. Applying the value in the adapter "\
28 queue_idx, nb_desc, enic->config.rq_desc_count);
29 - } else if (nb_desc != enic->config.rq_desc_count) {
30 - enic->config.rq_desc_count = nb_desc;
32 - "RX Queues - effective number of descs:%d\n",
34 + nb_desc = enic->config.rq_desc_count;
36 + dev_info(enic, "RX Queues - effective number of descs:%d\n",
40 /* Allocate queue resources */
41 rc = vnic_rq_alloc(enic->vdev, rq, queue_idx,
42 - enic->config.rq_desc_count, sizeof(struct rq_enet_desc));
43 + nb_desc, sizeof(struct rq_enet_desc));
45 dev_err(enic, "error in allocation of rq\n");
49 rc = vnic_cq_alloc(enic->vdev, &enic->cq[queue_idx], queue_idx,
50 - socket_id, enic->config.rq_desc_count,
52 sizeof(struct cq_enet_rq_desc));
54 dev_err(enic, "error in allocation of cq for rq\n");
55 @@ -550,7 +548,7 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
57 /* Allocate the mbuf ring */
58 rq->mbuf_ring = (struct rte_mbuf **)rte_zmalloc_socket("rq->mbuf_ring",
59 - sizeof(struct rte_mbuf *) * enic->config.rq_desc_count,
60 + sizeof(struct rte_mbuf *) * nb_desc,
61 RTE_CACHE_LINE_SIZE, rq->socket_id);
63 if (rq->mbuf_ring != NULL)