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 /**