aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2019-05-31 19:23:13 +0300
committerDaniel Thompson <daniel@redfelineninja.org.uk>2019-09-17 16:03:05 +0100
commita846fcc6f2688402686eb56439d8ea2b4e1a74e4 (patch)
tree773b07a4dad92b10ad539dd9812b937a839be9cf
parentb7379d5ce5d61f4e6f3b411820416007a700682f (diff)
downloadlinux-a846fcc6f2688402686eb56439d8ea2b4e1a74e4.tar.gz
dpaa2-eth: Fix FQ-based enqueue
Consider traffic class (prio) value when selecting Tx FQ to enqueue to. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c45
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h2
2 files changed, 26 insertions, 21 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index adea27c824be..ff1a168c5511 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -2537,11 +2537,10 @@ static inline int dpaa2_eth_enqueue_qd(struct dpaa2_eth_priv *priv,
static inline int dpaa2_eth_enqueue_fq(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_fq *fq,
- struct dpaa2_fd *fd,
- u8 prio __always_unused)
+ struct dpaa2_fd *fd, u8 prio)
{
return dpaa2_io_service_enqueue_fq(fq->channel->dpio,
- fq->tx_fqid, fd);
+ fq->tx_fqid[prio], fd);
}
static void set_enqueue_mode(struct dpaa2_eth_priv *priv)
@@ -2558,7 +2557,7 @@ static void update_tx_fqids(struct dpaa2_eth_priv *priv)
struct dpaa2_eth_fq *fq;
struct dpni_queue queue;
struct dpni_queue_id qid = {0};
- int i, err;
+ int i, j, err;
/* We only use Tx FQIDs for FQID-based enqueue, so check
* if DPNI version supports it before updating FQIDs
@@ -2571,15 +2570,17 @@ static void update_tx_fqids(struct dpaa2_eth_priv *priv)
fq = &priv->fq[i];
if (fq->type != DPAA2_TX_CONF_FQ)
continue;
- err = dpni_get_queue(priv->mc_io, 0, priv->mc_token,
- DPNI_QUEUE_TX, 0, fq->flowid,
- &queue, &qid);
- if (err)
- goto out_err;
-
- fq->tx_fqid = qid.fqid;
- if (fq->tx_fqid == 0)
- goto out_err;
+ for (j = 0; j < dpaa2_eth_tc_count(priv); j++) {
+ err = dpni_get_queue(priv->mc_io, 0, priv->mc_token,
+ DPNI_QUEUE_TX, j, fq->flowid,
+ &queue, &qid);
+ if (err)
+ goto out_err;
+
+ fq->tx_fqid[j] = qid.fqid;
+ if (fq->tx_fqid[j] == 0)
+ goto out_err;
+ }
}
return;
@@ -2846,17 +2847,21 @@ static int setup_tx_flow(struct dpaa2_eth_priv *priv,
struct device *dev = priv->net_dev->dev.parent;
struct dpni_queue queue;
struct dpni_queue_id qid;
- int err;
+ int i, err;
- err = dpni_get_queue(priv->mc_io, 0, priv->mc_token,
- DPNI_QUEUE_TX, 0, fq->flowid, &queue, &qid);
- if (err) {
- dev_err(dev, "dpni_get_queue(TX) failed\n");
- return err;
+ for (i = 0; i < dpaa2_eth_tc_count(priv); i++) {
+ err = dpni_get_queue(priv->mc_io, 0, priv->mc_token,
+ DPNI_QUEUE_TX, i, fq->flowid,
+ &queue, &qid);
+ if (err) {
+ dev_err(dev, "dpni_get_queue(TX) failed\n");
+ return err;
+ }
+ fq->tx_fqid[i] = qid.fqid;
}
+ /* All Tx queues belonging to the same flowid have the same qdbin */
fq->tx_qdbin = qid.qdbin;
- fq->tx_fqid = qid.fqid;
err = dpni_get_queue(priv->mc_io, 0, priv->mc_token,
DPNI_QUEUE_TX_CONFIRM, 0, fq->flowid,
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index 7ca35b41e9e6..17c15878375e 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -310,7 +310,7 @@ struct dpaa2_eth_priv;
struct dpaa2_eth_fq {
u32 fqid;
u32 tx_qdbin;
- u32 tx_fqid;
+ u32 tx_fqid[DPAA2_ETH_MAX_TCS];
u16 flowid;
u8 tc;
int target_cpu;