From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B94BFA04B5; Fri, 11 Sep 2020 10:36:58 +0200 (CEST) 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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(-) 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 /** -- 2.28.0