DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gavin Hu <gavin.hu@arm.com>
To: dev@dpdk.org
Cc: nd@arm.com, david.marchand@redhat.com, thomas@monjalon.net,
	jerinj@marvell.com, xiaolong.ye@intel.com,
	Honnappa.Nagarahalli@arm.com, ruifeng.wang@arm.com,
	phil.yang@arm.com, joyce.kong@arm.com, steve.capper@arm.com
Subject: [dpdk-dev] [PATCH v2 2/2] net/i40e: restrict pointer aliasing for NEON vPMD
Date: Mon, 13 Apr 2020 23:56:40 +0800	[thread overview]
Message-ID: <20200413155640.53581-3-gavin.hu@arm.com> (raw)
In-Reply-To: <20200413155640.53581-1-gavin.hu@arm.com>
In-Reply-To: <20200306050427.66114-1-gavin.hu@arm.com>

restrict pointer aliasing to optimize the code generated.

The patch showed ~3% performnace uplift on Arm N1SDP platform, and no
degradation on ThunderX2. The tet case is RFC2544 zero-loss L2
forwarding running testpmd.

[1] https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Restricted-Pointers.html

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
---
 drivers/net/i40e/i40e_rxtx_vec_neon.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index 4376d8911..405bd82df 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -172,8 +172,8 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq, uint64x2_t descs[4],
 #define I40E_UINT16_BIT (CHAR_BIT * sizeof(uint16_t))
 
 static inline void
-desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts,
-		uint32_t *ptype_tbl)
+desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **restrict rx_pkts,
+		uint32_t *restrict ptype_tbl)
 {
 	int i;
 	uint8_t ptype;
@@ -194,8 +194,8 @@ desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts,
  *   numbers of DD bits
  */
 static inline uint16_t
-_recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
-		   uint16_t nb_pkts, uint8_t *split_packet)
+_recv_raw_pkts_vec(struct i40e_rx_queue *restrict rxq, struct rte_mbuf
+	**restrict rx_pkts, uint16_t nb_pkts, uint8_t *split_packet)
 {
 	volatile union i40e_rx_desc *rxdp;
 	struct i40e_rx_entry *sw_ring;
@@ -432,7 +432,7 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
  *   numbers of DD bits
  */
 uint16_t
-i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+i40e_recv_pkts_vec(void *restrict rx_queue, struct rte_mbuf **restrict rx_pkts,
 		   uint16_t nb_pkts)
 {
 	return _recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL);
@@ -494,8 +494,8 @@ vtx1(volatile struct i40e_tx_desc *txdp,
 }
 
 static inline void
-vtx(volatile struct i40e_tx_desc *txdp,
-		struct rte_mbuf **pkt, uint16_t nb_pkts,  uint64_t flags)
+vtx(volatile struct i40e_tx_desc *txdp, struct rte_mbuf **pkt,
+		uint16_t nb_pkts,  uint64_t flags)
 {
 	int i;
 
@@ -504,8 +504,8 @@ vtx(volatile struct i40e_tx_desc *txdp,
 }
 
 uint16_t
-i40e_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
-			  uint16_t nb_pkts)
+i40e_xmit_fixed_burst_vec(void *restrict tx_queue,
+	struct rte_mbuf **restrict tx_pkts, uint16_t nb_pkts)
 {
 	struct i40e_tx_queue *txq = (struct i40e_tx_queue *)tx_queue;
 	volatile struct i40e_tx_desc *txdp;
-- 
2.17.1


  parent reply	other threads:[~2020-04-13 15:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  5:04 [dpdk-dev] [PATCH v1 0/3] i40e vPMD optimization on aarch64 Gavin Hu
2020-03-06  5:04 ` [dpdk-dev] [PATCH v1 1/3] net/i40e: relax barrier in the Tx fastpath of vPMD Gavin Hu
2020-03-06  9:11   ` Jerin Jacob
2020-03-06  5:04 ` [dpdk-dev] [PATCH v1 2/3] net/i40e: restrict pointer aliasing for neon vec Gavin Hu
2020-03-06  5:04 ` [dpdk-dev] [PATCH v1 3/3] net/i40e: auto-vectorization to speed up Tx free Gavin Hu
2020-03-06  7:44   ` Jerin Jacob
2020-03-06  9:06     ` Thomas Monjalon
2020-03-07 15:03     ` Gavin Hu
2020-03-09  7:35       ` Jerin Jacob
2020-03-09  9:23         ` Gavin Hu
2020-04-13 15:56 ` [dpdk-dev] [PATCH v2 0/2] i40e NEON vPMD optimization on aarch64 Gavin Hu
2020-04-13 15:56 ` [dpdk-dev] [PATCH v2 1/2] net/i40e: relax barrier in Tx fastpath for NEON vPMD Gavin Hu
2020-04-13 15:56 ` Gavin Hu [this message]
2020-04-20 14:51   ` [dpdk-dev] [PATCH v2 2/2] net/i40e: restrict pointer aliasing " Ferruh Yigit
2020-04-21  9:51     ` Gavin Hu
2020-04-13 16:40 ` [dpdk-dev] [PATCH v3 0/2] i40e NEON vPMD optimization on aarch64 Gavin Hu
2020-04-15  6:50   ` Ye Xiaolong
2020-04-13 16:40 ` [dpdk-dev] [PATCH v3 1/2] net/i40e: relax barrier in Tx fastpath for NEON vPMD Gavin Hu
2020-04-13 16:40 ` [dpdk-dev] [PATCH v3 2/2] net/i40e: restrict pointer aliasing " Gavin Hu

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=20200413155640.53581-3-gavin.hu@arm.com \
    --to=gavin.hu@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=joyce.kong@arm.com \
    --cc=nd@arm.com \
    --cc=phil.yang@arm.com \
    --cc=ruifeng.wang@arm.com \
    --cc=steve.capper@arm.com \
    --cc=thomas@monjalon.net \
    --cc=xiaolong.ye@intel.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).