net/dpaa: support Rx buffer size
authorHemant Agrawal <hemant.agrawal@nxp.com>
Wed, 24 Feb 2021 12:43:11 +0000 (18:13 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 24 Feb 2021 17:03:30 +0000 (18:03 +0100)
This patch adds Rx buf size support in rxq info for dpaa.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/bus/dpaa/include/fsl_fman.h
drivers/bus/dpaa/version.map
drivers/net/dpaa/dpaa_ethdev.c

index a3cf77f..f3a5d05 100644 (file)
@@ -139,6 +139,7 @@ __rte_internal
 void fman_if_set_sg(struct fman_if *fm_if, int enable);
 
 /* Get interface Max Frame length (MTU) */
+__rte_internal
 uint16_t fman_if_get_maxfrm(struct fman_if *fm_if);
 
 /* Set interface  Max Frame length (MTU) */
index fe4f9ac..1bd5a01 100644 (file)
@@ -30,6 +30,7 @@ INTERNAL {
        fman_if_get_fc_quanta;
        fman_if_get_fc_threshold;
        fman_if_get_fdoff;
+       fman_if_get_maxfrm;
        fman_if_get_sg_enable;
        fman_if_loopback_disable;
        fman_if_loopback_enable;
index a3a3e7c..176943a 100644 (file)
@@ -1521,12 +1521,19 @@ dpaa_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 {
        struct dpaa_if *dpaa_intf = dev->data->dev_private;
        struct qman_fq *rxq;
+       int ret;
 
        rxq = dev->data->rx_queues[queue_id];
 
        qinfo->mp = dpaa_intf->bp_info->mp;
        qinfo->scattered_rx = dev->data->scattered_rx;
        qinfo->nb_desc = rxq->nb_desc;
+
+       /* Report the HW Rx buffer length to user */
+       ret = fman_if_get_maxfrm(dev->process_private);
+       if (ret > 0)
+               qinfo->rx_buf_size = ret;
+
        qinfo->conf.rx_free_thresh = 1;
        qinfo->conf.rx_drop_en = 1;
        qinfo->conf.rx_deferred_start = 0;