From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0061.outbound.protection.outlook.com [104.47.1.61]) by dpdk.org (Postfix) with ESMTP id 622631B4BD for ; Wed, 26 Sep 2018 20:06:19 +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=p1hFyFT38KSNSteR9Wa1v0/+hmUJCOA4moE81T+LKt43zmArvza+BKsJi2QgzS/5e4u/Lr7xiJHzFiKZM2NVdTTFwHAtRaHvwBbI/XZ5Yau5vcqhCWsg2bcX0uwvbmzjx2Z+ByMzX4yhuKMRrcFtU/9opwwOeVbOPIsXeFOfvio= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.22; Wed, 26 Sep 2018 18:06:16 +0000 From: Shreyansh Jain To: dev@dpdk.org, ferruh.yigit@intel.com Cc: thomas@monjalon.net, Hemant Agrawal Date: Wed, 26 Sep 2018 23:34:39 +0530 Message-Id: <20180926180440.31726-15-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926180440.31726-1-shreyansh.jain@nxp.com> References: <20180917103631.32304-1-shreyansh.jain@nxp.com> <20180926180440.31726-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR0101CA0014.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::24) To AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21798edb-5498-4e76-1d6b-08d623dac20c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4679; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 3:Nq+Nn94G+wyFFYGC09l+to4i6OGnICJX3IOPxAkVm0OwqClGlVLTygonxMcyv5oA9Ql3HcGEOiXUTDLae/CRyXANzmv1mYUBIMtp7CiAgmj6UtNBRYDmZp9DK3/0agZoRm6Jt19bQdELhFBQoFoDts9/JLy2x1W6x8sxI49VQNVK8bhlVRhZzTxZ8RRXg3wW+3A88XGKGSzqZWxNtjqHp7j/uZOS9tj+VrmulFhnNxlTqjkfJUmVslUtoFOFm+ry; 25:6wcnmaHruwdrmStxaubV0AWU8YEskbi3oskQdQCLWWW5lfu7V8t7Yl0XMXqHJfLY3fh/88EODN7Y7Q8I1lgicei2JFWq3XRsJAbaJ6WJTBaog+R/c9h5oSjIlcxOAuuId5b/+2EpFbL1TLPh8u6kNluZXhomafPMqFZcPBelT4VF30gCAKlpyW9pEzDnYa+C6+2vXFOItuv1WxW2UVfXa5qwEuT8ixcukFHOpzM19vpsaTUND8z97w1+QAF7xzqOAfVQQLn6x4rwiJF9mAhBZfAPOmhYtI6Wk2o29fIYaw8yyIDXqUqvZ698pliEJrJgEcpWkUmKZUFbQZc4ioMgwA==; 31:vNE9AOAOtWA9TYyrxu+WqM17GqPnVFcB4LELat2P2BbMd/YMyaPcOp0siNwUX8eUBghSOD+tPuzEo1UUn+EYaqNJHNk8gCrRe/KJSvxiQiI63KRmNHCxUZHjlMOLCJvmUixjHbEF303rkkDiia7eOLwHmEYxEkvCDbQL/5yerFbr5A9AvxmNoSJ96RU5fWplthKpoPvHLInetPgpmTaqbfIrqxOyoSaARy75YX5cdM8= X-MS-TrafficTypeDiagnostic: AM6PR04MB4679: X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 20:M02w+ADnfw7ZpHhAIZ+1Qx3SNSfQh11vLil5tt1EY5aQVrToP+lgHN7bq6q+ar7jza7HQfdmXeNcahV3CT0rSYMyaoei4VxD7/NGNBZJKzwzXmAuAAU0C4+StBAaPWVwZ2XtxHcvxuOBxvf/RenXAt5rGQQjHTQI+yclYOlzTaqoWgX8qFYmDBrf57XWaGeUWHrYiiKqvJEzrnCJ5WucN3pqUXR1rrTSPE6ISOZwat7AHipwQzjvuKdScW2kxTbrL8qhtoKEvlQz/YeX3QFYDeLk85wSuD4o6hGvu04Q59ZGa9uNxnxzuUZuhfTewP4e13YYb3S1JIOspmZeMCSpqaFJYeXB7A3ruFhMBOAPLScgnxjs72GmW6OY8bGnwbINQJiwGoROiWny3Wwspcj4wtGfu+zH7F8Q3TzmDmo3GOonNnxOZtDT8xqbTXFYUMC/odk2pBBLeVoWdKp5vLAspvU0ovEQXDQjjPNxlSqJw7P+OWmYP9n/u5v5c6q6paAE; 4:CwrRFbwgx/g+6dqEgF7HHsKo9oS+Ji9Zn28LGjAGjvmq8SubLfpuQodmAb4kWhJIALQAtEgWm1C8GMlSPvMZgXuovlHCAWEpoBQnAgRdKYK6Vndl+qc6j6H/YeFGz2MQcJNDn1BWwpN/BJTZX0/Ovyk6vAy3kH/Y010msoB7y3zILR6AvtZ3k49blKuHxPgc4eVt1sSyeU3CW+5wenC8BjX9pg7JZumtIkH5gjtEypOEaqE8C/YMRaePipX+kj9RYiXiB4dGfxiCB33aInXmXldy7A8jjwxAwyfTfx2IXaYX243S35ZXsiKofufEG5GU 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)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:AM6PR04MB4679; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4679; X-Forefront-PRVS: 08076ABC99 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(136003)(396003)(346002)(366004)(39860400002)(189003)(199004)(11346002)(50226002)(446003)(47776003)(44832011)(956004)(476003)(106356001)(486006)(2616005)(6512007)(66066001)(305945005)(7736002)(6486002)(105586002)(36756003)(86362001)(478600001)(8936002)(16526019)(81166006)(50466002)(186003)(26005)(25786009)(8676002)(55236004)(48376002)(81156014)(4326008)(3846002)(6116002)(1076002)(6666003)(52116002)(34290500001)(5009440100003)(2906002)(217873002)(16586007)(51416003)(316002)(97736004)(6506007)(76176011)(5660300001)(386003)(68736007)(14444005)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4679; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR04MB4679; 23:WN/EcnVB1F+DkxdFzqhnvmRnvzxHsEuw5pV7Xi3Qi?= =?us-ascii?Q?kPNZ8mFSQqcIsaJWT2llM2dfwTLFEYwc2tT4VNQ76vmfM29Kw8FmNv1oOG4X?= =?us-ascii?Q?l979cV6+BDz5tC0HybKVa7ODocg7BUeytojLloW8wqSvtKfJfO2rmRm1aJo3?= =?us-ascii?Q?JlB2bE9LBY5CW2MuvvLbWRooto0NqTLmbFY60lgdPXsV0CFKn8LWCwG8rylV?= =?us-ascii?Q?j51QhUZwAOw1kwVV9OKTfPk2SF7yeyU2bh8nUQwP/Y/EuJKjEI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FESfChqsruCuTF1SskQ5AckgxoY5MoR004KaUg/mgu8XPaSiI5aR1HdwwIBZ1Ut/FiXQ==; 5:QatqdCHHpSLTsXpVyxVxcM/ea+O+SWPOxWv0MwZmQi7YsagILUIN5FhTC/cs+oRSyHeLEQ1g7oyeF6U+fapNV7ULK7x9OfOvHWMON1Dd3A9aSefchYcBAy40bFvtlUnHaaBiQXCm1SvTTcjZFIwDeNu5jkNCm4xxEN6Js97drd8=; 7:/eNJpWwj9lO2xtk3UvKSc3zsRfEA5VtC3Lk/DJv8RYhzAm3AflCD9Hk0F48Xv2UltREB46FIymxbr4+Y1xhrOD7yHq4zEjCXaga8k2NgXXFySwxqrPdt77iLf0yGWU8RJ71V6K8yLIu1sOwKnXyW4jyhl3iwOQXqdRyypjt+iVwgPuH3bWPnPAZnOybB8AkvdwIAahgnMy9MnG6qZebIG0igYgb3c2bKlLyD/fgqfJfZheLV73Z0y4ryCWSybvuR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2018 18:06:16.8514 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21798edb-5498-4e76-1d6b-08d623dac20c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4679 Subject: [dpdk-dev] [PATCH v2 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: , X-List-Received-Date: Wed, 26 Sep 2018 18:06:20 -0000 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(-) 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)) -- 2.17.1