diff mbox series

[v3,08/19] bus/dpaa: optimize the endianness conversions

Message ID 1515581201-29784-9-git-send-email-hemant.agrawal@nxp.com
State New
Headers show
Series DPAA PMD improvements | expand

Commit Message

Hemant Agrawal Jan. 10, 2018, 10:46 a.m. UTC
From: Nipun Gupta <nipun.gupta@nxp.com>


Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/bus/dpaa/base/qbman/qman.c  | 7 ++++---
 drivers/bus/dpaa/include/fsl_qman.h | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.7.4
diff mbox series

Patch

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 49bc317..b6fd40b 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -906,7 +906,7 @@  static inline unsigned int __poll_portal_fast(struct qman_portal *p,
 	do {
 		qm_dqrr_pvb_update(&p->p);
 		dq = qm_dqrr_current(&p->p);
-		if (!dq)
+		if (unlikely(!dq))
 			break;
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 	/* If running on an LE system the fields of the
@@ -1165,6 +1165,7 @@  int qman_create_fq(u32 fqid, u32 flags, struct qman_fq *fq)
 	}
 	spin_lock_init(&fq->fqlock);
 	fq->fqid = fqid;
+	fq->fqid_le = cpu_to_be32(fqid);
 	fq->flags = flags;
 	fq->state = qman_fq_state_oos;
 	fq->cgr_groupid = 0;
@@ -1953,7 +1954,7 @@  int qman_enqueue(struct qman_fq *fq, const struct qm_fd *fd, u32 flags)
 
 int qman_enqueue_multi(struct qman_fq *fq,
 		       const struct qm_fd *fd,
-		int frames_to_send)
+		       int frames_to_send)
 {
 	struct qman_portal *p = get_affine_portal();
 	struct qm_portal *portal = &p->p;
@@ -1975,7 +1976,7 @@  int qman_enqueue_multi(struct qman_fq *fq,
 
 	/* try to send as many frames as possible */
 	while (eqcr->available && frames_to_send--) {
-		eq->fqid = cpu_to_be32(fq->fqid);
+		eq->fqid = fq->fqid_le;
 #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
 		eq->tag = cpu_to_be32(fq->key);
 #else
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 5830ad5..5027230 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1197,6 +1197,8 @@  struct qman_fq {
 	 */
 	spinlock_t fqlock;
 	u32 fqid;
+	u32 fqid_le;
+
 	/* DPDK Interface */
 	void *dpaa_intf;