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: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1a353111b6
commit
06b1c9110a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user