From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2090DA04F5 for ; Wed, 11 Dec 2019 22:27:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E9E01D9E; Wed, 11 Dec 2019 22:27:40 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 3095E1D9E for ; Wed, 11 Dec 2019 22:27:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ech+MkyyelHsusQ6gAGrldbg5ZkCaAHRbHSzRKaIRyQ=; b=ZGfG2cDEjksEQjxEI8fOTzKBQhq1BvaqW0D23uQwxgqDcSLNr3Oe0B6TuNfGeMl1JURTOj nl3NYbz8zc7gt2PKgzjav32w6Sdto4x1nS+PG3AAn7jFADyW8lv4fvBO50/Jg18CYUnb3c V2zszdGrh5vCzP/6QbL+CIWRjZtw50w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-8OQkZBI4PlaiH0x4JdphRw-1; Wed, 11 Dec 2019 16:27:37 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0FB1E107ACE6; Wed, 11 Dec 2019 21:27:36 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF6F110013A1; Wed, 11 Dec 2019 21:27:34 +0000 (UTC) From: Kevin Traynor To: Ruifeng Wang Cc: Gavin Hu , Ferruh Yigit , dpdk stable Date: Wed, 11 Dec 2019 21:25:55 +0000 Message-Id: <20191211212702.27851-3-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 8OQkZBI4PlaiH0x4JdphRw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/ixgbe: support packet type with NEON' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/17/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/295b2079b0cd80810d= bad09c5e154b2590015065 Thanks. Kevin. --- >From 295b2079b0cd80810dbad09c5e154b2590015065 Mon Sep 17 00:00:00 2001 From: Ruifeng Wang Date: Thu, 24 Oct 2019 10:58:02 +0800 Subject: [PATCH] net/ixgbe: support packet type with NEON [ upstream commit 41fdc03e72c55ac7f28f0d52f3c1935a19015180 ] Ptype parse is missing in aarch64 vector PMD. It makes packet type info provided by NIC get lost, thus requires extra CPU cycles to do this. Add the parse process to utilize NIC hardware capability. In test with l3fwd (removed port conf DEV_RX_OFFLOAD_CHECKSUM), observed over 3% performance gain. Fixes: b20971b6cca0 ("net/ixgbe: implement vector driver for ARM") Signed-off-by: Ruifeng Wang Reviewed-by: Gavin Hu Reviewed-by: Ferruh Yigit --- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 64 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_eth= dev.c index 5492f5f5f..74de2ff4e 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -3882,5 +3882,5 @@ ixgbe_dev_supported_ptypes_get(struct rte_eth_dev *de= v) =09=09return ptypes; =20 -#if defined(RTE_ARCH_X86) +#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_NEON) =09if (dev->rx_pkt_burst =3D=3D ixgbe_recv_pkts_vec || =09 dev->rx_pkt_burst =3D=3D ixgbe_recv_scattered_pkts_vec) diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ix= gbe_rxtx_vec_neon.c index 07f2fafe7..fa73d1e45 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c @@ -146,4 +146,66 @@ desc_to_olflags_v(uint8x16x2_t sterr_tmp1, uint8x16x2_= t sterr_tmp2, #define IXGBE_VPMD_DESC_EOP_MASK=090x02020202 =20 +static inline uint32_t +get_packet_type(uint32_t pkt_info, +=09=09uint32_t etqf_check, +=09=09uint32_t tunnel_check) +{ +=09if (etqf_check) +=09=09return RTE_PTYPE_UNKNOWN; + +=09if (tunnel_check) { +=09=09pkt_info &=3D IXGBE_PACKET_TYPE_MASK_TUNNEL; +=09=09return ptype_table_tn[pkt_info]; +=09} + +=09pkt_info &=3D IXGBE_PACKET_TYPE_MASK_82599; +=09return ptype_table[pkt_info]; +} + +static inline void +desc_to_ptype_v(uint64x2_t descs[4], uint16_t pkt_type_mask, +=09=09struct rte_mbuf **rx_pkts) +{ +=09uint32x4_t etqf_check, tunnel_check; +=09uint32x4_t etqf_mask =3D vdupq_n_u32(0x8000); +=09uint32x4_t tunnel_mask =3D vdupq_n_u32(0x10000); +=09uint32x4_t ptype_mask =3D vdupq_n_u32((uint32_t)pkt_type_mask); +=09uint32x4_t ptype0 =3D vzipq_u32(vreinterpretq_u32_u64(descs[0]), +=09=09=09=09vreinterpretq_u32_u64(descs[2])).val[0]; +=09uint32x4_t ptype1 =3D vzipq_u32(vreinterpretq_u32_u64(descs[1]), +=09=09=09=09vreinterpretq_u32_u64(descs[3])).val[0]; + +=09/* interleave low 32 bits, +=09 * now we have 4 ptypes in a NEON register +=09 */ +=09ptype0 =3D vzipq_u32(ptype0, ptype1).val[0]; + +=09/* mask etqf bits */ +=09etqf_check =3D vandq_u32(ptype0, etqf_mask); +=09/* mask tunnel bits */ +=09tunnel_check =3D vandq_u32(ptype0, tunnel_mask); + +=09/* shift right by IXGBE_PACKET_TYPE_SHIFT, and apply ptype mask */ +=09ptype0 =3D vandq_u32(vshrq_n_u32(ptype0, IXGBE_PACKET_TYPE_SHIFT), +=09=09=09ptype_mask); + +=09rx_pkts[0]->packet_type =3D +=09=09get_packet_type(vgetq_lane_u32(ptype0, 0), +=09=09=09=09vgetq_lane_u32(etqf_check, 0), +=09=09=09=09vgetq_lane_u32(tunnel_check, 0)); +=09rx_pkts[1]->packet_type =3D +=09=09get_packet_type(vgetq_lane_u32(ptype0, 1), +=09=09=09=09vgetq_lane_u32(etqf_check, 1), +=09=09=09=09vgetq_lane_u32(tunnel_check, 1)); +=09rx_pkts[2]->packet_type =3D +=09=09get_packet_type(vgetq_lane_u32(ptype0, 2), +=09=09=09=09vgetq_lane_u32(etqf_check, 2), +=09=09=09=09vgetq_lane_u32(tunnel_check, 2)); +=09rx_pkts[3]->packet_type =3D +=09=09get_packet_type(vgetq_lane_u32(ptype0, 3), +=09=09=09=09vgetq_lane_u32(etqf_check, 3), +=09=09=09=09vgetq_lane_u32(tunnel_check, 3)); +} + static inline uint16_t _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, @@ -297,4 +359,6 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct r= te_mbuf **rx_pkts, =09=09=09 pkt_mb1); =20 +=09=09desc_to_ptype_v(descs, rxq->pkt_type_mask, &rx_pkts[pos]); + =09=09stat &=3D IXGBE_VPMD_DESC_DD_MASK; =20 --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:12.966873767 +0000 +++ 0003-net-ixgbe-support-packet-type-with-NEON.patch=092019-12-11 21:24:1= 2.535653945 +0000 @@ -1 +1 @@ -From 41fdc03e72c55ac7f28f0d52f3c1935a19015180 Mon Sep 17 00:00:00 2001 +From 295b2079b0cd80810dbad09c5e154b2590015065 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 41fdc03e72c55ac7f28f0d52f3c1935a19015180 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index dbce7a80e..3c7624f3a 100644 +index 5492f5f5f..74de2ff4e 100644 @@ -28 +29 @@ -@@ -3909,5 +3909,5 @@ ixgbe_dev_supported_ptypes_get(struct rte_eth_dev *d= ev) +@@ -3882,5 +3882,5 @@ ixgbe_dev_supported_ptypes_get(struct rte_eth_dev *d= ev) @@ -36 +37 @@ -index 26c0ef5ae..ee11fab96 100644 +index 07f2fafe7..fa73d1e45 100644 @@ -39,2 +40,2 @@ -@@ -147,4 +147,66 @@ desc_to_olflags_v(uint8x16x2_t sterr_tmp1, uint8x16x2= _t sterr_tmp2, - #define IXGBE_UINT8_BIT=09=09=09(CHAR_BIT * sizeof(uint8_t)) +@@ -146,4 +146,66 @@ desc_to_olflags_v(uint8x16x2_t sterr_tmp1, uint8x16x2= _t sterr_tmp2, + #define IXGBE_VPMD_DESC_EOP_MASK=090x02020202 @@ -106 +107 @@ -@@ -304,4 +366,6 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct = rte_mbuf **rx_pkts, +@@ -297,4 +359,6 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct = rte_mbuf **rx_pkts, @@ -111,2 +112,2 @@ - =09=09/* C.5 calc available number of desc */ - =09=09if (unlikely(stat =3D=3D 0)) { + =09=09stat &=3D IXGBE_VPMD_DESC_DD_MASK; +=20