Commit 06b1c911 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: enetc: act upon mqprio queue config in taprio offload

We assume that the mqprio queue configuration from taprio has a simple
1:1 mapping between prio and traffic class, and one TX queue per TC.
That might not be the case. Actually parse and act upon the mqprio
config.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1a353111
......@@ -136,29 +136,21 @@ int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data)
{
struct tc_taprio_qopt_offload *taprio = type_data;
struct enetc_ndev_priv *priv = netdev_priv(ndev);
struct enetc_hw *hw = &priv->si->hw;
struct enetc_bdr *tx_ring;
int err;
int i;
int err, i;
/* TSD and Qbv are mutually exclusive in hardware */
for (i = 0; i < priv->num_tx_rings; i++)
if (priv->tx_ring[i]->tsd_enable)
return -EBUSY;
for (i = 0; i < priv->num_tx_rings; i++) {
tx_ring = priv->tx_ring[i];
tx_ring->prio = taprio->enable ? i : 0;
enetc_set_bdr_prio(hw, tx_ring->index, tx_ring->prio);
}
err = enetc_setup_tc_mqprio(ndev, &taprio->mqprio);
if (err)
return err;
err = enetc_setup_taprio(ndev, taprio);
if (err) {
for (i = 0; i < priv->num_tx_rings; i++) {
tx_ring = priv->tx_ring[i];
tx_ring->prio = taprio->enable ? 0 : i;
enetc_set_bdr_prio(hw, tx_ring->index, tx_ring->prio);
}
taprio->mqprio.qopt.num_tc = 0;
enetc_setup_tc_mqprio(ndev, &taprio->mqprio);
}
return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment