From patchwork Fri Oct 12 10:04:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148744 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp539898lji; Fri, 12 Oct 2018 03:07:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV61lua0zS6ow1ffqXdmwvpyvWDbRH7xZsy475HOLVGMoE3QTr5pDTBRJ52apqEmXifKBjt7o X-Received: by 2002:a1c:d0c8:: with SMTP id h191-v6mr3215341wmg.74.1539338870877; Fri, 12 Oct 2018 03:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338870; cv=none; d=google.com; s=arc-20160816; b=pRdu0cq9/cvjz1I4x9kSs3I6tpcstGkrwZRt3LNnzwygUpqH9PBUFkEEFaSxCq1sZG nroTixfT50jtwUxNG3wqvJpLZLE52eZ5wKveW4anx4Yoi3SMT/L4FFgRI0elzLKtyRW9 evw5fgTqn57iYMRUqRVRW5Pts68Gbz7c/XnGfmKAkqlXD2y/B4Lb/msjBnx2TjSBkNsT LvPZfiAWpGrum1XK43f47Mk9BPhOAOAAJWDIODHBGvowUrZcIGN83YpyihaquqrK8xpM TMcj3blE70AT7NJjUE6nARwSObZ9l8YybTLYCYK7PKov9feF1fZdi1HQiJzMV9PDFEkZ fptQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=+UIbJks+YvdIkGtgSGUGw0KA3rkbgOmJAUxPhm6hjYE=; b=D3l7ZneOD5Vyn5+shVtJPwF06o5EWZqakBAWJa6wLhpqGNTNdVx1iNG3+V2TTH8//w MCVGviFMkH67ikcWzlUBLDf6dXFqCtpPjNjqiJeycZq2jh7vdP0CYrJLfS8Q9L5vjWA3 Xk95gpYxmbqnxIA/KcUbgUQOus2JOkIe0yUBXI7z0aa7acF7Zvr/ZmuK7zn7i+VolGnf O/ZT9QqRo71BXqiY2Zyv+RCBCelYwDgL6+bzSyf9V3dDyPESa+hO607YXXbxM62eBqU/ 5zqF45loUlISsMPK+MMtNqLUVtUdfHR+B8Tq3q9r9UIF+S7cs5ms7uW8rSMoHqbqYAqC 26XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=I7bHpuvp; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id r13-v6si683087wrt.313.2018.10.12.03.07.50; Fri, 12 Oct 2018 03:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=I7bHpuvp; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D6B21B510; Fri, 12 Oct 2018 12:06:14 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00078.outbound.protection.outlook.com [40.107.0.78]) by dpdk.org (Postfix) with ESMTP id BFD1D1B4AE for ; Fri, 12 Oct 2018 12:06:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+UIbJks+YvdIkGtgSGUGw0KA3rkbgOmJAUxPhm6hjYE=; b=I7bHpuvpA+lU5KTC4mzN9QVa8M5/LwbW8oEZalhGQrS8D7vJLuFVXh/xoKyjot5ca7BwzcYdx+PgF3w4AiXqz3nuCrBLJrQhGZiOkO0zXhkM9S7l8mzPpEiWMbX7csPHyB7kfJTIbvpdiTc6zJjeL1QLPhRB8eiiLueaqgbQ7UA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:59 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:25 +0530 Message-Id: <20181012100426.29349-15-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bea2dc3-5860-4b3b-d559-08d6302a500b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnost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ge+ibgLVzRPd1mIixuuX5Ag43+AlS6g7/0I0TvMGg/iNR8PmiB5utLj3Ked24ljycLV1xS8DOKbfkR3A124RjveVXTxcsIibT3TMnFcnUBg5h1ASNHp+N7IhjNQJiJYZF+hM2D9cMSMu+qBjAN5iBMzeVST2krxg6TzNw32fO4RLHiCFr8QLcrzDz6zz8KyFyhqz7B4G9V4o7ZMD0+KFkPYOFkAxbiU2vovaVex+0mF1U8kt17EPqjXMXfK9iMREr8aKu2tpJcq0h11sTty1amXhuLhzPtyPrjn1sq2S+A8OzlMqIqhH/dOTudu+gkhuoEgP57LxLidG/f9IikoEtKJkcMbbqUFo33n4UpUFcki; 4:P2/EqJV1GkTSULXBBvxnnWRSVMSDJCgTHzv9slcuLFMhLFlpVG04jLWUTL5QpginufdMzzILaeByN2BFAm37V9JwS9YPjxqvwBs8gge+/mIxu/PCppCxvNKqfdyI0bGPl/5Z0MaHg73hK+iC9Rw2/YTOjSguquG7+7Ker+zE+HioflMXMHzR5Dz1LvhJDBrthQ108bqBCAiwyiI3JXM0QeUmgNHg298L/WQFcYCJMvJUxl2tsabbc/StDtnSZEamB4HfYIRtgqERHXaUu5C+BJ1aKIld6jEIycchlvK/QkYUmX0trz9O5sIHaopF1S0q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(217873002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:8svN5dYPzEb+VzNGUR/gGkrq/6Fy9UAu13DF12VYR?= CVzE55aKFwTdJWnJ8vykeN6wo/5x77Z0ncdC/fciVUBFLGjrXRNegQTVzb0tfEQRC7RufRqb1aM+K3NycG1MDcKXpmHivRcHh7+3mukBL/YLyIzpuVvwtyi3RdKPSsSB5t9AbVea4kfmbVgfWksAXLM7LkKAAcU7YKkQ6+ZUORy7kJo9jeQ08eE+/HomVzbFPsDUiI33KO06b2//t/RHZNQUmf1d5Huq1TyCD24PYNg4h+FLBYibHX8cLAvHqIQtxqnBYCfbLfsZLhdgrFmDqk1ZNGEbOqyd91kQp5TsH8qPU9qgpgcfeu5TZpGMusnkBmO4sDJmxYcfsO78pxM9ZrqhW8k9vou0yMh+7EPatHMt8bI7xyM7Ph+eoyme+bsyGqWa5DdA3r29Mbx4MghrwbR8OyiTseDhDgkwW0pQ2qdhWIPjBwQqvdqMUGqmMrBPESf9hHx8xYQGX49yNsQlkCdc1PsGEoSUusv5b7VdlSb+KrU40qNJsMW5pC/X7pBr9SMnYEZo+oR3+tt1wJLWP1hJlW/jEa2Hzwqg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1yfR65JOL+oacyVmpoT73cVAOQ62kv/ilJqbFex/OMQ8T2JydzpfWvhD6msqyhfqRRs3dQk138VS6y/krTzuFA8Z9YArc0= X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 6:DjF7WM5I272cKI0IGfS5zTXMR9A7zS+durjKxBjO3/WE52D+51SLxbEt/QGQF0qcM4PLUb0hgsIvWeL3AGfDJz3curnaHbYAdJ9O7xDzMPtmMGTcDpHKdj5Go/InchKGMNdWCBBpH+vsi+DE2Wg3p2VZZrkBmoCebMDlkXqnNKZIy1ERdexZIz67C/KaddZt651XYKFEeUAnCT6p9623vu25D2mB9jIitLlEyaDzKTULTON7waISddlTwHZApP8kmmG2DiFGc5EvTVMa1c+jRW0snSkjva04sHSfslpK20QyvrhlrgGwzNlWJ1j5rSr4jbAyN4Mdl9Yk1CiPdSibmE3y9uxxOq+h8RBmj5c0pv05i4uCmxPerbJxClAYvCz7ghx5sxrCXBszo+Cy80f/HpfFDeN1Nzd10NYyzhgaVVZExR3XnvHShZIb/cpfmIZGzSiYsaNinh8PjzbdGCHNNg==; 5:6nXIKHHP0QIEmzr8aLPZ26uZC0gT7XYOSRVnVKUUqH/n55hduw/YjTgJwKBziVSpKlizoPa4P6PsYaWOQTKoi9W9FwdZcjh5ZF0zzpVrwqR0kXxAiY7x4LbI/m4QW2xSDtvf0xuXYsQuG/brcIixxO53WOD9mrYfah3RPSDYf48=; 7:vc3LQZlQNYioEPfHGrKvaST6aSggPeiAgn9ohc4oWFzNeS9gpB+P6qdKhwpSuWRDzoOsUB/XyMHUIOt1S++bhqN1YdtNRPlceIopXV2OQmW6rhxXmYJ1dgwU1NCUuBsy/GLJph26dnmaoDlDa+POp1eMGeeQwb4/QahDE/G6p95nC33/HMA3IS8+HykQQ0mEEnwhH8fJaDP0ZXhIS7+jzEqZON1ticfz4POZGHJP+nYZBJOpRKfIZWFRzclua8wx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:59.9319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bea2dc3-5860-4b3b-d559-08d6302a500b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 14/15] net/dpaa2: support MBUF VLAN tci population from HW parser X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch adds the support to update the mbuf vlan tci field from the HW parse results in annotation area. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h | 40 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 55 +++++++++++++------- 2 files changed, 75 insertions(+), 20 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h index 779cdf2b2..adb730b71 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni_annot.h @@ -213,6 +213,46 @@ struct dpaa2_annot_hdr { #define DPAA2_L3_IPv6_UDP (L3_IPV6_1_PRESENT | L3_IPV6_1_UNICAST | \ L3_PROTO_UDP_PRESENT | L4_UNKNOWN_PROTOCOL) +/** + * Macros to get values in word5 + */ +#define SHIM_OFFSET_1(var) ((uint64_t)(var) & 0xFF00000000000000) +#define SHIM_OFFSET_2(var) ((uint64_t)(var) & 0x00FF000000000000) +#define IP_PID_OFFSET(var) ((uint64_t)(var) & 0x0000FF0000000000) +#define ETH_OFFSET(var) ((uint64_t)(var) & 0x000000FF00000000) +#define LLC_SNAP_OFFSET(var) ((uint64_t)(var) & 0x00000000FF000000) +#define VLAN_TCI_OFFSET_1(var) ((uint64_t)(var) & 0x0000000000FF0000) +#define VLAN_TCI_OFFSET_N(var) ((uint64_t)(var) & 0x000000000000FF00) +#define LAST_ETYPE_OFFSET(var) ((uint64_t)(var) & 0x00000000000000FF) + +/** + * Macros to get values in word6 + */ +#define PPPOE_OFFSET(var) ((uint64_t)(var) & 0xFF00000000000000) +#define MPLS_OFFSET_1(var) ((uint64_t)(var) & 0x00FF000000000000) +#define MPLS_OFFSET_N(var) ((uint64_t)(var) & 0x0000FF0000000000) +#define ARP_OR_IP_OFFSET_1(var) ((uint64_t)(var) & 0x000000FF00000000) +#define IP_N_OR_MIN_ENCAP_OFFSET(var) ((uint64_t)(var) & 0x00000000FF000000) +#define GRE_OFFSET(var) ((uint64_t)(var) & 0x0000000000FF0000) +#define L4_OFFSET(var) ((uint64_t)(var) & 0x000000000000FF00) +#define GTP_OR_ESP_OR_IPSEC_OFFSET(var) ((uint64_t)(var) & 0x00000000000000FF) + +/** + * Macros to get values in word7 + */ +#define IPV6_ROUTING_HDR_OFFSET_1(var) ((uint64_t)(var) & 0xFF00000000000000) +#define IPV6_ROUTING_HDR_OFFSET_2(var) ((uint64_t)(var) & 0x00FF000000000000) +#define NEXT_HDR_OFFSET(var) ((uint64_t)(var) & 0x0000FF0000000000) +#define IPV6_FRAG_OFFSET(var) ((uint64_t)(var) & 0x000000FF00000000) +#define GROSS_RUNNING_SUM(var) ((uint64_t)(var) & 0x00000000FFFF0000) +#define RUNNING_SUM(var) ((uint64_t)(var) & 0x000000000000FFFF) + +/** + * Macros to get values in word8 + */ +#define PARSE_ERROR_CODE(var) ((uint64_t)(var) & 0xFF00000000000000) +#define SOFT_PARSING_CONTEXT(var) ((uint64_t)(var) & 0x00FFFFFFFFFFFFFF) + /* Debug frame, otherwise supposed to be discarded */ #define DPAA2_ETH_FAS_DISC 0x80000000 /* MACSEC frame */ diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index fcd48b389..bc8b9ff89 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -25,6 +25,10 @@ #include "dpaa2_ethdev.h" #include "base/dpaa2_hw_dpni_annot.h" +static inline uint32_t __attribute__((hot)) +dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, + struct dpaa2_annot_hdr *annotation); + #define DPAA2_MBUF_TO_CONTIG_FD(_mbuf, _fd, _bpid) do { \ DPAA2_SET_FD_ADDR(_fd, DPAA2_MBUF_VADDR_TO_IOVA(_mbuf)); \ DPAA2_SET_FD_LEN(_fd, _mbuf->data_len); \ @@ -40,8 +44,6 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) { uint16_t frc = DPAA2_GET_FD_FRC_PARSE_SUM(fd); - DPAA2_PMD_DP_DEBUG("frc = 0x%x\t", frc); - m->packet_type = RTE_PTYPE_UNKNOWN; switch (frc) { case DPAA2_PKT_TYPE_ETHER: @@ -95,31 +97,45 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd) m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_ICMP; break; - case DPAA2_PKT_TYPE_VLAN_1: - case DPAA2_PKT_TYPE_VLAN_2: - m->ol_flags |= PKT_RX_VLAN; - break; - /* More switch cases can be added */ - /* TODO: Add handling for checksum error check from FRC */ default: - m->packet_type = RTE_PTYPE_UNKNOWN; + m->packet_type = dpaa2_dev_rx_parse_slow(m, + (void *)((size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)) + + DPAA2_FD_PTA_SIZE)); } m->hash.rss = fd->simple.flc_hi; m->ol_flags |= PKT_RX_RSS_HASH; } static inline uint32_t __attribute__((hot)) -dpaa2_dev_rx_parse_slow(struct dpaa2_annot_hdr *annotation) +dpaa2_dev_rx_parse_slow(struct rte_mbuf *mbuf, + struct dpaa2_annot_hdr *annotation) { uint32_t pkt_type = RTE_PTYPE_UNKNOWN; + uint16_t *vlan_tci; + + DPAA2_PMD_DP_DEBUG("(slow parse)annotation(3)=0x%" PRIx64 "\t" + "(4)=0x%" PRIx64 "\t", + annotation->word3, annotation->word4); + + if (BIT_ISSET_AT_POS(annotation->word3, L2_VLAN_1_PRESENT)) { + vlan_tci = rte_pktmbuf_mtod_offset(mbuf, uint16_t *, + (VLAN_TCI_OFFSET_1(annotation->word5) >> 16)); + mbuf->vlan_tci = rte_be_to_cpu_16(*vlan_tci); + mbuf->ol_flags |= PKT_RX_VLAN; + pkt_type |= RTE_PTYPE_L2_ETHER_VLAN; + } else if (BIT_ISSET_AT_POS(annotation->word3, L2_VLAN_N_PRESENT)) { + vlan_tci = rte_pktmbuf_mtod_offset(mbuf, uint16_t *, + (VLAN_TCI_OFFSET_1(annotation->word5) >> 16)); + mbuf->vlan_tci = rte_be_to_cpu_16(*vlan_tci); + mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_QINQ; + pkt_type |= RTE_PTYPE_L2_ETHER_QINQ; + } - DPAA2_PMD_DP_DEBUG("(slow parse) Annotation = 0x%" PRIx64 "\t", - annotation->word4); if (BIT_ISSET_AT_POS(annotation->word3, L2_ARP_PRESENT)) { - pkt_type = RTE_PTYPE_L2_ETHER_ARP; + pkt_type |= RTE_PTYPE_L2_ETHER_ARP; goto parse_done; } else if (BIT_ISSET_AT_POS(annotation->word3, L2_ETH_MAC_PRESENT)) { - pkt_type = RTE_PTYPE_L2_ETHER; + pkt_type |= RTE_PTYPE_L2_ETHER; } else { goto parse_done; } @@ -179,16 +195,15 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr) DPAA2_PMD_DP_DEBUG("(fast parse) Annotation = 0x%" PRIx64 "\t", annotation->word4); - /* Check offloads first */ - if (BIT_ISSET_AT_POS(annotation->word3, - L2_VLAN_1_PRESENT | L2_VLAN_N_PRESENT)) - mbuf->ol_flags |= PKT_RX_VLAN; - if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L3CE)) mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; else if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L4CE)) mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD; + /* Check detailed parsing requirement */ + if (annotation->word3 & 0x7FFFFC3FFFF) + return dpaa2_dev_rx_parse_slow(mbuf, annotation); + /* Return some common types from parse processing */ switch (annotation->word4) { case DPAA2_L3_IPv4: @@ -211,7 +226,7 @@ dpaa2_dev_rx_parse(struct rte_mbuf *mbuf, void *hw_annot_addr) break; } - return dpaa2_dev_rx_parse_slow(annotation); + return dpaa2_dev_rx_parse_slow(mbuf, annotation); } static inline struct rte_mbuf *__attribute__((hot))