DPDK patches and discussions
 help / color / mirror / Atom feed
From: Feifei Wang <feifei.wang2@arm.com>
To: Ruifeng Wang <ruifeng.wang@arm.com>, Beilei Xing <beilei.xing@intel.com>
Cc: dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>
Subject: [dpdk-dev] [PATCH v1 4/4] net/i40e: change code order to reduce L1 cache misses
Date: Fri, 23 Jul 2021 11:10:49 +0800	[thread overview]
Message-ID: <20210723031049.2201665-5-feifei.wang2@arm.com> (raw)
In-Reply-To: <20210723031049.2201665-1-feifei.wang2@arm.com>

For N1 platform, packet mbuf load and descs load are hot spots to limit
the performance for "desc_to_ptype_v" and "desc_to_olflags_v" functions
in i40e rx NEON path. This is because packet mbuf and descs are evicted
from l1d-cache to l2d-cache.

To reduce l1d-cache-misses and improve the performance, change the code
order and move "desc_to_ptype_v" and "desc_to_olflags_v" functions
forward to the location, where packet mbuf and descs are just loaded.

Test Result:
dpdk:21.08-rc1
gcc-9
For n1sdp, the patch improves the performance by 1.8%.
For thunderx2, no performance changes.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/i40e/i40e_rxtx_vec_neon.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index 8f3188e910..b2683fda60 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -301,18 +301,6 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *__rte_restrict rxq,
 			rte_mbuf_prefetch_part2(rx_pkts[pos + 3]);
 		}
 
-		/* C.1 4=>2 filter staterr info only */
-		sterr_tmp2 = vzipq_u16(vreinterpretq_u16_u64(descs[1]),
-				       vreinterpretq_u16_u64(descs[3]));
-		sterr_tmp1 = vzipq_u16(vreinterpretq_u16_u64(descs[0]),
-				       vreinterpretq_u16_u64(descs[2]));
-
-		/* C.2 get 4 pkts staterr value  */
-		staterr = vzipq_u16(sterr_tmp1.val[1],
-				    sterr_tmp2.val[1]).val[0];
-
-		desc_to_olflags_v(rxq, descs, &rx_pkts[pos]);
-
 		/* pkts shift the pktlen field to be 16-bit aligned*/
 		uint32x4_t len3 = vshlq_u32(vreinterpretq_u32_u64(descs[3]),
 					    len_shl);
@@ -367,10 +355,22 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *__rte_restrict rxq,
 
 		desc_to_ptype_v(descs, &rx_pkts[pos], ptype_tbl);
 
+		desc_to_olflags_v(rxq, descs, &rx_pkts[pos]);
+
 		if (likely(pos + RTE_I40E_DESCS_PER_LOOP < nb_pkts)) {
 			rte_prefetch_non_temporal(rxdp + RTE_I40E_DESCS_PER_LOOP);
 		}
 
+		/* C.1 4=>2 filter staterr info only */
+		sterr_tmp2 = vzipq_u16(vreinterpretq_u16_u64(descs[1]),
+				       vreinterpretq_u16_u64(descs[3]));
+		sterr_tmp1 = vzipq_u16(vreinterpretq_u16_u64(descs[0]),
+				       vreinterpretq_u16_u64(descs[2]));
+
+		/* C.2 get 4 pkts staterr value  */
+		staterr = vzipq_u16(sterr_tmp1.val[1],
+				    sterr_tmp2.val[1]).val[0];
+
 		/* C* extract and record EOP bit */
 		if (split_packet) {
 			uint8x16_t eop_shuf_mask = {
-- 
2.25.1


  parent reply	other threads:[~2021-07-23  3:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  3:10 [dpdk-dev] [PATCH v1 0/4] fix note error Feifei Wang
2021-07-23  3:10 ` [dpdk-dev] [PATCH v1 1/4] drivers/net: remove redundant phrases Feifei Wang
2021-07-23  3:10 ` [dpdk-dev] [PATCH v1 2/4] drivers/net: fix note error for Rx vector Feifei Wang
2021-07-23  3:10 ` [dpdk-dev] [PATCH v1 3/4] net/i40e: reorder Rx NEON code for better readability Feifei Wang
2021-07-23  3:10 ` Feifei Wang [this message]
2021-08-10  3:00 ` [dpdk-dev] [PATCH v1 0/4] fix note error Zhang, Qi Z

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=20210723031049.2201665-5-feifei.wang2@arm.com \
    --to=feifei.wang2@arm.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.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).