[rtems-libbsd commit] sdk_dpaa: What to do with tail queue drop?

Sebastian Huber sebh at rtems.org
Tue Jan 23 13:59:55 UTC 2018


Module:    rtems-libbsd
Branch:    master
Commit:    327f4e1029ae2b332fa7f9fd2521dead00d401e1
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=327f4e1029ae2b332fa7f9fd2521dead00d401e1

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jan 11 14:30:49 2018 +0100

sdk_dpaa: What to do with tail queue drop?

The issue is this:

static int dpaa_eth_macless_probe(struct platform_device *_of_dev)
{
[...]
    INIT_LIST_HEAD(&priv->dpa_fq_list);

    err = dpa_fq_probe_macless(dev, &priv->dpa_fq_list, RX);
    if (!err)
        err = dpa_fq_probe_macless(dev, &priv->dpa_fq_list,
                       TX);
    if (err < 0)
        goto fq_probe_failed;
[...]
    /* Add the FQs to the interface, and make them active */
    /* For MAC-less devices we only get here for RX frame queues
     * initialization, which are the TX queues of the other
     * partition.
     * It is safe to rely on one partition to set the FQ taildrop
     * threshold for the TX queues of the other partition
     * because the ERN notifications will be received by the
     * partition doing qman_enqueue.
     */
    err = dpa_fqs_init(dev,  &priv->dpa_fq_list, true);
    if (err < 0)
        goto fq_alloc_failed;
[...]

The priv->dpa_fq_list contains a list of FQ_TYPE_RX_PCD  and FQ_TYPE_TX
items.  I don't understand what the "For MAC-less devices we only get
here for RX frame queues initialization" means in this context.  The
td_enable == true in dpa_fqs_init().  So, we have:

int dpa_fq_init(struct dpa_fq *dpa_fq, bool td_enable)
{
[...]
        if (dpa_fq->fq_type == FQ_TYPE_TX ||
                dpa_fq->fq_type == FQ_TYPE_TX_CONFIRM ||
                dpa_fq->fq_type == FQ_TYPE_TX_CONF_MQ) {
[...]
            initfq.we_mask |= QM_INITFQ_WE_OAC;
[...]
        }

        if (td_enable) {
            initfq.we_mask |= QM_INITFQ_WE_TDTHRESH;
            qm_fqd_taildrop_set(&initfq.fqd.td,
                    DPA_FQ_TD, 1);
            initfq.fqd.fq_ctrl = QM_FQCTRL_TDE;
        }

The td_enable == true && dpa_fq->fq_type == FQ_TYPE_TX causes later:

int qman_init_fq(struct qman_fq *fq, u32 flags, struct qm_mcc_initfq *opts)
{
[...]
    if (opts && (opts->we_mask & QM_INITFQ_WE_OAC)) {
        /* And can't be set at the same time as TDTHRESH */
        if (opts->we_mask & QM_INITFQ_WE_TDTHRESH)
            return -EINVAL;
    }

This aborts the  initialization of the MAC-less driver.  I don't
understand why this path doesn't happen on the SDK Linux system.

Update #3277.

---

 linux/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_macless.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_macless.c b/linux/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_macless.c
index 7198fe1..440d6e3 100644
--- a/linux/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_macless.c
+++ b/linux/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_macless.c
@@ -475,7 +475,7 @@ static int dpaa_eth_macless_probe(struct platform_device *_of_dev)
 		goto fq_alloc_failed;
 #else /* __rtems__ */
 	list_for_each_entry_safe(dpaa_fq, tmp, &priv->dpaa_fq_list, list) {
-		err = dpaa_fq_init(dpaa_fq, true);
+		err = dpaa_fq_init(dpaa_fq, false);
 		if (err < 0)
 			goto fq_alloc_failed;
 	}




More information about the vc mailing list