From patchwork Fri Sep 11 07:59:11 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: 77352 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 80D30A04B5; Fri, 11 Sep 2020 10:00:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F3331C190; Fri, 11 Sep 2020 09:59:44 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10051.outbound.protection.outlook.com [40.107.1.51]) by dpdk.org (Postfix) with ESMTP id 039281C129 for ; Fri, 11 Sep 2020 09:59:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQF6M6IjQ4p+jCgTeUdsuIMcsE6P8f+E8DebXEuycbDwaLGYCtKmbGJmLTB+ek8J0X4iBPU/Gw9ECcnQfCw7A99REHwrd5tOpGKBlRu5kUbr6uN6AJivokVnTyAXw7h2Go0OEplwT5WHSDPaZsduHWCDscFIULENhDUbhdeiM4CE/5edxITeS+xK0Y6nWZtY1tM3xolnte/FsZcp+bM+sv46o7Wk9+3KTdq0TZXiWLuBB92ZSoUwQtF46N3jhgcIIrUSDkzhw/+oVzg85X9+MdURpFLzuWmJkj99QDyxU4xdQxl8iRccnX/FnqBoTXCFwiq3JptpV3ObNql1dRZQyw== 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=LqHS0cxWOzJMvJUvOb7L8cJGVtJiXSTqqrihVyy6BIk=; b=e7aIHxuUoUl3eUUIqhf8DsUwIK37UlrH7Ddeh+DoPIfetKwBoQvIVjQ2Ai0OMBoPaOqkLOqmIlduHV3WNbRpVSou5rtjQCdVNizLpzt0ZnGluFPT5T6MCCPxIVZlEwWXo/StSEfyuXmdPGWImALbR7W/6RR4CZScO12uwd43uzAOtBpKrytuIPirLNF/BQu4gW6MBK9y23KO9E0BvmUcJJzqhQCWChfKzGg0CtVuvRZSYFAJHhH45IK41QBIKBHuU68PDQJE+bRx4Zt1WvKA2dYImqVgWC1hyAs7CsDpiHCWrX/StgtSGDz1IxdYcNu2hjqx24tqcFckfDCZVovwrw== 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=LqHS0cxWOzJMvJUvOb7L8cJGVtJiXSTqqrihVyy6BIk=; b=OYI/Y31K+2Q9Ln7wqClvZQjtjI4rrz10wqpFeEShsIuYgst4ABy6YF+jTWrdQiXwYdnfx02W1Tmq/vLgpvwibI9VD6sXEHTdmIBdaKBhCoyqLfeflvH7MaF8vrkss5blOHIjqaPrvEHuGrP5fi65/QcV9C6yjpHRBd76ZA1V75U= 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 VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:40 +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 07:59:40 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:11 +0530 Message-Id: <20200911075911.3214-9-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) 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 SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) 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 07:59:38 +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: 05f2bd8d-b5b7-44ff-acf4-08d85628a261 X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: 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: H8lHvAq+hHwoUi2wyRE7xCOCohb+L8hBodWD0F+dk5TZ2i9PVfrJTuZoG9atQUkmK1TzjO16msDszN3uUwAZ+LdINYFrpVwXNR+qJReneSVcOiCDiOhlVRzqcROZZWXpnMYkVLztMP8TmRaGAXyx2P4dzO0iYS/RKY1I1lqq5O02djZlh+0QOUQ8KQh1GwQbFFRYgmRJUXeB/hYaw7zYDqKjJYPNtOWnngyseqm1ILbgMRMhjgEjNyJ2lelnS8U89Iz8j6WETsdNPk/YDAjHvbanYsBmElWHu5WiGolBBP+x5yJ0il8Lap+Uq4DomypIchv776p9Sqyk6pVJ2Pnq5gflMz/nM2QXLLELmQmYqEimQZohyT0sAubDC8LdS4bx 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)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZJwr7/m+XZ9kPPZA7zHfdBXAxHnkTK7MsDvR9MJI7/DO6cj0SwH9gTAyR40sSDPJDm6mclXTL+eFRSxVFdB7NC+5watLQHSiEv4bSgcT1V77VCvqlBP33GFiLmPlDB63UD0R5pG5m2LnKoOAEYN5lGcjgJg0K8Yfc2EehPzR563GR8FJsUgWjkq7PatWpKX9XD7Xss0LQMH2UjCfeipgBVzu6nqrD9LQqqtymdSVgZHpCSzAqEJheHlc83G0JfRIPChFUQlDQ9+2KUzmapLVf8H1IDhTUy/TsyWix8C48tVQJI9f1kfPvM6AJeYdqh5lEGLcR48Fv2wBw6DL4dMt7aLVjfVZdJieaIXziY6F7AkPOkOt9rktm3LqBKYuum4miysX4V2rmgEoVivlOHfWePrOmEsUygmt13gp3HtEbTPX+p9uwWXxzhsZluUjhk+H2XFPhxcw6w71pRGbW3d7hSisHELGhSlDV1Wjhqy23nMqxQvDCq/i7pvnfrStN5rwlE5z1rHbcd8Zloqj7EoUMVbjb67TGAy8SVvc6W1vLKEvG7wrxcblcwkkUmL2y0AHJ0KgJNlNELrsd8ZkELfU+rZzs0f/bfwuG5Hm2RB6dCqheAQ8/h/zKx20mpmt0lvWmv1Z2QHFj47e8m9hgtQYeg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05f2bd8d-b5b7-44ff-acf4-08d85628a261 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:40.0303 (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: VwDfvJDeZpEHYNIhvyeTmOYmvLwLVzkMlptST73D6Qw+v593OOdri+Imq14957Wx3iwKpQ4xYGBCcjkKK4xL1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0c76fa610..d0ac2f987 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 9715f3ce8..7aadf8b08 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 /**