net/enic: fix multi-queue Rx performance
authorJohn Daley <johndale@cisco.com>
Wed, 12 Oct 2016 21:22:29 +0000 (14:22 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Wed, 26 Oct 2016 17:38:18 +0000 (19:38 +0200)
The rx_free_thresh was not being initialized and left at 0
on 1/2 of the RQs which could lead to poor multi-queue
performance.

Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
drivers/net/enic/enic.h
drivers/net/enic/enic_ethdev.c
drivers/net/enic/enic_main.c

index 45b27a5..865cd76 100644 (file)
@@ -265,7 +265,7 @@ extern int enic_stop_rq(struct enic *enic, uint16_t queue_idx);
 extern void enic_free_rq(void *rxq);
 extern int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
        unsigned int socket_id, struct rte_mempool *mp,
-       uint16_t nb_desc);
+       uint16_t nb_desc, uint16_t free_thresh);
 extern int enic_set_rss_nic_cfg(struct enic *enic);
 extern int enic_set_vnic_res(struct enic *enic);
 extern void enic_set_hdr_split_size(struct enic *enic, u16 split_hdr_size);
index 25c882b..bcf83d4 100644 (file)
@@ -315,16 +315,13 @@ static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
        eth_dev->data->rx_queues[queue_idx] =
                (void *)&enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];
 
-       ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc);
+       ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc,
+                           rx_conf->rx_free_thresh);
        if (ret) {
                dev_err(enic, "error in allocating rq\n");
                return ret;
        }
 
-       enic->rq[queue_idx].rx_free_thresh = rx_conf->rx_free_thresh;
-       dev_debug(enic, "Set queue_id:%u free thresh:%u\n", queue_idx,
-                       enic->rq[queue_idx].rx_free_thresh);
-
        return enicpmd_dev_setup_intr(enic);
 }
 
index bf9b051..f0b15ac 100644 (file)
@@ -606,7 +606,7 @@ int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
 
 int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
        unsigned int socket_id, struct rte_mempool *mp,
-       uint16_t nb_desc)
+       uint16_t nb_desc, uint16_t free_thresh)
 {
        int rc;
        uint16_t sop_queue_idx = enic_rte_rq_idx_to_sop_idx(queue_idx);
@@ -627,6 +627,10 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
        rq_data->socket_id = socket_id;
        rq_data->mp = mp;
        rq_sop->in_use = 1;
+       rq_sop->rx_free_thresh = free_thresh;
+       rq_data->rx_free_thresh = free_thresh;
+       dev_debug(enic, "Set queue_id:%u free thresh:%u\n", queue_idx,
+                 free_thresh);
 
        mbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
                               RTE_PKTMBUF_HEADROOM);
@@ -1244,7 +1248,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
 
                enic_free_rq(rq);
                rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,
-                                  rq->tot_nb_desc);
+                                  rq->tot_nb_desc, rq->rx_free_thresh);
                if (rc) {
                        dev_err(enic,
                                "Fatal MTU alloc error- No traffic will pass\n");