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) ...@@ -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 tc_taprio_qopt_offload *taprio = type_data;
struct enetc_ndev_priv *priv = netdev_priv(ndev); struct enetc_ndev_priv *priv = netdev_priv(ndev);
struct enetc_hw *hw = &priv->si->hw; int err, i;
struct enetc_bdr *tx_ring;
int err;
int i;
/* TSD and Qbv are mutually exclusive in hardware */ /* TSD and Qbv are mutually exclusive in hardware */
for (i = 0; i < priv->num_tx_rings; i++) for (i = 0; i < priv->num_tx_rings; i++)
if (priv->tx_ring[i]->tsd_enable) if (priv->tx_ring[i]->tsd_enable)
return -EBUSY; return -EBUSY;
for (i = 0; i < priv->num_tx_rings; i++) { err = enetc_setup_tc_mqprio(ndev, &taprio->mqprio);
tx_ring = priv->tx_ring[i]; if (err)
tx_ring->prio = taprio->enable ? i : 0; return err;
enetc_set_bdr_prio(hw, tx_ring->index, tx_ring->prio);
}
err = enetc_setup_taprio(ndev, taprio); err = enetc_setup_taprio(ndev, taprio);
if (err) { if (err) {
for (i = 0; i < priv->num_tx_rings; i++) { taprio->mqprio.qopt.num_tc = 0;
tx_ring = priv->tx_ring[i]; enetc_setup_tc_mqprio(ndev, &taprio->mqprio);
tx_ring->prio = taprio->enable ? 0 : i;
enetc_set_bdr_prio(hw, tx_ring->index, tx_ring->prio);
}
} }
return err; 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