net/sfc: allow to take mbuf pool into account when sizing
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 19 Apr 2018 11:36:54 +0000 (12:36 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 17:00:58 +0000 (18:00 +0100)
The new argument will be used by the equal stride super-buffer
Rx datapath.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
drivers/net/sfc/sfc_dp_rx.h
drivers/net/sfc/sfc_ef10_rx.c
drivers/net/sfc/sfc_rx.c

index cc9e7c4..ecb486f 100644 (file)
@@ -91,9 +91,10 @@ typedef void (sfc_dp_rx_get_dev_info_t)(struct rte_eth_dev_info *dev_info);
 
 /**
  * Get size of receive and event queue rings by the number of Rx
- * descriptors.
+ * descriptors and mempool configuration.
  *
  * @param nb_rx_desc           Number of Rx descriptors
+ * @param mb_pool              mbuf pool with Rx buffers
  * @param rxq_entries          Location for number of Rx ring entries
  * @param evq_entries          Location for number of event ring entries
  * @param rxq_max_fill_level   Location for maximum Rx ring fill level
@@ -101,6 +102,7 @@ typedef void (sfc_dp_rx_get_dev_info_t)(struct rte_eth_dev_info *dev_info);
  * @return 0 or positive errno.
  */
 typedef int (sfc_dp_rx_qsize_up_rings_t)(uint16_t nb_rx_desc,
+                                        struct rte_mempool *mb_pool,
                                         unsigned int *rxq_entries,
                                         unsigned int *evq_entries,
                                         unsigned int *rxq_max_fill_level);
index 5ec82db..1f0d6a0 100644 (file)
@@ -480,6 +480,7 @@ sfc_ef10_rx_get_dev_info(struct rte_eth_dev_info *dev_info)
 static sfc_dp_rx_qsize_up_rings_t sfc_ef10_rx_qsize_up_rings;
 static int
 sfc_ef10_rx_qsize_up_rings(uint16_t nb_rx_desc,
+                          __rte_unused struct rte_mempool *mb_pool,
                           unsigned int *rxq_entries,
                           unsigned int *evq_entries,
                           unsigned int *rxq_max_fill_level)
index e24a6ef..7345074 100644 (file)
@@ -384,6 +384,7 @@ sfc_rxq_by_dp_rxq(const struct sfc_dp_rxq *dp_rxq)
 static sfc_dp_rx_qsize_up_rings_t sfc_efx_rx_qsize_up_rings;
 static int
 sfc_efx_rx_qsize_up_rings(uint16_t nb_rx_desc,
+                         __rte_unused struct rte_mempool *mb_pool,
                          unsigned int *rxq_entries,
                          unsigned int *evq_entries,
                          unsigned int *rxq_max_fill_level)
@@ -982,8 +983,8 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
        struct sfc_rxq *rxq;
        struct sfc_dp_rx_qcreate_info info;
 
-       rc = sa->dp_rx->qsize_up_rings(nb_rx_desc, &rxq_entries, &evq_entries,
-                                      &rxq_max_fill_level);
+       rc = sa->dp_rx->qsize_up_rings(nb_rx_desc, mb_pool, &rxq_entries,
+                                      &evq_entries, &rxq_max_fill_level);
        if (rc != 0)
                goto fail_size_up_rings;
        SFC_ASSERT(rxq_entries >= EFX_RXQ_MINNDESCS);