DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <shreyansh.jain@nxp.com>
Subject: [dpdk-dev] [PATCH v3 01/27] bus/fslmc: qbman replace word copy with memcpy
Date: Sat, 16 Sep 2017 16:22:15 +0530	[thread overview]
Message-ID: <1505559161-29222-2-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com>

From: Haiying Wang <Haiying.Wang@nxp.com>

The word_copy is not as efficient as expected, so remove it from
this driver.

Signed-off-by: Haiying Wang <Haiying.Wang@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/fslmc/qbman/include/compat.h | 42 --------------------------------
 drivers/bus/fslmc/qbman/qbman_portal.c   | 12 ++++-----
 drivers/bus/fslmc/qbman/qbman_sys.h      |  9 -------
 3 files changed, 5 insertions(+), 58 deletions(-)

diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h
index 529f1ea..7b69fd1 100644
--- a/drivers/bus/fslmc/qbman/include/compat.h
+++ b/drivers/bus/fslmc/qbman/include/compat.h
@@ -229,48 +229,6 @@ typedef uint32_t	phandle;
 #define __raw_readl(p)	(*(const volatile unsigned int *)(p))
 #define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); }
 
-/* memcpy() stuff - when you know alignments in advance */
-#ifdef CONFIG_TRY_BETTER_MEMCPY
-static inline void copy_words(void *dest, const void *src, size_t sz)
-{
-	u32 *__dest = dest;
-	const u32 *__src = src;
-	size_t __sz = sz >> 2;
-
-	QBMAN_BUG_ON((unsigned long)dest & 0x3);
-	QBMAN_BUG_ON((unsigned long)src & 0x3);
-	QBMAN_BUG_ON(sz & 0x3);
-	while (__sz--)
-		*(__dest++) = *(__src++);
-}
-
-static inline void copy_shorts(void *dest, const void *src, size_t sz)
-{
-	u16 *__dest = dest;
-	const u16 *__src = src;
-	size_t __sz = sz >> 1;
-
-	QBMAN_BUG_ON((unsigned long)dest & 0x1);
-	QBMAN_BUG_ON((unsigned long)src & 0x1);
-	QBMAN_BUG_ON(sz & 0x1);
-	while (__sz--)
-		*(__dest++) = *(__src++);
-}
-
-static inline void copy_bytes(void *dest, const void *src, size_t sz)
-{
-	u8 *__dest = dest;
-	const u8 *__src = src;
-
-	while (sz--)
-		*(__dest++) = *(__src++);
-}
-#else
-#define copy_words memcpy
-#define copy_shorts memcpy
-#define copy_bytes memcpy
-#endif
-
 /* Completion stuff */
 #define DECLARE_COMPLETION(n) int n = 0
 #define complete(n) { *n = 1; }
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index dd62e9a..f360760 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -480,8 +480,8 @@ static int qbman_swp_enqueue_array_mode(struct qbman_swp *s,
 		return -EBUSY;
 	p = qbman_cena_write_start_wo_shadow(&s->sys,
 			QBMAN_CENA_SWP_EQCR(EQAR_IDX(eqar)));
-	word_copy(&p[1], &cl[1], 7);
-	word_copy(&p[8], fd, sizeof(*fd) >> 2);
+	memcpy(&p[1], &cl[1], 28);
+	memcpy(&p[8], fd, sizeof(*fd));
 	/* Set the verb byte, have to substitute in the valid-bit */
 	lwsync();
 	p[0] = cl[0] | EQAR_VB(eqar);
@@ -512,8 +512,8 @@ static int qbman_swp_enqueue_ring_mode(struct qbman_swp *s,
 
 	p = qbman_cena_write_start_wo_shadow(&s->sys,
 		QBMAN_CENA_SWP_EQCR(s->eqcr.pi & 7));
-	word_copy(&p[1], &cl[1], 7);
-	word_copy(&p[8], fd, sizeof(*fd) >> 2);
+	memcpy(&p[1], &cl[1], 28);
+	memcpy(&p[8], fd, sizeof(*fd));
 	lwsync();
 	/* Set the verb byte, have to substitute in the valid-bit */
 	p[0] = cl[0] | s->eqcr.pi_vb;
@@ -549,9 +549,7 @@ int qbman_swp_fill_ring(struct qbman_swp *s,
 	}
 	p = qbman_cena_write_start_wo_shadow(&s->sys,
 		QBMAN_CENA_SWP_EQCR((s->eqcr.pi/* +burst_index */) & 7));
-	/* word_copy(&p[1], &cl[1], 7); */
 	memcpy(&p[1], &cl[1], 7 * 4);
-	/* word_copy(&p[8], fd, sizeof(*fd) >> 2); */
 	memcpy(&p[8], fd, sizeof(struct qbman_fd));
 
 	/* lwsync(); */
@@ -799,7 +797,7 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d)
 	 */
 	qb_attr_code_encode(&code_pull_token, cl, s->desc.idx + 1);
 	p = qbman_cena_write_start_wo_shadow(&s->sys, QBMAN_CENA_SWP_VDQCR);
-	word_copy(&p[1], &cl[1], 3);
+	memcpy(&p[1], &cl[1], 12);
 	/* Set the verb byte, have to substitute in the valid-bit */
 	lwsync();
 	p[0] = cl[0] | s->vdq.valid_bit;
diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h
index 5dbcaa5..9ea55de 100644
--- a/drivers/bus/fslmc/qbman/qbman_sys.h
+++ b/drivers/bus/fslmc/qbman/qbman_sys.h
@@ -47,15 +47,6 @@
 #undef QBMAN_CINH_TRACE
 #undef QBMAN_CENA_TRACE
 
-static inline void word_copy(void *d, const void *s, unsigned int cnt)
-{
-	uint32_t *dd = d;
-	const uint32_t *ss = s;
-
-	while (cnt--)
-		*(dd++) = *(ss++);
-}
-
 /* Currently, the CENA support code expects each 32-bit word to be written in
  * host order, and these are converted to hardware (little-endian) order on
  * command submission. However, 64-bit quantities are must be written (and read)
-- 
2.7.4

  reply	other threads:[~2017-09-16 10:53 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 10:49 [dpdk-dev] [PATCH 00/27] NXP DPAA2 PMD updates Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 01/27] bus/fslmc: qbman replace word copy with memcpy Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 02/27] bus/fslmc: remove the export for qbman version function Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 03/27] bus/fslmc: add qbman API to do enqueue with multiple frames Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 04/27] bus/fslmc: support up to 32 frames in one volatile dequeue Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 05/27] bus/fslmc: enhance the QBMAN CENA mode Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 06/27] bus/fslmc: qbman remove unused funcs and align names Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 07/27] bus/fslmc: cleanup compat file Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 08/27] bus/fslmc: clean the qbman support code Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 09/27] bus/fslmc: update MC to 10.3.x Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 10/27] net/dpaa2: " Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 11/27] crypto/dpaa2_sec: " Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 12/27] config/dpaa2: change max lores to 16 Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 13/27] bus/fslmc: add support for LX2160 platform Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 14/27] net/dpaa2: add support for congestion overhead Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 15/27] bus/fslmc: add support to check dpbp presence Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 16/27] bus/fslmc: cleanup the dpaa2 interrupt support Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 17/27] net/dpaa2: add support for link status event Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 18/27] bus/fslmc: enable link status interrupt Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 19/27] net/dpaa2: check physical link state on up cmd Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 20/27] net/dpaa2: improve error and logs for flow distribution Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 21/27] net/dpaa2: increase the dist param to 64 bit Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 22/27] net/dpaa2: remove RSS restriction with num of queues Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 23/27] net/dpaa2: add support for RSS hash update and get Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 24/27] net/dpaa2: add support for extra stats Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 25/27] net/dpaa2: fix the Tx handling of non HW pool bufs Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 26/27] net/dpaa2: improve debug messaging Hemant Agrawal
2017-08-25 10:49 ` [dpdk-dev] [PATCH 27/27] net/dpaa2: log that VLAN extend offload not supported Hemant Agrawal
2017-09-08  8:44 ` [dpdk-dev] [PATCH v2 00/30] NXP DPAA2 PMD updates Hemant Agrawal
2017-09-08  8:44   ` [dpdk-dev] [PATCH v2 01/30] bus/fslmc: qbman replace word copy with memcpy Hemant Agrawal
2017-09-08  8:44   ` [dpdk-dev] [PATCH v2 02/30] bus/fslmc: remove the export for qbman version function Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 03/30] bus/fslmc: add qbman API to do enqueue with multiple frames Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 04/30] bus/fslmc: support up to 32 frames in one volatile dequeue Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 05/30] bus/fslmc: enhance the QBMAN CENA mode Hemant Agrawal
2017-09-15 12:26     ` Ferruh Yigit
2017-09-15 12:32       ` Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 06/30] bus/fslmc: qbman remove unused funcs and align names Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 07/30] bus/fslmc: cleanup compat file Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 08/30] bus/fslmc: clean the qbman support code Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 09/30] bus/fslmc: update MC to 10.3.x Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 10/30] net/dpaa2: " Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 11/30] crypto/dpaa2_sec: " Hemant Agrawal
2017-09-15 12:37     ` Ferruh Yigit
2017-09-15 12:45       ` Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 12/30] config/dpaa2: change max lores to 16 Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 13/30] bus/fslmc: add support for LX2160 platform Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 14/30] net/dpaa2: add support for congestion overhead Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 15/30] bus/fslmc: add support to check dpbp presence Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 16/30] bus/fslmc: cleanup the dpaa2 interrupt support Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 17/30] net/dpaa2: add support for link status event Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 18/30] bus/fslmc: enable link status interrupt Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 19/30] net/dpaa2: check physical link state on up cmd Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 20/30] net/dpaa2: improve error and logs for flow distribution Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 21/30] net/dpaa2: increase the dist param to 64 bit Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 22/30] net/dpaa2: remove RSS restriction with num of queues Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 23/30] net/dpaa2: add support for RSS hash update and get Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 24/30] bus/dpaa2: add support for hw extra stats API Hemant Agrawal
2017-09-15 11:38     ` Ferruh Yigit
2017-09-15 11:45       ` Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 25/30] net/dpaa2: add support for extra stats Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 26/30] net/dpaa2: fix the Tx handling of non HW pool bufs Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 27/30] net/dpaa2: log that VLAN extend offload not supported Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 28/30] net/dpaa2: checksum support as per user config Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 29/30] net/dpaa2: improve debug messaging Hemant Agrawal
2017-09-08  8:45   ` [dpdk-dev] [PATCH v2 30/30] bus/dpaa2: improve debug log messages Hemant Agrawal
2017-09-16 10:52   ` [dpdk-dev] [PATCH v3 00/27] NXP DPAA2 PMD updates Hemant Agrawal
2017-09-16 10:52     ` Hemant Agrawal [this message]
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 02/27] bus/fslmc: remove the export for qbman version function Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 03/27] bus/fslmc: add qbman API to do enqueue with multiple frames Hemant Agrawal
2017-09-18 20:18       ` Ferruh Yigit
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 04/27] bus/fslmc: support up to 32 frames in one volatile dequeue Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 05/27] bus/fslmc: enhance the QBMAN CENA mode Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 06/27] bus/fslmc: qbman remove unused funcs and align names Hemant Agrawal
2017-09-18 20:19       ` Ferruh Yigit
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 07/27] bus/fslmc: cleanup compat file Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 08/27] bus/fslmc: clean the qbman support code Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 09/27] config/dpaa2: change max lores to 16 Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 10/27] bus/fslmc: add support for LX2160 platform Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 11/27] net/dpaa2: add support for congestion overhead Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 12/27] bus/fslmc: add support to check dpbp presence Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 13/27] bus/fslmc: cleanup the dpaa2 interrupt support Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 14/27] net/dpaa2: add support for link status event Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 15/27] bus/fslmc: enable link status interrupt Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 16/27] net/dpaa2: check physical link state on up cmd Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 17/27] net/dpaa2: improve error and logs for flow distribution Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 18/27] net/dpaa2: increase the dist param to 64 bit Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 19/27] net/dpaa2: remove RSS restriction with num of queues Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 20/27] net/dpaa2: add support for RSS hash update and get Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 21/27] net/dpaa2: add support for extra stats Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 22/27] net/dpaa2: fix the Tx handling of non HW pool bufs Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 23/27] net/dpaa2: log that VLAN extend offload not supported Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 24/27] net/dpaa2: checksum support as per user config Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 25/27] net/dpaa2: improve debug messaging Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 26/27] bus/dpaa2: improve debug log messages Hemant Agrawal
2017-09-16 10:52     ` [dpdk-dev] [PATCH v3 27/27] bus/fslmc: add devices in sorted order Hemant Agrawal
2017-09-18 20:20     ` [dpdk-dev] [PATCH v3 00/27] NXP DPAA2 PMD updates Ferruh Yigit
2017-10-06  1:30     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505559161-29222-2-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=shreyansh.jain@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).