From patchwork Thu Sep 24 04:02:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sachin Saxena \(OSS\)" X-Patchwork-Id: 313445 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp1021165ilg; Wed, 23 Sep 2020 21:03:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2paZt1v1b/m0XnDm/pTbKJxl/gdg8Znz1i5oGA8cqfMRslTMFamOX+J6EC8VWTCJ2a9dm X-Received: by 2002:a25:6848:: with SMTP id d69mr4220054ybc.205.1600920196834; Wed, 23 Sep 2020 21:03:16 -0700 (PDT) Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id n2si1934832yba.58.2020.09.23.21.03.16; Wed, 23 Sep 2020 21:03:16 -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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=anSKDPls; arc=fail (signature failed); 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 9CA4E1DD1E; Thu, 24 Sep 2020 06:02:45 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70074.outbound.protection.outlook.com [40.107.7.74]) by dpdk.org (Postfix) with ESMTP id 6CB2C1DD09 for ; Thu, 24 Sep 2020 06:02:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IOQd6pLn/5HvhmLx0tmxemGjKOyiLlD6XTWbbJ8HdjEaIlqmpDu/RSzrDVwDpSuiI5C37L4BCUO98yH6X9XuVacnZ8Yc2zRasdxQD45z3tmuRP4KJIPKcK3oBoj/O3ZTnHZDgDFtum8SMEfYSTJkxAVu9d081siN0lOpgx91qGmIMGF1pkzqPIdniigNPiRBcamlo/oqHNIHADVsMTC5//QRIorjhFwKeubB+Wcp1QGeqnn3pEr3ztBpo2jV2xlWHvG2puqhF7KpN6V4vS0Vz1Rj+RJBNgh+2k1zeNglIlcdxM5ro0sq0OQkeB+E52UUm+tG8Yad1Q8a/bkvbxKlSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rr1QYX/um2AAaeRkfOaTDwpVaIz5+Lrfyq/WL5bCIUY=; b=T0MIIZtB5CEujppsbF7hu3D/y78mkrTDJ6W+5oWh6XiZQ0rQd8aLhbIB+5AipHK0X8qYtutKhyb/knUjRLOlT6qckQaC0T0u6h06xalO7c/eNDoBPZ0t1MIdHOHtGH3GZb5RI4UdB33nTkgeMtgysXyxfn7f6CWzjjugajaDgGvGB/6AuAar4pCzggAU4GSOMM9smzHTe50Qbw76GN40WyUfyY9AAQRUinUVeBgV8xu0BYaj8MTmzkvTmT9T+6/KlTORTzFyJ4xPZRSxmnkCOYUZ1wp/tk6fqUjxUEX2SRuEZm/6kf1RYpLVoXjO1j/h/Hj/Zbmu9ctFLq4HEA5qHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rr1QYX/um2AAaeRkfOaTDwpVaIz5+Lrfyq/WL5bCIUY=; b=anSKDPlsj2KCApMwU3H/+mMoCsbWuEyemzYx9d18ln+FsQJT8izqAptIsVxda3qHtkGwCXjwcLSGk67Sx1ld0yQc6P6jCG6WHBPE2ftusCT9TmQqpb5FVzNclKORa9GYIlKvm/KiLKMte30ylaK9t9gJ5AnBf3GrbelKPkhGusQ= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB5839.eurprd04.prod.outlook.com (2603:10a6:803:e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11; Thu, 24 Sep 2020 04:02:30 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3391.013; Thu, 24 Sep 2020 04:02:30 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Thu, 24 Sep 2020 09:32:08 +0530 Message-Id: <20200924040209.32719-6-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200924040209.32719-1-sachin.saxena@oss.nxp.com> References: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> <20200924040209.32719-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:3:17::22) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:3:17::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3412.22 via Frontend Transport; Thu, 24 Sep 2020 04:02:29 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d84a5221-22e8-42b5-4229-08d8603ea859 X-MS-TrafficTypeDiagnostic: VI1PR04MB5839: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fiy9xjfDx2delinuJ8H94dILpDfchsCoGMDtRCIly/ndcTGPDn9XWJzwkhNddAJc1fiUcKDgb7K4Cn5WOYl3F5R3LcwPEGEgeZOa5BOP1hbtjOywg6xTQFFGbeoAFHGVLMQshZQtRwKCoMzFbHid6+yEBmjiVbwOoQyv4EYKenMvvRCsR5HiRXtA5CnxM4gaWf0WdRKmR4EutwN2CArNTB/PHyDjol87zSKLyg1mpu9z3/L83B5BspyXbCWsBhRAPQytVoIYWA5onk54ze9GAZuXXOmpcptU1I+/kULof9w7YTZQpzjUM0IfDw2CdpNfJ9+l7UoD1CZaWB2XbNskCsPfkPyFwqTBXWr5qG0tvLT8q/DFGSybP+m3HKthvFgY X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(346002)(136003)(376002)(39860400002)(2616005)(16526019)(83380400001)(186003)(6666004)(478600001)(26005)(316002)(6486002)(8936002)(1006002)(6512007)(66556008)(55236004)(66946007)(52116002)(1076003)(956004)(86362001)(2906002)(66476007)(8676002)(6506007)(5660300002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: navLt+AYXdOTSSi5EEnf5AX6DGRaznWfSkg11/iC8VncG2zZRLeEp5dR4OhAvDu1McQ838AVS/oT8fTIO2tnraVt2ySp/AhYcsjc2mwy+PWaPe/hf8nyE2x11mfItD8+lDwHdj0o2EtIWMj9T0t8FkCmmCsTm5V2VF4OxCAq5GOEU/9y5WsXR6TBMu1TW89zl3Hoj7NLKgEuscN4EhMtRBpnZJy3ZBOxE8cr5Pll7XszYg005skPntzphs6dEtNZd22YLuvijLYstanvHmw8INW4yOdYIU7Fi52vBuE/Vr3LqzDgAXk+a9+eLL6PBffdxQeqE+alonJMzMJmGLA6iJSh8wvccLV4WHlMSF2qCUazkXiZudmWXHUF43MkRgA4lBBn2lHXUKWYSX9uMKYSawuOSjl6dlld/8znRpmA+pkfS2SnxeHMH6uNDwdq3npLenZHhtqOPcBw2ZZCROL+/ydFApym52bD51Fv7VeGLgHNm1X4jz/aLtuHS0nBr0gK9+UJNBt6HJttXrlKSs8PqYN2/nAKkumjyg4lbgeA6RHOjCmsYJC9p8c/PJwicMJUJ7exwUDlESyAje45liKIENNv9qI/NTvwY54rP9Pd09krnvyERA6IPsbvXyA3hhFRgW3Vf9RBOMjt+l4oanwu4w== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d84a5221-22e8-42b5-4229-08d8603ea859 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2020 04:02:30.3524 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NArEL8SiiLVeB1ISgq9WTioAu2M5G6gKJsF0C7nw0U8bH8F1yjD0eFvJ317WGXEB1pGTAIb1WLPQZQyBlykcyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5839 Subject: [dpdk-dev] [PATCH v3 5/6] net/dpaa: send error packets to application 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: Nipun Gupta Send error packets to main queue (rx) to make application enable to receive error packets. Earlier all packets with L3/L4 checksum errors were getting dropped by the hardware. Signed-off-by: Rohit Raj Signed-off-by: Nipun Gupta --- drivers/net/dpaa/dpaa_ethdev.c | 10 ++++------ drivers/net/dpaa/dpaa_rxtx.c | 17 +++++++++++++---- drivers/net/dpaa/dpaa_rxtx.h | 21 +++++++++++++++++++-- 3 files changed, 36 insertions(+), 12 deletions(-) -- 2.28.0 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d5eeb280a..a07d7cefe 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -991,7 +991,8 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, rxq->fqid, ret); } } - + /* Enable main queue to receive error packets also by default */ + fman_if_set_err_fqid(fif, rxq->fqid); return 0; } @@ -1953,13 +1954,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) fman_intf->mac_addr.addr_bytes[5]); if (!fman_intf->is_shared_mac) { - /* Disable RX mode */ -#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + /* Configure error packet handling */ fman_if_receive_rx_errors(fman_intf, FM_FD_RX_STATUS_ERR_MASK); -#else - fman_if_discard_rx_errors(fman_intf); -#endif + /* Disable RX mode */ fman_if_disable_rx(fman_intf); /* Disable promiscuous mode */ fman_if_promiscuous_disable(fman_intf); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 6eadbfa14..e4f012c23 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -125,6 +125,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot); + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD | + PKT_RX_L4_CKSUM_GOOD; + switch (prs) { case DPAA_PKT_TYPE_IPV4: m->packet_type = RTE_PTYPE_L2_ETHER | @@ -199,6 +202,16 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; break; + case DPAA_PKT_TYPE_IPV4_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_CSUM_ERR: + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_BAD; + break; + case DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR: + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_L4_CKSUM_BAD; + break; case DPAA_PKT_TYPE_NONE: m->packet_type = 0; break; @@ -213,10 +226,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) /* Set the hash values */ m->hash.rss = (uint32_t)(annot->hash); - /* All packets with Bad checksum are dropped by interface (and - * corresponding notification issued to RX error queues). - */ - m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD; /* Check if Vlan is present */ if (prs & DPAA_PARSE_VLAN_MASK) diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index fe8eb6dc7..d9d7e04f5 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017 NXP + * Copyright 2017,2020 NXP * */ @@ -61,7 +61,7 @@ * 0x8000 - Ethernet type * ShimR & Logical Port ID 0x0000 */ -#define DPAA_PARSE_MASK 0x00E044ED00800000 +#define DPAA_PARSE_MASK 0x00F044EF00800000 #define DPAA_PARSE_VLAN_MASK 0x0000000000700000 /* Parsed values (Little Endian) */ @@ -137,6 +137,23 @@ (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6) #define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \ (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_6_4) + +/* Checksum Errors */ +#define DPAA_PKT_IP_CSUM_ERR 0x0000400200000000 +#define DPAA_PKT_L4_CSUM_ERR 0x0010000000000000 +#define DPAA_PKT_TYPE_IPV4_CSUM_ERR \ + (DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV4) +#define DPAA_PKT_TYPE_IPV6_CSUM_ERR \ + (DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV6) +#define DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_TCP) +#define DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_TCP) +#define DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_UDP) +#define DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_UDP) + #define DPAA_PKT_L3_LEN_SHIFT 7 /** From patchwork Fri Sep 11 08:35:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sachin Saxena \(OSS\)" X-Patchwork-Id: 249710 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp1450603ilk; Fri, 11 Sep 2020 01:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4jR6YlrdTWhexPJxEzo62yeZWO+sl9xCVwZFm20Ief0QKLJxkCG37FUSyk4/NGrxzkiZd X-Received: by 2002:a17:906:5e59:: with SMTP id b25mr1025969eju.414.1599813407277; Fri, 11 Sep 2020 01:36:47 -0700 (PDT) Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 19si825113ejz.498.2020.09.11.01.36.47; Fri, 11 Sep 2020 01:36:47 -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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="h+ae4/XU"; arc=fail (signature failed); 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 B95B01C137; Fri, 11 Sep 2020 10:35:49 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70047.outbound.protection.outlook.com [40.107.7.47]) by dpdk.org (Postfix) with ESMTP id BA7591C135 for ; Fri, 11 Sep 2020 10:35:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B4fJWa4nVdXslXnTVf2dd24NeBDNs+Zwc4xjAXpC8zK77VGPljjMiFI8RNwnM2GJP0TIKqzv8mCvJYRafTV0cfefuyBudlhRxQyVZ9h0eTY1vZwTkql031L7CPzScNWKsY/m2taJEQH++DoOtjv+ENO2dWQ1+7qryQ2BXx9qPeFmvYqTWBFTcsTgWjXEaoq0Q40xE6RuUjcg7b5MGIKBZ/vN6bOajdkv4TSglV/gbJupH1nqkd3LC6ZDtW1ANYbRTCZvfGr1TOECNP2BJlJ+z+UbuUozYZosoE8PG/gllOBi9J5wo7QUG0/5dcANWUeMG7j8EKrAxuGilSrkScYtBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R9CGSrq5elqkPQTIFQDIfWYtSecPt0y1nFtEv+2NvTE=; b=PJtp4snJ9pZKlKkfwYoB7dWCnuo+fh5WPlCHcBK9sq59omgf8h7+6fHj3EGFIq+5hE7wCSLUVPC8J1zYmr5Xc958IBhzzSC0MaKe/sks80srAC75ot6aXuMhXnquKQaUvexHXHh8v3I6MyR/R0Vt6b3f+Eya8c7OMdXST+n59D3izyeMkWVVvVg9BHJ6Ml1SSBArTlgi8ymAOAYZwTloG6nQB7oZNpsK748oU8mGfsFSyt+SXubPcvz60t23loH5MVe67qeojH/4vEF33eZGMIJg59CRzGLLWPpyfBBR6y0EeE1/2v1pFK3kDLtUL7U6qxlJHH+F0hX4a0ampMfujQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R9CGSrq5elqkPQTIFQDIfWYtSecPt0y1nFtEv+2NvTE=; b=h+ae4/XUGStWAW+4RXe1WsFODMItThSiAwQPSnk79OTjft1N5eleAQ8WklX+AH70xrA9meLcY9WE+C1FsQEic8gx5y2Zn+N1meWbNiCDYu84y7/bDfXehJIy6QTDNAiQhmhN+KnvPtv816aecq8Z/MfY9ns4HHA7mT/ztwQtB7o= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6973.eurprd04.prod.outlook.com (2603:10a6:803:13d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Fri, 11 Sep 2020 08:35:46 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 08:35:46 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 14:05:19 +0530 Message-Id: <20200911083520.24020-8-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> References: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 08:35:45 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6d57df49-58eb-4389-018f-08d8562dadca X-MS-TrafficTypeDiagnostic: VI1PR04MB6973: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:177; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0RvF6/Mt83GJh3s79oBGC6goK5nb7SD7JTFcUpwzdCigo1BY/swljTPN3QuiLhmRSvSlqvcFq52WjOag6HfoqDD1GV3HTH19666Z/bHge13pnrV9/hUU/mzoBYqectJ3YWR9CGrULgDdw6Gq9/67PkTHAZvp3bXarJ2cWgRkL6KMz65SszDnn0TaZFwajEZNoHmPm8YE0ySRtbuAH2DaDD4o/bfs+8NVsgeZbLViIy/z9411Tz9TxNmtrt/SyqnhhD76FwiBSHdRlDm6GtxhRWoaBvZgKXmFn7TO/6Q5DGN9JqKXwwk+WMVkEAFCL0iKGf4X873hQqlwr8K1rKiRLGcPwU237n+Psq/S0fYry48kAaOH7Ib/wBriPIfPQOUx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(136003)(396003)(39860400002)(366004)(52116002)(86362001)(1076003)(66556008)(66946007)(2906002)(66476007)(8936002)(5660300002)(316002)(8676002)(2616005)(956004)(6512007)(16526019)(186003)(6486002)(1006002)(6666004)(26005)(6506007)(478600001)(55236004)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: XcEmAtD1+DX/mCBkU2eDofhuImnZYSgiFGdJfQivGfneNYiXEO+JUjwyFGRy49EbrifpHuGl4UqycDB4HVbvoe3I9YG6KdclLp4dYyw0vTF6Bvw45LbEsgLDkRE+6vNj2NIAHQrPL0ZbkEBZ+n1FEqRPYEP+8ZwzXfbysgNWtANq3E8CPDqjhL13jbY/1A+hb/pnVM/kTI+Is5RSn6n4j74SRqVjZcFmRSuX1MyMvng9EOeEmTKf0xD9iAVZcZ8+b8Sbd2p9lrAgPaIiJ5SsXKldlvuWxfJTW0W8n797DXw5UncglXP266GNgHdl+oceO4wmX/EMrcf7rs556eyxQzUnPqfmFzwQF+O2zxj7FxbNUbbkFjzmLJZ7+AerpiggaCYs2PuYUfSis++vRquZuQRZVHktmsoqRhBrNNlJt7nGSCg60IYPFgAPnaJYA2NINEW6Z8W/+JcIHIrGG7Tjw/7GT497Xg2BDvs+ePNq62XDcSCCW3ML03POIPJXcrBa4AfGIKqUj9NlmRBFmEc7785hHLxkTY3ZuBjxGJlCKDgT+9bz3ZvPzFeyGJh5WkqGtHVXM4Jp0/d0swL4nhACvHUPG8INJ4JoM4c2IHRU0Nu6MbC3DbKeiCmNJmJQ7mSuBzA7KBWSVcKMSXFOZd4sgw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d57df49-58eb-4389-018f-08d8562dadca X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 08:35:46.7636 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xKR6ppQRbvZX0fw6/ADrRLddOGsBiUo8el7PIN+DosYcPJ3O7tf8wfDMUSYX+CghP1BZJE1p5gCgdlZ65S7RKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 7/8] bus/dpaa: send error packets to application 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: Nipun Gupta Api fman_if_set_err_fqid should be marked as internal. Signed-off-by: Sachin Saxena Signed-off-by: Rohit Raj Signed-off-by: Nipun Gupta --- drivers/bus/dpaa/include/fsl_fman.h | 1 + drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 2 files changed, 2 insertions(+) -- 2.28.0 diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index 3b759c365..a3cf77f0e 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -111,6 +111,7 @@ __rte_internal int fman_if_set_fc_quanta(struct fman_if *fm_if, u16 pause_quanta); /* Set default error fqid on specific interface */ +__rte_internal void fman_if_set_err_fqid(struct fman_if *fm_if, uint32_t err_fqid); /* Get IC transfer params */ diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 26436e9fe..9bd260121 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -36,6 +36,7 @@ INTERNAL { fman_if_promiscuous_enable; fman_if_reset_mcast_filter_table; fman_if_set_bp; + fman_if_set_err_fqid; fman_if_set_fc_quanta; fman_if_set_fc_threshold; fman_if_set_fdoff; From patchwork Fri Sep 11 08:35:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sachin Saxena \(OSS\)" X-Patchwork-Id: 249711 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp1450705ilk; Fri, 11 Sep 2020 01:36:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD/k7JGBUQ/F3woeV+bwRAyi+O/2A+vw/F+8W4CjJrDW+KCXIsg2Gk44YJbmVgx4Y41GMR X-Received: by 2002:a05:6402:7d2:: with SMTP id u18mr882959edy.69.1599813419116; Fri, 11 Sep 2020 01:36:59 -0700 (PDT) Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id ck3si842843ejb.362.2020.09.11.01.36.58; Fri, 11 Sep 2020 01:36:59 -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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=G8nbCCKZ; arc=fail (signature failed); 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 407D71C196; Fri, 11 Sep 2020 10:35:51 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2065.outbound.protection.outlook.com [40.107.22.65]) by dpdk.org (Postfix) with ESMTP id 6F0FE1C12B for ; Fri, 11 Sep 2020 10:35:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OAbkFUWafiT/i9QKH2dx/eKCQnsXTegBou4F+bIH3i5VVLiejEOpbeylWN0/eqIm8ueW7l+Z51VFP/aBJL4HRufi8Vs2iSBToZq4pH3R5zSwti3uj8ZqQ8EF2P5KnVNIWa6ZYQp9ZmGCKX15EN2/Y4x+Xa+Xy1pMHcG7UZKn+rIyWjF5fmvErCW6G/PE0zNcq+MlHq2jJ711r4u4gey2KIwYDkM7Cv6Mc0/spaCp1Tl3i74404YePoxezXTT1Qdas3RckWfpruaNruBZclHuvuAvVChsoHe2vjPUDbpRsKnfTqw+IisIcuK/R9Jfo3rG8XU6qFN+LTQEm64ovhC15g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nkfeY9cK0bWzQLL4/e19HkzV4FJ7ZJSCyAai9mVP6ig=; b=Lsi0ovTdFMt6Ev9Ykvj+j91TqXIhisU7Hfs9B8ZO1Jix5Y6wqE4wJ8UWWNBkTdPbT7Zu5XmvkjmsSylnVb3vxKpTGeeetRqZA9D0CKk7hPwrF6Iw+l0tyT+vFedDCjHav4qiU/3QJmSQxPvVA/agwBHznjmJ6FPx7ryh+s5FCVU29u+iTUUSqNYMiB9KhTe+S5SmW8y/I1tNnI6bzTQvlDS2s7YKdfDsv2syaCKO5PzYj4YkzPCMomkxTaV/83QhWH1IpDVkJDUP/4wC60mG7luXHdPp3x+sw0DNb3kEE4M2n/TXSfQk1D9RBxeyTimEB6vaZSIWoaRZEaWiNPLs+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nkfeY9cK0bWzQLL4/e19HkzV4FJ7ZJSCyAai9mVP6ig=; b=G8nbCCKZQovXsrw6zc0ygW+GdpFrYwSdHop6aCqQOJO0AEQfMYulhwp62yuAo/RuzN7kBZIMFAhrZa3fg+Pl3q2Dfgi/myzIvBc65WeFYEH9zGJjN26an5TVusif6twDQ5zXskEOCUQt1NRC/LctdXM9OW/tt4WtrDyPvZ8WWrc= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6973.eurprd04.prod.outlook.com (2603:10a6:803:13d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Fri, 11 Sep 2020 08:35:48 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 08:35:48 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 14:05:20 +0530 Message-Id: <20200911083520.24020-9-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> References: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 08:35:47 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 41a4c570-3b44-49da-9f87-08d8562daee9 X-MS-TrafficTypeDiagnostic: VI1PR04MB6973: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:854; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ar3raJtexxhju0PDJ6eItYoc3V6tsY73A6KGTZkLuPRIXEF0eiwKAw14gvYKBs7CSA6BXzAMDcfmGxSDCeTzdRzWRFYLrrumSlgXXWq+j9NnCTYcKrFa+CT7ItfFc/1XPIA1Tl/N7mLunotmliLPsLY0EFREvi7vtqwW8S5njPwZCn2thixEZJvQAL2HcohCB/ztSvV+XZtWSiPjYrZp7Hp6XNEDdn5OsjvRJypWM3DZlrK4ogod8fOu6YZHMUJqUQUlcerIuCaZMh24+5CkKXtPGwpjvhCUdWXq26UAdD5z5l8QsyNFC8ea4BHYqriieVo6r6IIUIZvbIrPWzxTB8eH5fhVDxRRftvlFZzPmyrG4K10vTLdcQq69JUfpo+e X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(136003)(396003)(39860400002)(366004)(52116002)(86362001)(1076003)(66556008)(66946007)(2906002)(66476007)(8936002)(5660300002)(83380400001)(316002)(8676002)(2616005)(956004)(6512007)(16526019)(186003)(6486002)(1006002)(6666004)(26005)(6506007)(478600001)(55236004)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: FbSR21mC1BJwOLBU8CNJDfiE7y5Ns/+0ce2+HvFg6cObpX1VjzndihLBVunFSUR1YbeaoF0m58M2gCGJHa83YwSmwB/nBIMUbR/f65jav/V3tV6IQYzaSWzNk6y9Sqkqx8iILsypaSkZyHnBSs23XoxLf24NTYEDjxzyMaFeMD1789Brtv5xZM09nY0D58ZI4iprcgXaDl5BvlRe0yWhpwYa1CQmO4ss3HhWFYl4oNyv75TATDZonAxH+jwMzyamk3GzRgRJt8Kfp7XYxOZH+Gbmvv5gXkMlHXuQTcxGr8USncvAZNyJTYcj7NgOza4+8izj2fR45X+i7RKD9FJShHoz+G36dcxKRNMepztokNEJ2QqqhGNDXAXVpXryjY+m+wEdWNVxrgRC6/m4x7mcs9t/r3p3v04rKGq7+VxYoHwv/ykqFmlwsbyufjUBDJMQ7S/RhxAehMXmaeaQ162iFME2qVzPUtneEbBGc61Z3qyDGqv/46BHoT0GUDijgEW2ahDeloYPeDqyFjUPSj52osrNvL4jWgIkq/D7Ri5F/1DKngUNGqhKooMY5aE+8/XpVkbMczUqWK7bMi/fKVwfQuJ4cJ3YnMTbDx4upZ/NgapmHohkPJ3HY76chxRXz0Z6I0kjRB6Vc8Elm/zI3I4Ssg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41a4c570-3b44-49da-9f87-08d8562daee9 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 08:35:48.5326 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pj7JptusmIIxnNPIBxLdtz6eNZGAVwnZxkQZ5XK1nwUdgtq76N1LOF5kYMKsAxxOH8e1b1pHdTjE4bVIJI62aQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 8/8] net/dpaa: send error packets to application 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: Nipun Gupta Send error packets to main queue (rx) to make application enable to receive error packets. Signed-off-by: Rohit Raj Signed-off-by: Nipun Gupta --- drivers/net/dpaa/dpaa_ethdev.c | 10 ++++------ drivers/net/dpaa/dpaa_rxtx.c | 17 +++++++++++++---- drivers/net/dpaa/dpaa_rxtx.h | 21 +++++++++++++++++++-- 3 files changed, 36 insertions(+), 12 deletions(-) -- 2.28.0 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 66bb6eb00..edd63b0d2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1068,7 +1068,8 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, rxq->fqid, ret); } } - + /* Enable main queue to receive error packets also by default */ + fman_if_set_err_fqid(fif, rxq->fqid); return 0; } @@ -2030,13 +2031,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) fman_intf->mac_addr.addr_bytes[5]); if (!fman_intf->is_shared_mac) { - /* Disable RX mode */ -#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + /* Configure error packet handling */ fman_if_receive_rx_errors(fman_intf, FM_FD_RX_STATUS_ERR_MASK); -#else - fman_if_discard_rx_errors(fman_intf); -#endif + /* Disable RX mode */ fman_if_disable_rx(fman_intf); /* Disable promiscuous mode */ fman_if_promiscuous_disable(fman_intf); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 6eadbfa14..e4f012c23 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -125,6 +125,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot); + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD | + PKT_RX_L4_CKSUM_GOOD; + switch (prs) { case DPAA_PKT_TYPE_IPV4: m->packet_type = RTE_PTYPE_L2_ETHER | @@ -199,6 +202,16 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; break; + case DPAA_PKT_TYPE_IPV4_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_CSUM_ERR: + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_BAD; + break; + case DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR: + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_L4_CKSUM_BAD; + break; case DPAA_PKT_TYPE_NONE: m->packet_type = 0; break; @@ -213,10 +226,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) /* Set the hash values */ m->hash.rss = (uint32_t)(annot->hash); - /* All packets with Bad checksum are dropped by interface (and - * corresponding notification issued to RX error queues). - */ - m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD; /* Check if Vlan is present */ if (prs & DPAA_PARSE_VLAN_MASK) diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index fe8eb6dc7..d9d7e04f5 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017 NXP + * Copyright 2017,2020 NXP * */ @@ -61,7 +61,7 @@ * 0x8000 - Ethernet type * ShimR & Logical Port ID 0x0000 */ -#define DPAA_PARSE_MASK 0x00E044ED00800000 +#define DPAA_PARSE_MASK 0x00F044EF00800000 #define DPAA_PARSE_VLAN_MASK 0x0000000000700000 /* Parsed values (Little Endian) */ @@ -137,6 +137,23 @@ (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6) #define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \ (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_6_4) + +/* Checksum Errors */ +#define DPAA_PKT_IP_CSUM_ERR 0x0000400200000000 +#define DPAA_PKT_L4_CSUM_ERR 0x0010000000000000 +#define DPAA_PKT_TYPE_IPV4_CSUM_ERR \ + (DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV4) +#define DPAA_PKT_TYPE_IPV6_CSUM_ERR \ + (DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV6) +#define DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_TCP) +#define DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_TCP) +#define DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_UDP) +#define DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_UDP) + #define DPAA_PKT_L3_LEN_SHIFT 7 /**