From patchwork Fri Sep 11 08:35:13 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: 77361 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 B773EA04B5; Fri, 11 Sep 2020 10:35:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1018A1C10A; Fri, 11 Sep 2020 10:35:38 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40057.outbound.protection.outlook.com [40.107.4.57]) by dpdk.org (Postfix) with ESMTP id AF1991C0D4; Fri, 11 Sep 2020 10:35:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDtLchpA2l2RFERhc/q7wQ2V/e6qQVTik019+7z7WnMZ+t028P/JAh29T30Oza0SDiEkmfaO6+Vc90lQCsWKcZ54ai/gN++UDdJumZ+hn2wz5SwQ24TsCKdQPXESjOxDyTdV1z4PY2N3jjoNKdalqfA+x/kdZ3PPOu1oBtz7E4M9Pos7LeuJYLktM/QUNVHQm88CWZg7XHBWh7kOhhFtKSFC3N0q36Y47hIJjRdRaU/eIFVGRScayTau4ufeBIAo9p2vEPzl2d3mslO6NulvGSlDL9o+yftwfODjf5UsILzUU5FzyNpsvcjMnHQjqR3Z1oLXIoI1+6Nx+0K7adeX3g== 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=EvWCyDpz9zTtQBdb+PVRepHgeFeC4MjPNLnHm7JFm9o=; b=ZfgFyNASuyKki44bpL1GZRWO9kW2xB60PikpfY2p+8ZkZc5eUl7qfVnIkqZu8CEyqxIUujFRzBuZ6qm4lkW7nelCGtJRnpQmtL/IPdvv1Z0dPEPFLlT/id6lwp2gcmWi+voyOVScL+nIVTdc1vmN9OvxFFXi35Lnd6EksOIxFy+5E/UcX+5blhvj2qkGZie44Qn0FvtgTNlQMkWIge4zVBZ8XIlfzUD6Y/VQlw1eLANwQTANuwYZf2SUcKHSa///2dCLaN9c6FGC4Q21DKH0GxWFinn9xm4LLmCL1tg2RldQsyiSlkYGFHlZcwzNHuc+Nsfj+y6Bl3m3XBXCUM++3w== 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=EvWCyDpz9zTtQBdb+PVRepHgeFeC4MjPNLnHm7JFm9o=; b=D9tAnzbP0f3F8yQUiEXLo2OdARotNc0KERAvZd7LPXVledvrR+HLMsIC8cpbHeHDnhUIDg0Qp4dWcze5CYgly1x6+8uxu5NM7rBOMFyU7QQd51/hMOcudNslfa0H/kRre9n/6suLmYJ5vk4ugMjwy30UMojjf2ZjGee52fR7jk4= 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:35 +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:34 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Cc: stable@dpdk.org Date: Fri, 11 Sep 2020 14:05:13 +0530 Message-Id: <20200911083520.24020-2-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:33 +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: f8b3f0cb-7fcd-4f3e-a192-08d8562da6bb 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:370; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P0jkj9ebTGPw9ZPtfzeeJ25zKFUw6ifULz6Q8tm4eNs/DuhO+qWbNlw6FV2qOb1D+WKgbd2SQKZKmDRo3iKjfd+7Z11mOu2fjrqdcBYrt7uC3+PnDBjuMMo9tm6dRNbGOM15dsubz4Q+mKOC+vCesnQFw85K7dVY1czpVtUY4Rjeb80uWll5U77zYRKQH8SymZ+/801liFwBC2Sxyq9CQvNIzR6I/hiwAJQc9C8/y1xXG7o2fme5Fp3ezik7VRLM8GdyEXQlV7jbUEoXuHXy0mplNh7ImE0utc+uVA8FNbuPEAm5Vjxzudvxy7LSSK/JkF6IuATM3ViwG1OKYsZ3Hn+F6r/GS7zx4E8mP3Q5rrQdFkJ45KMIOphn82lptPoX 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)(4326008)(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: UWSwLe+UbuWFnV3vG+WuSeUskemHjxnxT3cKCxccSOygeIi33Q/FLxWY/3CQJrvoZ4RVnPuGoJW9lrZQnGogsDVAaT3BmuT85exmW+FyC1MFz9pzZtbFyMybIKfp67b++YTziy/MtL9wxuTM3UVu3IGvJo+mYMILNCjgjOvDsX+QGYxsfZgqggJRkXR2tGObQOkAF54kqfHf6rUr7UMTvXfo25SMkBnvSkqtVtWQfbj1XpydRmNJqLvA2Y/rDLH15Tni8LTecJDSsTMcduT6tuHJ9pVHWBy/iRB/6kkyJmaSxh1o9UJK5daHmUUcZRku/FUWmthmz3LJ38OAxmjyZoSGvWG9FDL9nrQcJZWL9r/76RBSQvcQiOm+ozQ4JUyFCLCt/GLirtHpVqfrEJ+kLEhbo90m2ZCrVbLQEIuDtxngMvifsezMxv2UAFY1ec0SccmLnGn2Fn6oWHqgoUKwEUNrdAHKUe439D1nQOYUyWm3iqzn3PYaL5FDQ+WiUUYvQO2gJu5ezF9eSOOls76MpzZhYe1KdVfaMYG/wmbv/yyT994lszTLZyHjimUc98wkJK9UWRZ6IlP5YbAehXWvOmzdBMX57hv78v/Ilw407aR5bK7KT/oGMoHLA+JSEheNSZHmX39K/ba0dFahJNS2ag== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8b3f0cb-7fcd-4f3e-a192-08d8562da6bb 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:34.8493 (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: J7D/VtuuLcQSjzHNWQEQ6IwU5RUPl5QRUqkDAj7ALyPLvepmySfVaL8sAFi+BSx4O/8I940C/OThdSGPW9VNtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 1/8] bus/fslmc: fix atomic queues on nxp lx2 platform 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: Youri Querry Traffic was stalling after few packet while running l2fwd-event in atomic mode on LX2 platform. It was due to wrong dca setting while enqueuing packets to EQCR. This patch fixes the issue by writing correct dca setting. Fixes: 1b49352f41be ("bus/fslmc: rename portal pi index to consumer index") Cc: stable@dpdk.org Signed-off-by: Youri Querry Signed-off-by: Rohit Raj Acked-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_portal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 0a2af7be4..77c9d508c 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -1201,6 +1201,8 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, QBMAN_CENA_SWP_EQCR(eqcr_pi & half_mask)); memcpy(&p[1], &cl[1], 28); memcpy(&p[8], &fd[i], sizeof(*fd)); + p[0] = cl[0] | s->eqcr.pi_vb; + if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) { struct qbman_eq_desc *d = (struct qbman_eq_desc *)p; @@ -1208,7 +1210,6 @@ static int qbman_swp_enqueue_multiple_mem_back(struct qbman_swp *s, ((flags[i]) & QBMAN_EQCR_DCA_IDXMASK); } eqcr_pi++; - p[0] = cl[0] | s->eqcr.pi_vb; if (!(eqcr_pi & half_mask)) s->eqcr.pi_vb ^= QB_VALID_BIT; From patchwork Fri Sep 11 08:35:14 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: 77362 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 76CA4A04B5; Fri, 11 Sep 2020 10:35:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5BC281C116; Fri, 11 Sep 2020 10:35:40 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40070.outbound.protection.outlook.com [40.107.4.70]) by dpdk.org (Postfix) with ESMTP id B2E0A1C0D8 for ; Fri, 11 Sep 2020 10:35:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bwI3dIDhcwnOjOcCdgpMlRVSBh2MCJ/AvtrUjEihYSJriaBP197XpjEaL6vH1BrqNnicwuOvk/kTq0nG57T6elQZ6BXSWPcUCwD4833q/fPvoJyrmP8D32yPWn40peERRlfWLmAzDsY3DbapmKJUf8ChaGmye230Nnr8KG2U+Q5EXt4YDyKcUEzaNPSD/infUQAmJ4d1pGV7ebiexmp9lDw8/CsTn5qc7gy8wyU8shqJYNSIORdlOcFQOfG+Iws2xbd2L3S06pKPGRVlq6vw38zCfMoRqnHoZaj7npxwHIIY5z0WyBHnfZ05PYJ+a1XgfMjQqbf5IfT9RMoIQ5lF2A== 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=DhYf9P/m+pT4CvVKKftzKE/DGU8A+VbjMrbRkHzFVrU=; b=cdt/2tuI2hr1PzDF3E85IURJgh9pd3LXLjJdbBlC6kvlZ37xRlBiSKMc3wkvcVG/fZvwA8XmmoYTwKIgv+HwQvYzDaDuwsHUdwdojfpCs1PyEQUTSsjWnNzDkDRuJ68Hkl72rE8aQPZ2KQDyH6cr/0Elj74iS87EOLsxwDFioAGLaNIPIBJTMqsTH7+oYKMRZ/wmuI/zCtwQmKHleJK8SZWgKeh7L4rx42DX8p91JIBSl3CqXNnG1Qj47E55gRP/tz2en93ONprfFIANZWuaIX8eAZJlqA7ZTW6eGjc6TjNHZLsjsGgTh2CUMfqvBDIDiwskRqyzdojMP+64Hy84Lg== 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=DhYf9P/m+pT4CvVKKftzKE/DGU8A+VbjMrbRkHzFVrU=; b=iivzqs/zlNsnEWDEXBAQlcnq6jJBPLdUXS5/xwPJ9JTyvr9IqHiQ7+Cc/CzU6W89+pdBTecxr8jGyuPeO2htmdruUIMNsPWvy9TJYDHaFlEtj9dz6nvXsSdbfERrOBmFVyCfM5d+LvJBlvT8wfdLTk9XYyB4C9s2OSHmtNFV/xg= 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:37 +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:36 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Sachin Saxena Date: Fri, 11 Sep 2020 14:05:14 +0530 Message-Id: <20200911083520.24020-3-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:35 +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: a29e05da-fdbe-44b8-aeeb-08d8562da7ef 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:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gG5V5QGDq5dNPtTg5qne3jiQQdXiYa2u2jo1GEA1+ctWfaoAmAPP5O9f7rbVPrkhigTNmzpxXosR3lzVCz2N4dDUBUA+ej59t8zdDVgwUQr6ItRcZkPm91k9aaGWLKvrkZbTX37yWZ/mqP/j9B45HiIDh01UVdfDVcLAZeGrpuLiNj+ljx/5seO19It2FBacKOM0bZ3NTXpR9XImxpyONh0laztobZdM6GjIN/vVs8PoEZvWqeYXTnFggjdyIlswQZh+yvxxkffXmHdmtB6QoqNNQviCJgj46PFZnUa+xaIwhflBoqdpS5lmHvDT9DgiOcsLyG3tcol3Ysz98b5oUtAE1UTFgcVPsMxl4xOMEvNmghf9l8j+KcGPOUWxAkN9 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)(4326008)(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: 8p71zFI43KbV5TNmnSAezzBgEWKC2a5YC1Fv/cgpwQ+kknc6VDv+QF0bxrC3DpycwgiMvwNqOA4ToPfdjymuhJUIgFuFhlkq3yFRJ59QFMErsXkdEM4e0AZ+BRIXmwIkool8rkJfLM7GzkwWHDlfBJnJqLwRlyj8lnfihakRwjQjEnS37KfliTmNMt43sMKDPT93EFEsXr/nIdnA0++C17evDFTv3Gt2cLr0w2ucouVsxgozb9dcat5dnj0ySinbJBk2TdORxYfDQHvrcUOxEz6Feh/A0QZnF8AzHI/yd1s8jiBpXiSgZdyGikMRqKqHcqOkwwgaUDSkRAwdUOIpaGZyAOb01BpL2iC/N2itALgVVcYvVSyDRkqTHkgmaRFVuS2q6T1ttYQHyvk4NU8QXsVIwtW9hJnzFs7sMtvlF71E4SjMJTc1bAHmNNrRE4jxyCYkAuLX+5kHsE09xudm1dmrjzM4p9W7POu026rMakD0bqRk5YhSAnXvQkR/Mk9Kooy0E1cgTQRO98P0YpIuGpiwZoO9hglynuCI1H+s8AqkZfzhisHR4dorYffmT6s5reJ+IkUId2vwM0uZDxabyRQbRFMxS3tDvZ13SkSb1maLqDDbDVIg6i1ZGVa/cT7bLAqOHAhhU8twr0gWvaQOSQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a29e05da-fdbe-44b8-aeeb-08d8562da7ef 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:36.8342 (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: XHIPjbUnLfQ3dC8t6ttE/TtFvSs3aVc91uBzq7P9H0kGjjmKYViMonbmNhwpDOWRPj/wW6Nm5GHFxjD1M6SFDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 2/8] bus/fslmc: run secondary debug app without blocklist devices 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: Rohit Raj dpaa2 hw impose limits on some HW access devices like DPMCP(Mnagement control Port) and DPIO (HW portal). This causes issue in their usages in shared uses in case of multi-process applications. It can overcome by using allowlist/blocklist in primary and secondary applications. However it imposes restrictions on standard debugging apps like dpdk-procinfo, which can be used to debug any existing application. This patch introduces reserving extra DPMCP and DPIO to be used by secondary process if devices are not blocked previously in primary application. This leaves the last DPMCP and DPIO for the secondary process usages. Signed-off-by: Rohit Raj Reviewed-by: Sachin Saxena --- drivers/bus/fslmc/fslmc_vfio.c | 66 +++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 9134ec552..6dd797632 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -802,10 +802,29 @@ fslmc_vfio_process_group(void) int ret; int found_mportal = 0; struct rte_dpaa2_device *dev, *dev_temp; + bool is_dpmcp_in_blocklist = false, is_dpio_in_blocklist = false; + int dpmcp_count = 0, dpio_count = 0, current_device; + + TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { + if (dev->dev_type == DPAA2_MPORTAL) { + dpmcp_count++; + if (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED) + is_dpmcp_in_blocklist = true; + } + if (dev->dev_type == DPAA2_IO) { + dpio_count++; + if (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED) + is_dpmcp_in_blocklist = true; + } + } /* Search the MCP as that should be initialized first. */ + current_device = 0; TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { if (dev->dev_type == DPAA2_MPORTAL) { + current_device++; if (dev->device.devargs && dev->device.devargs->policy == RTE_DEV_BLACKLISTED) { DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", @@ -815,13 +834,24 @@ fslmc_vfio_process_group(void) continue; } - ret = fslmc_process_mcp(dev); - if (ret) { - DPAA2_BUS_ERR("Unable to map MC Portal"); - return -1; + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + !is_dpmcp_in_blocklist) { + if (dpmcp_count == 1 || + current_device != dpmcp_count) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + continue; + } } - if (!found_mportal) + + if (!found_mportal) { + ret = fslmc_process_mcp(dev); + if (ret) { + DPAA2_BUS_ERR("Unable to map MC Portal"); + return -1; + } found_mportal = 1; + } TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); free(dev); @@ -838,7 +868,10 @@ fslmc_vfio_process_group(void) return -1; } + current_device = 0; TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { + if (dev->dev_type == DPAA2_IO) + current_device++; if (dev->device.devargs && dev->device.devargs->policy == RTE_DEV_BLACKLISTED) { DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", @@ -846,6 +879,14 @@ fslmc_vfio_process_group(void) TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); continue; } + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + dev->dev_type != DPAA2_ETH && + dev->dev_type != DPAA2_CRYPTO && + dev->dev_type != DPAA2_QDMA && + dev->dev_type != DPAA2_IO) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); + continue; + } switch (dev->dev_type) { case DPAA2_ETH: case DPAA2_CRYPTO: @@ -882,6 +923,21 @@ fslmc_vfio_process_group(void) break; case DPAA2_IO: + if (!is_dpio_in_blocklist && dpio_count > 1) { + if (rte_eal_process_type() == RTE_PROC_SECONDARY + && current_device != dpio_count) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + break; + } + if (rte_eal_process_type() == RTE_PROC_PRIMARY + && current_device == dpio_count) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + break; + } + } + ret = fslmc_process_iodevices(dev); if (ret) { DPAA2_BUS_DEBUG("Dev (%s) init failed", From patchwork Fri Sep 11 08:35:15 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: 77363 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 7C5B4A04B5; Fri, 11 Sep 2020 10:36:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 854061C11C; Fri, 11 Sep 2020 10:35:42 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40078.outbound.protection.outlook.com [40.107.4.78]) by dpdk.org (Postfix) with ESMTP id 062EA1C115 for ; Fri, 11 Sep 2020 10:35:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjZbJyYjmWKedIvVcUNwNyfy6nGH+MNKkixL1IVCPE5fp5iPPZvMuFcwwFBNrg/EAnkp3/k0jND3WcFh7XUtqLXVCKdKvEaauc5FbBYXL5pecI8cUXKKpYkOgDhWj9L60hPUHljDkBEY5R5h8B6IM/AqntXd3g7XYBGn9x0voGFYGqij7J1RZD+TfHc2LxaskFYMWsyq3aP1AUdOSjy3QBmjY0cmc640vX83V+Nrh9b6DjI0GkDBTSrMjq6JrhcntMJJ0oCzQaH2NOGMAVyO2BIrYD237AouoHYsKlwGjL8q7wtjNRBV6913bD2X5pQSI3foBNTvYNdT/geeVPIiwg== 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=k/yZQGC8wco+E1OGunhhxhU8ICqv8m2ox54VshLxMbU=; b=GxcJKGhsWBYI5TKLH3OsRtR7b3gYVvYOCBJhl6BFJFmlrh7bVpRA/kIEwaz73TzSvOnq7Az02eYTCn6AGJESRJxHYPZ/ek3nVvRdXCwOUb6Iv0UmgSs7Gw6M0z9TsHxAY7n/cZWiIfdOpG7Xyz4+O5xBWP9zqXWygCUdfxH3KpbBlH4FtPbBKHRloDjAojkBjwVh080tYy/sGbfBdQEKWs1cuRcipDVXAJiSgnbcvHf6dUVRfdKifwAYXFBrbnig1GbPPLQs6Nwe6xKgb8+izwGGu6hgpJlYVrVNhOQsF7J7/A/rnHhYzWbaCFmPPpCQu8L4UhK34cIFIwkzR6jHXQ== 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=k/yZQGC8wco+E1OGunhhxhU8ICqv8m2ox54VshLxMbU=; b=Fyxw5TpfTAfw79i1sU332p+tCiOGTKCRJMU/EWj4GycvJZrlZACRS8aKd5Ovo4Vr/yHuUz4KrBadUD2DZS+UkcZbit9cI1uXs4rJgQwDCmFC3PGAVSDnEixR174HvL9kGK8RDZmlkAXqFgyTkvUYeCLFJkXohtjHS79Hj6g5DZE= 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:39 +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:39 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 14:05:15 +0530 Message-Id: <20200911083520.24020-4-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:37 +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: 1b102610-5fe6-440c-f712-08d8562da900 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:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iQk7gAbvzOEfULnjIWI3olF55paTbhJZdF+PCsJqHYasVecLiAc9cQ0KXB85ZJi01D285BUMMsinsHdqvi5ytz+H5ht/yfGA+kStMZeoFlPCOUdZHaKaOb8C7bh9K2CTHbAaCNnux6laULpj7wlORE4T9246kHVgH5DO/vhS0IDuIhxx2NVOlMRsw431HGkZO2IJmyab/txoHmZoNhk7DUjx5nWvFAEH71TnNi22eMF9ziBGnTJXlXwdaeh63AU1MRBNGejJnV1cFwo3sPZ9wW07hISef4PKobr7SyE4dNz4XT2o2q9mibqK2mer9qBVoU28rVYQcMovup4Y2F/8KPeP+h4wxjJgWnJ/5bB4H8BmDKYUJA5XaZ+qtFC/5TBY 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)(4744005)(55236004)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: q24eBhiXFfpbMFOof+sCdHMbAB3xq/701Wo2UFGS6DbnAnmk8O27kzHwYO35k7bSI0XokLiz3U9pkhLxaE00vJt1a8jXvS5ZAr+VkXYNxcruBuURaM7Cs5FzR0bwjY0c71ScoSkOvU4Bm08RFoLx1Tr417k0fUvHhL0bf6xvR4V6EYxg710ddWRtSxlN2zg1Vcz5QmaA6u73Po7fRo8aHGHrMtzmB+/PXCItTugQHNkxaXO0ESlhGZJifyhUYxauN4GVv6NEz4P4/6dWVR9EQiyFp/caebFYZ03KQVdPtftiIUbzL6SJrwqiWeKZqwIa1sZRH5zBHRJojEp7vIj9Lq5mzSo56fRKcJm4wvR92X+redK/3M5NEnQyrY2HDvKBCDwAkIyozMGTr6xZg3tXgiWZ/cK5i0jBl403LvrkR9VVUcnENWDdII0jfdqpDFM/Z3My0uEMocIDnUjA6tarUNb54V/hAbrlveVWkdI26fs0RviwLIrzVsvssPeAdiTlMpvoYAH9W0ge/1S/nO/8nCreSDEH6p3p57+q/MfC8oz1jlxVdgm4aeYkArOxYLZyW2jSDUyaeIf/XXnmAeX4+Alpn1zcXgJ3mt73exZAmDA5LY4MZnaOXaLtRLtaGfuEn9VdxqwYu/z6CLQvRwH8+g== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b102610-5fe6-440c-f712-08d8562da900 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:39.2319 (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: gI3nzDblDzsNFS4hgrJBBTcGqpoAwadvjCA5poHXFZxxbmio693FFgrdKKlIm11XgTbfEpW5M52KqWZPVrvjtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 3/8] net/dpaa2: fix check for key size 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: Apeksha Gupta DPAA2 has support for raw flow classification, which can be used for any protocol rules. This change fixes flow key pattern length match. Fixes: 3f881f8d6eb0 ("net/dpaa2: support raw flow classification") Signed-off-by: Apeksha Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index 843021335..29f1f2e65 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -2901,7 +2901,7 @@ dpaa2_configure_flow_raw(struct rte_flow *flow, flow->tc_id = group; flow->tc_index = attr->priority; - if (prev_key_size < spec->length) { + if (prev_key_size <= spec->length) { ret = dpaa2_flow_extract_add_raw(&priv->extract.qos_key_extract, spec->length); if (ret) { From patchwork Fri Sep 11 08:35:16 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: 77364 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 DB114A04B5; Fri, 11 Sep 2020 10:36:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7B821C128; Fri, 11 Sep 2020 10:35:44 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by dpdk.org (Postfix) with ESMTP id 1AE7F1C11B for ; Fri, 11 Sep 2020 10:35:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7ratDa6/ybFvzOUTPrycM1xuVBzloS74v7TiPUlmgcvEhNiIJNzQ9lCQ5tN3PZp1YVPkQkvDeEEJnBkfZEW4JbOx3nUWY1aAqKpgkL5iyVXpXT2lI/w0utXG7622JreLEpP0rTqvCRF9lBYPh5qhzG6hSTTtOr1lOe6FkHRfZ32AItkwzfvcz72LgpU2nBnwTYvVwsnWmiw7ddLdUsfKj0XIYsVxpU6ehYj5yilXgRi5dKaI29v1W9Ys1hu2DGEzCiagLxC6mB19XNFosqwMiMeH8GhnyqTb8a1YE3qAFMx130f0w0oYly9M5qhzgPKIJ59VnSAU62aUAgwV/tuHg== 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=lhsNYSQiuyUz+arZAL6+K1ChdpfMtsRKOLVT3S4mxo0=; b=jZ7ebXTQ2zL2NJgj6Ds0JnXcr+YYDx/TQGO6sB5MeHWXeFzQtpz+WjIS+RR585Mwcin844gM0uT/tjCGsYoRC59IUe2vUAsnebb8SuTVwlJq8mB5TbCxICgG+JuH6A5bRt1Mg4Ecylov/sVc2l0MlTNoLL0U69T0RBZvxUXYxPF3QYL7uhd2QBK8K3RvU6UIyllDJDyVvie+SADEQxPXqlyo1sshngT+ZF1ALj7uRZG8ImP7lf/1oiHSxQtVS3NnWB3NHVtFsONJ85hA8xykwlUrJhXKz0UVA4B52Q74/srPnGhxRLOMkqjAPUjoBuHt/PL7X3PJaw0izd0RiPTjqA== 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=lhsNYSQiuyUz+arZAL6+K1ChdpfMtsRKOLVT3S4mxo0=; b=EuYCq4BDmM0vBfC9rVY2czQRni7GmOF4tgyz4IUpUuCtlx+SZrn/fdZp75UAbk4VOdGVBO5Ge9TqVy59Dx5vAnCndppHshYqkq9VdHP2+MPqUBJefiVlrjF9EPBp7V0TJT3JwyzVQFc4wOO7hDmsSC5nCSWetIrexyS930XehF4= 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:41 +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:41 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 14:05:16 +0530 Message-Id: <20200911083520.24020-5-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:39 +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: 1c39988b-6849-42bb-0522-08d8562daa69 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:389; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QYcjfiV0GgOeUSJVj0TASCg8RVmDgxzG5WEds0gXOZt2Ltlpj2Bqozqfu5dnl4uQlKmUQVNsT2r9RED8XVDuD+qQSZgQgg0JHOBdPceKPeC6dP7aakm3ex5bvP3WvyeEw5Cj51oxr667YiFkK9OXoW9Ic4TSSewv3UehVXNJZvHoWR1T3DtN5Dbu7oPb7sziFEZYYGPKdAK/471jx0WqcfTwI0nId/hPQNCE822sMdgcDiuvtsBAecqY9YqcpjrXm3pa7bj8L7TBAoegkP4IENVPS7mlCKcbBnvUBEGV3f7X2EDYyg4YZcmpsMP4PkyuQYqOg1Xvc/RsNl+MyeS3xttcZ0kfPeFK2XhcPWsAuKuGDMDjrgGEm45CyNwrOZ6O 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: z2NBOK51l6mGj5FiY6KhrdlbdImurCAU1FqnwzSKz1FtDp9/IgG3Ucn32mffyLv+OQUXgSHjDOY4J/lEfvVoeKonCGd/8YKuBRa3Z/Kt6Y7yr3MZweTei6Njr6ILrKestU85ybWT0oKo+8StKMsAdy+j94Tp7qWinjYvkD1M5NuR2hGkNpzqEOgjvOQnPAvztIWCMo1h7nh9zlF5e1TPvJ5X/5shuMYQm59LRa9ddIdsi5zzSVuPGLeYojPdfHWyYpQGci93/3kvrz2y2izMcDr9RUkb4hkX+9FeYudk4FwhisiN4BlFL6LCw2rJrx/4Z7uIMYgfn5d7ZxC/BO+TZl+H3aaBsHT3E6LUwawWFRX2WvNarVdDc0sJ+IqLt+/39Im+WyvX4PLQ1wqiTb1zZ9jkS11ifJsfc+YSOnOPCW4r4xcRzIjX+CGQOxA+jOlKZ9dTRfQHtpTXEJ1UJ1K2NJywQY0nR6qx9h+LjaE+5ymBDRK4L4OwYUgOpT16x9tUXvPW2BmkSGWapdxxZ7WY99ocUkIZWaIfdepBsl3f2TYJSa9pukQEo9maVcvwN7GFljSIq41lTu11G1v4sQyHGXKiu7DZxUP/5QF+aMKuqDIFxcevoxujkQsPsiTtipAmxq84+6ahnF7Ep80CluhNaw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c39988b-6849-42bb-0522-08d8562daa69 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:41.0958 (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: oUOraFFRflSd4bNi6fTATg5PylUk31VgDsZ8wsrY2tUy+vg/MD5dAvcfUIcjKCPuHq7slxy1ihske/2JEXXm/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 4/8] bus/dpaa: RX/TX error queues 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: Sachin Saxena CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER=y 1) Enable TX/RX error queues to check the errors. 2) Display error frame information(payload, status, paresr result). Signed-off-by: Jun Yang Signed-off-by: Rohit Raj Signed-off-by: Sachin Saxena --- drivers/bus/dpaa/base/fman/fman_hw.c | 19 ++++ drivers/bus/dpaa/include/fman.h | 2 + drivers/bus/dpaa/include/fsl_fman.h | 4 + drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + drivers/net/dpaa/dpaa_ethdev.c | 22 ++++- drivers/net/dpaa/dpaa_rxtx.c | 109 ++++++++++++++++++---- 6 files changed, 137 insertions(+), 20 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 9ab8e835d..4ab49f785 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -609,3 +609,22 @@ fman_if_discard_rx_errors(struct fman_if *fm_if) fmbm_rfsdm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rfsdm; out_be32(fmbm_rfsdm, 0x010EE3F0); } + +void +fman_if_receive_rx_errors(struct fman_if *fm_if, + unsigned int err_eq) +{ + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + unsigned int *fmbm_rcfg, *fmbm_rfsdm, *fmbm_rfsem; + unsigned int val; + + fmbm_rcfg = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rcfg; + fmbm_rfsdm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rfsdm; + fmbm_rfsem = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rfsem; + + val = in_be32(fmbm_rcfg); + out_be32(fmbm_rcfg, val | BMI_PORT_CFG_FDOVR); + + out_be32(fmbm_rfsdm, 0); + out_be32(fmbm_rfsem, err_eq); +} diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h index dcf408372..f2b0bf91e 100644 --- a/drivers/bus/dpaa/include/fman.h +++ b/drivers/bus/dpaa/include/fman.h @@ -226,6 +226,8 @@ struct memac_regs { uint32_t thm; /**< 0x37C tx messages counter */ }; +#define BMI_PORT_CFG_FDOVR 0x02000000 + struct rx_bmi_regs { uint32_t fmbm_rcfg; /**< Rx Configuration */ uint32_t fmbm_rst; /**< Rx Status */ diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index 6c87c8db0..3b759c365 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -151,6 +151,10 @@ void fman_if_set_dnia(struct fman_if *fm_if, uint32_t nia); __rte_internal void fman_if_discard_rx_errors(struct fman_if *fm_if); +__rte_internal +void fman_if_receive_rx_errors(struct fman_if *fm_if, + unsigned int err_eq); + __rte_internal void fman_if_set_mcast_filter_table(struct fman_if *p); diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index f47922c6a..5b97b6eb2 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -44,6 +44,7 @@ INTERNAL { fman_if_stats_get_all; fman_if_stats_reset; fman_ip_rev; + fman_if_receive_rx_errors; fsl_qman_fq_portal_create; netcfg_acquire; netcfg_release; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index a077b98c3..d5eeb280a 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,6 +47,7 @@ #include #include #include +#include /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = @@ -1895,11 +1896,19 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->nb_tx_queues = MAX_DPAA_CORES; #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER - dpaa_debug_queue_init(&dpaa_intf->debug_queues[ - DPAA_DEBUG_FQ_RX_ERROR], fman_intf->fqid_rx_err); + ret = dpaa_debug_queue_init(&dpaa_intf->debug_queues + [DPAA_DEBUG_FQ_RX_ERROR], fman_intf->fqid_rx_err); + if (ret) { + DPAA_PMD_ERR("DPAA RX ERROR queue init failed!"); + goto free_tx; + } dpaa_intf->debug_queues[DPAA_DEBUG_FQ_RX_ERROR].dpaa_intf = dpaa_intf; - dpaa_debug_queue_init(&dpaa_intf->debug_queues[ - DPAA_DEBUG_FQ_TX_ERROR], fman_intf->fqid_tx_err); + ret = dpaa_debug_queue_init(&dpaa_intf->debug_queues + [DPAA_DEBUG_FQ_TX_ERROR], fman_intf->fqid_tx_err); + if (ret) { + DPAA_PMD_ERR("DPAA TX ERROR queue init failed!"); + goto free_tx; + } dpaa_intf->debug_queues[DPAA_DEBUG_FQ_TX_ERROR].dpaa_intf = dpaa_intf; #endif @@ -1945,7 +1954,12 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) if (!fman_intf->is_shared_mac) { /* Disable RX mode */ +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + fman_if_receive_rx_errors(fman_intf, + FM_FD_RX_STATUS_ERR_MASK); +#else fman_if_discard_rx_errors(fman_intf); +#endif 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 5303c9b76..6eadbfa14 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -58,29 +58,57 @@ (_fd)->bpid = _bpid; \ } while (0) -#if (defined RTE_LIBRTE_DPAA_DEBUG_DRIVER) -static void dpaa_display_frame(const struct qm_fd *fd) +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER +#define DISPLAY_PRINT printf +static void dpaa_display_frame_info(const struct qm_fd *fd, + uint32_t fqid, bool rx) { int ii; char *ptr; + struct annotations_t *annot = rte_dpaa_mem_ptov(fd->addr); + uint8_t format; + + if (!fd->status) { + /* Do not display correct packets.*/ + return; + } + + format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> + DPAA_FD_FORMAT_SHIFT; + + DISPLAY_PRINT("fqid %d bpid %d addr 0x%lx, format %d\r\n", + fqid, fd->bpid, (unsigned long)fd->addr, fd->format); + DISPLAY_PRINT("off %d, len %d stat 0x%x\r\n", + fd->offset, fd->length20, fd->status); + if (rx) { + ptr = (char *)&annot->parse; + DISPLAY_PRINT("RX parser result:\r\n"); + for (ii = 0; ii < (int)sizeof(struct dpaa_eth_parse_results_t); + ii++) { + DISPLAY_PRINT("%02x ", ptr[ii]); + if (((ii + 1) % 16) == 0) + DISPLAY_PRINT("\n"); + } + DISPLAY_PRINT("\n"); + } - printf("%s::bpid %x addr %08x%08x, format %d off %d, len %d stat %x\n", - __func__, fd->bpid, fd->addr_hi, fd->addr_lo, fd->format, - fd->offset, fd->length20, fd->status); + if (unlikely(format == qm_fd_sg)) { + /*TBD:S/G display: to be implemented*/ + return; + } - ptr = (char *)rte_dpaa_mem_ptov(fd->addr); + DISPLAY_PRINT("Frame payload:\r\n"); + ptr = (char *)annot; ptr += fd->offset; - printf("%02x ", *ptr); - for (ii = 1; ii < fd->length20; ii++) { - printf("%02x ", *ptr); - if ((ii % 16) == 0) + for (ii = 0; ii < fd->length20; ii++) { + DISPLAY_PRINT("%02x ", ptr[ii]); + if (((ii + 1) % 16) == 0) printf("\n"); - ptr++; } - printf("\n"); + DISPLAY_PRINT("\n"); } #else -#define dpaa_display_frame(a) +#define dpaa_display_frame_info(a, b, c) #endif static inline void dpaa_slow_parsing(struct rte_mbuf *m __rte_unused, @@ -377,7 +405,6 @@ dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) DPAA_DP_LOG(DEBUG, " FD--->MBUF off %d len = %d", offset, length); /* Ignoring case when format != qm_fd_contig */ - dpaa_display_frame(fd); ptr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd)); mbuf = (struct rte_mbuf *)((char *)ptr - bp_info->meta_data_size); @@ -492,7 +519,6 @@ dpaa_rx_cb_no_prefetch(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, fd = &dqrr[i]->fd; dpaa_intf = fq[0]->dpaa_intf; - format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; if (unlikely(format == qm_fd_sg)) { @@ -515,6 +541,7 @@ dpaa_rx_cb_no_prefetch(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); dpaa_eth_packet_info(mbuf, mbuf->buf_addr); + dpaa_display_frame_info(fd, fq[0]->fqid, true); } } @@ -532,7 +559,6 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, for (i = 0; i < num_bufs; i++) { fd = &dqrr[i]->fd; dpaa_intf = fq[0]->dpaa_intf; - format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; if (unlikely(format == qm_fd_sg)) { @@ -555,6 +581,7 @@ dpaa_rx_cb(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); dpaa_eth_packet_info(mbuf, mbuf->buf_addr); + dpaa_display_frame_info(fd, fq[0]->fqid, true); } } @@ -653,6 +680,50 @@ dpaa_rx_cb_atomic(void *event, return qman_cb_dqrr_defer; } +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER +static inline void dpaa_eth_err_queue(struct dpaa_if *dpaa_intf) +{ + struct rte_mbuf *mbuf; + struct qman_fq *debug_fq; + int ret, i; + struct qm_dqrr_entry *dq; + struct qm_fd *fd; + + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + ret = rte_dpaa_portal_init((void *)0); + if (ret) { + DPAA_PMD_ERR("Failure in affining portal"); + return; + } + } + for (i = 0; i <= DPAA_DEBUG_FQ_TX_ERROR; i++) { + debug_fq = &dpaa_intf->debug_queues[i]; + ret = qman_set_vdq(debug_fq, 4, QM_VDQCR_EXACT); + if (ret) + return; + + do { + dq = qman_dequeue(debug_fq); + if (!dq) + continue; + fd = &dq->fd; + if (i == DPAA_DEBUG_FQ_RX_ERROR) + DPAA_PMD_ERR("RX ERROR status: 0x%08x", + fd->status); + else + DPAA_PMD_ERR("TX ERROR status: 0x%08x", + fd->status); + dpaa_display_frame_info(fd, debug_fq->fqid, + i == DPAA_DEBUG_FQ_RX_ERROR); + + mbuf = dpaa_eth_fd_to_mbuf(fd, dpaa_intf->ifid); + rte_pktmbuf_free(mbuf); + qman_dqrr_consume(debug_fq, dq); + } while (debug_fq->flags & QMAN_FQ_STATE_VDQCR); + } +} +#endif + uint16_t dpaa_eth_queue_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) @@ -667,6 +738,11 @@ uint16_t dpaa_eth_queue_rx(void *q, rte_eal_process_type() == RTE_PROC_SECONDARY)) rte_dpaa_bpid_info = fq->bp_array; +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + if (fq->fqid == ((struct dpaa_if *)fq->dpaa_intf)->rx_queues[0].fqid) + dpaa_eth_err_queue((struct dpaa_if *)fq->dpaa_intf); +#endif + if (likely(fq->is_static)) return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); @@ -699,6 +775,7 @@ uint16_t dpaa_eth_queue_rx(void *q, if (!dq) continue; bufs[num_rx++] = dpaa_eth_fd_to_mbuf(&dq->fd, ifid); + dpaa_display_frame_info(&dq->fd, fq->fqid, true); qman_dqrr_consume(fq, dq); } while (fq->flags & QMAN_FQ_STATE_VDQCR); From patchwork Fri Sep 11 08:35:17 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: 77365 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 C5816A04B5; Fri, 11 Sep 2020 10:36:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 20BA41C12F; Fri, 11 Sep 2020 10:35:46 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40089.outbound.protection.outlook.com [40.107.4.89]) by dpdk.org (Postfix) with ESMTP id D50091C127 for ; Fri, 11 Sep 2020 10:35:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ibXW8optRCx9i0zBM7RwyXTexiYAxfF6BHMeVN9jIvXB4ASXh4vOmW1Nbmzm0bpOUli0l0nOHVRwatSJVh341Cm2hywhsxvFgvCTkg8hEbQFXxVwcT9Uj3vs2ZwN+E6C+LX+vxd3FVvoBts6yh5txXMfY2VEGoXkx7exNN6jhwHueEF4/STRBmXQ6ffbCPLHN6tU1X1CQWZkGgd9nvNbxIvDsgoNySV/qzBSJa8rKV2D3rtBqTOQ7RipxvbV8j+7Ttda2R/3EqDMtYePL2SMGscJ+FXy8rEv/f8gvC2i7ObejShyN8SB8EPQ/3kI2rIT3Ukt8Jt5IPBLiTlyqfzD8w== 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=3Cf2KdczS47AmK2C+cPdrWt/BAjle/lyH8EmRwcMSUs=; b=frE312bFWwzRjIMnL1ac85RtvN8yAYHXdjZaxVpXv7C8lq/zBIjZ869ewCWoiXsbsRKkAIF/mk6L1l/SRpq7if8S+rAUW6mKcmRGHQyO9BMENrSudXNn3OrRwQdZD2gDZ4uhm8rvzky1BMniPuw+rVJ0Hljdmr6P8Hc3TKUF0hA2QL1Nm5LQESiprKxQpFHm49lu3FIFKyWlw4ZJN/jF/cytR42IsoaOhzSVrmGVmc5dyeFsGFswJVo0/M1xpw6o03CwgoZYNFKTKHuOBN+RpPFWBk113kThDwEZAo/Gt7Lz71RGaL0cwM7Hhu4qxmPQ/6c0dGmMJdSPo+XH+VCLLg== 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=3Cf2KdczS47AmK2C+cPdrWt/BAjle/lyH8EmRwcMSUs=; b=QYobpPCAyUAAXwzXs7EmHTo2IMY/PdIu9EdFQhIzMCb83SRYlDU4LXZDzkn8qT/Iu6jPM9/aBLNdAUg6ws7l6GCTFSmd4v8RcbushquxBNzXZsOyCGGwM/SZCIsl1J5AyzKm0z5uXFBPFIjQp+ngH4q3aAJcRm7n9JTXxMiryTo= 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:43 +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:43 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 14:05:17 +0530 Message-Id: <20200911083520.24020-6-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:41 +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: 8be9303f-25d2-4897-61d4-08d8562dab8b 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:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2fhhNgYRNK468D0pe3B9KLajAYa6PN6wB1d/XkcW4xKb+EqiC8VguRykbXq4Uwk2z+yqU0GMbQjP5FFg6laGF4oSzYlmr38Nl9uSqisDXbPzZV8nbiC54Hk5xXpT3OuIzDu7rhlXen0S3Ly6vmlgF5TAy7oqlTcvhn4HqRwOll0ph5yyOz3ZGnvrd2kBmqVbiX2s0oZ8cUQWqRHD8SSxB6roq5HEsKO54V6Hgm1LO0OHcRnAJ7d5tbw+qdB+inA0kpzNssPN13Yk5qC+EffgQvb0vuEYFc4pNganBLLPcVYCDWMcQURRHyb9i8sEWrga0LAAu5WYFivKXNDzUYd3SJ9ZY0C272A9rzuGbxhnxCzF69ieyxhuCxMrf2xiD50A 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)(4744005)(55236004)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3DdH7sZwzWG9fKNpMAvHYgJWhURBO2Ms+LOWkztCYDkOWXVGALgAL4S9kjgd8iZyns51MdnbTRckdrTf1GkD/josaGQUQHBgoGoEVLSsDAcYH4/OQapuV/Tw0LbZwtswiQ8Vbq3jIMPH8gXIk5mlvDVg3WJfVXv8r69qPIhDzPorAksGjZoQJ0kgS1pBE70Uemz5YvlcMRHvDT8K9ROa3UMT4esrx2/FpyUYcg1egIEuLUcU2Lp6hI4pzwW7vi6bcxVdDvwgUXR33LGYSKN21W4EDuqOF+e6zfHCJrd9fR2w/RU3A9VkzXce58KfzfsSfTPDeuHsj4bst1MiRb3WkuS1cfsBivpoutAfz07GeOAdtX3qSdh/bnOCjH2wR/WmVo2cTc5/e6D7pmbk1KXWWWi7f/eJdlQT/09eQWvkXsSBJKAvPWQe4hVlfajr/dGP5lm8hURWtjw5daw454Qc9xRFH74AzkPUNLzZrUBBRGjLuOyQazg076Cl9aeHjpmA3eKqHvFA51DgwhYPJshRd8TrcPhVxRqS2vZJGKU2y632UyMBh9im0Vi+EqLfp/11MG3tIQTo6EI9eusKO8FPzmxm/9vgeEW1qt2uI4Y3tSXDbSud8aG607U1LvB7Vrr6tXJSEuK0iWQR2dskrMI9sw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8be9303f-25d2-4897-61d4-08d8562dab8b 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:43.0257 (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: 7nfCebWmfKKEhARtn9N3Xk12xwwSN8SPy6Wdl4ZN2aWBcj2E53Gcep7c7bxQRXB6y11OmXnzlNr+l7H3s9358Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 5/8] bus/fslmc: fix usage of dpio blocklist flag 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: Sachin Saxena DPIO object shouldn't be reserved if it is mentioned in blocklist. Exiting code is not setting the correct flag when such object is found. Fixes: c904a212646a ("bus/fslmc: run secondary debug app without blocklist devices") Signed-off-by: Sachin Saxena --- drivers/bus/fslmc/fslmc_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 6dd797632..83df83373 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -816,7 +816,7 @@ fslmc_vfio_process_group(void) dpio_count++; if (dev->device.devargs && dev->device.devargs->policy == RTE_DEV_BLACKLISTED) - is_dpmcp_in_blocklist = true; + is_dpio_in_blocklist = true; } } From patchwork Fri Sep 11 08:35:18 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: 77366 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 81D48A04B5; Fri, 11 Sep 2020 10:36:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 66F991C123; Fri, 11 Sep 2020 10:35:47 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40057.outbound.protection.outlook.com [40.107.4.57]) by dpdk.org (Postfix) with ESMTP id D798B1C12B for ; Fri, 11 Sep 2020 10:35:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eDp23f47YyxlKM4KWu8up+vX/9ON/YQCXNh+6t4xvrFW1RamG5TWIN/xyCYxQkIZVPdteTJ98IKIGsiMRSxoWazUhgkY9s1wjINxUYKun8rt/k3CnhpuIhIyeWjwK3ntTgEOUa8pdjafpuJvUBpPFXhQ8CQhPwMD7KoEWXKyyvQ0Sk1RAaCXsAtEebLjtEn0BE/hWeKjRdBp3OtJ/ipTCkDuUS3reTV8vv2ZYXY1KIkVYr09cTfL34D/KtpY54i5PYnP+hDaK66NQoRlPMG9NPXXjb9LMXRSzu100hPod/eJSu3MRBzMrSOfWG7H8iE5wha12NMNkX0AgA7VGhIxeg== 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=d1yFhLjkKclDELl0WoGehJkqe8y7gKlPUPlGYPhZsqc=; b=FId2gv7svlO+EA2k/m6KcIxzVAPm7GGc0SS3Bz/zVTWlO4Cwx1K6/LJn0si0KWYIssSVM0dm/h6FXDaiZIvc4bRE7kWRG5hc3BRzPxTqGRS4SxNMqb6QNQzLzXTqJvyb/HyFFcsMQlGp1c+Vjsa1qJXPqOiqaHHwUvgIIplido4JwBF0CqB/zj3p0Xfu/mCsRG7ymREyLDHgAiDOfvJcPu79JGUnOWg7N5G6ZM9tWIpDxstG0gDX94VybdMo+etmLEu1Dkp9SQhZn7S7cGlnPBxYG2O9OetbmHpLlT6OQwH/fc8yPnLGdMkU2s2iz5zSoaP0kZE5J5S1hkyjAOrORw== 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=d1yFhLjkKclDELl0WoGehJkqe8y7gKlPUPlGYPhZsqc=; b=WoYUcQ2Beiwh2wFRPsE2N4wrYhbi5lWcs7Kz7NaR25jj0LuHQKV+l3EI6DkMgfIHNJBfXCJGX6lhne1M9gjZobZ5sjGcihOM9uU/tY6crfcWrzM11dETnnQ7TXDLIcAuHlPxtQTbWAUORRhvTnoM+MbCn85vtRc+P5dYWOuOSIQ= 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:45 +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:45 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 14:05:18 +0530 Message-Id: <20200911083520.24020-7-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:43 +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: 954679d5-ff42-4153-1dda-08d8562dacaf 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:127; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HGzqxN11COsdhRr3XHX2gWQhAVHMhJt4EmyTsAwbOuErcDvSBRUArlPIjoXs1ClhsBpSPAbhS+PqzTXmWtqAbsK3DqTe5NtepZzcWtKiVN+s5gXvr6Vqa5nILlFskdNT4NGpetL30ke4B0VSdlQxbC/Uj6xNppbzNNGxxsD70cFV+ZFZjc+J+ODRHdg/s83OV+1WaQuVdb24feCUEjE/KwY/C34NghjlAEBm9numtxV28YDxr60jepUTPpiachEI+iZhQlpm0zgc4RaAjzfZgm8sdsZmuKPsEWtMz9lJTE6FqYQpwvGF7kM4ZMFGuZN7htLFgw8wL3AZvL7lJJogwS+RsYj+g1oLkaxRnPNEhRlp0MKnN8x+aoPnh7DHFOAC 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)(30864003)(8676002)(2616005)(956004)(6512007)(16526019)(186003)(6486002)(1006002)(6666004)(26005)(6506007)(478600001)(55236004)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fRmyB/JdRMdPcxb28x78R7drgQm4yo11gevO7RH7lSdT25+wFle8D52DsGFrXreDVFpv9zWw3TlemVbStPT1KXN65xc/ubQWLDB7BT8FQbOoEOlLey3FtViD+XQ0Swls9sUOFkrIryKlLv41reJiqlORvzmRRsCf10ivOTQ0lhOO3bC37dVy7+Ddi417RBFyIKBmC/FKnJkeG+X7zUiVYx5lqRQPKgBEE28hODYtlXCzxgeRFEZhRIpjWzjkwsd3Aa0VOZY7ADuh5iYi7gBqqXgKqMXJcS2HwWiPoDpce527GZje7u3uXRoSkUE2ac1b8m1FrePC+TwuXicw9Ow6s84CbxMLfYiUrEN+LGWOJXJHMUZwTFYFc2Kf19t9AO6P1DSKS+fGJpn2O8VVYt7/4HNoYZgtYQdUs4KgQ7sy72Zz1PmaWfq40B/sWFrWrGFHE+qWJMokWmjhnS4lldDExEDQ9rXYmCSC9ZIT7cxmrTr7pfPp60uA8aYONmMcKW4khagZwa56GXyt7LLik61o0GICjZ+wwJjGnBvaKVhAB02DNS8FLCdBrzyPcXMN/aTasSqf3eBxaGLp0XkELDR9oYBvDqJvRfnCXJ/uKDIn5F7UGuQByBo4K+JuEXxvd76NwgKdK2Z17QFAbp7MUspAaA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 954679d5-ff42-4153-1dda-08d8562dacaf 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:44.8736 (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: 2rA/V04Jhnmh/RUl3HiHAIBgNoR/GnqvRlrBfKBirsJeuqpZj1QvqBhbc9p1zoIGu2Ln83YUQ/SbSkyLyDxuoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6973 Subject: [dpdk-dev] [PATCH v2 6/8] bus/dpaa: enhance link status support 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: Rohit Raj This patch adds support to get/set link speed, duplex and autoneg mode status from/to PHY. Enahnce device capabilities to advertise all supported link speeds according to mac type. Also enables fallback support for get link status api where kernel support is missing. Signed-off-by: Sachin Saxena Signed-off-by: Rohit Raj --- drivers/bus/dpaa/base/qbman/process.c | 123 +++++++++++++++++++--- drivers/bus/dpaa/include/process.h | 34 +++++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 3 + drivers/net/dpaa/dpaa_ethdev.c | 113 ++++++++++++++++---- 4 files changed, 241 insertions(+), 32 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/process.c b/drivers/bus/dpaa/base/qbman/process.c index 6f7e37957..9bc92681c 100644 --- a/drivers/bus/dpaa/base/qbman/process.c +++ b/drivers/bus/dpaa/base/qbman/process.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "process.h" @@ -341,30 +342,78 @@ int dpaa_intr_disable(char *if_name) return 0; } +#define DPAA_IOCTL_GET_IOCTL_VERSION \ + _IOR(DPAA_IOCTL_MAGIC, 0x14, int) + +int dpaa_get_ioctl_version_number(void) +{ + int version_num, ret = check_fd(); + + if (ret) + return ret; + + ret = ioctl(fd, DPAA_IOCTL_GET_IOCTL_VERSION, &version_num); + if (ret) { + if (errno == EINVAL) { + version_num = 1; + } else { + printf("Failed to get ioctl version number\n"); + version_num = -1; + } + } + + return version_num; +} + #define DPAA_IOCTL_GET_LINK_STATUS \ _IOWR(DPAA_IOCTL_MAGIC, 0x10, struct usdpaa_ioctl_link_status_args) -int dpaa_get_link_status(char *if_name) +#define DPAA_IOCTL_GET_LINK_STATUS_OLD \ + _IOWR(DPAA_IOCTL_MAGIC, 0x10, struct usdpaa_ioctl_link_status_args_old) + + +int dpaa_get_link_status(char *if_name, struct rte_eth_link *link) { - int ret = check_fd(); - struct usdpaa_ioctl_link_status_args args; + int ioctl_version, ret = check_fd(); if (ret) return ret; - strcpy(args.if_name, if_name); - args.link_status = 0; + ioctl_version = dpaa_get_ioctl_version_number(); - ret = ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS, &args); - if (ret) { - if (errno == EINVAL) - printf("Failed to get link status: Not Supported\n"); - else + if (ioctl_version == 2) { + struct usdpaa_ioctl_link_status_args args; + + strcpy(args.if_name, if_name); + + ret = ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS, &args); + if (ret) { printf("Failed to get link status\n"); - return ret; + return ret; + } + + link->link_status = args.link_status; + link->link_speed = args.link_speed; + link->link_duplex = args.link_duplex; + link->link_autoneg = args.link_autoneg; + } else { + struct usdpaa_ioctl_link_status_args_old args; + + strcpy(args.if_name, if_name); + + ret = ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS_OLD, &args); + if (ret) { + if (errno == EINVAL) + printf("Get link status: Not Supported\n"); + else + printf("Failed to get link status\n"); + return ret; + } + + link->link_status = args.link_status; } - return args.link_status; + return 0; } #define DPAA_IOCTL_UPDATE_LINK_STATUS \ @@ -393,3 +442,53 @@ int dpaa_update_link_status(char *if_name, int link_status) return 0; } + +#define DPAA_IOCTL_UPDATE_LINK_SPEED \ + _IOW(DPAA_IOCTL_MAGIC, 0x12, struct usdpaa_ioctl_update_link_speed) + +int dpaa_update_link_speed(char *if_name, int link_speed, int link_duplex) +{ + struct usdpaa_ioctl_update_link_speed args; + int ret; + + ret = check_fd(); + if (ret) + return ret; + + strcpy(args.if_name, if_name); + args.link_speed = link_speed; + args.link_duplex = link_duplex; + + ret = ioctl(fd, DPAA_IOCTL_UPDATE_LINK_SPEED, &args); + if (ret) { + if (errno == EINVAL) + printf("Failed to set link speed: Not Supported\n"); + else + printf("Failed to set link speed\n"); + return ret; + } + + return ret; +} + +#define DPAA_IOCTL_RESTART_LINK_AUTONEG \ + _IOW(DPAA_IOCTL_MAGIC, 0x13, char *) + +int dpaa_restart_link_autoneg(char *if_name) +{ + int ret = check_fd(); + + if (ret) + return ret; + + ret = ioctl(fd, DPAA_IOCTL_RESTART_LINK_AUTONEG, &if_name); + if (ret) { + if (errno == EINVAL) + printf("Failed to restart autoneg: Not Supported\n"); + else + printf("Failed to restart autoneg\n"); + return ret; + } + + return ret; +} diff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h index f52ea1635..be52e6f72 100644 --- a/drivers/bus/dpaa/include/process.h +++ b/drivers/bus/dpaa/include/process.h @@ -10,6 +10,7 @@ #define __PROCESS_H #include +#include /* The process device underlies process-wide user/kernel interactions, such as * mapping dma_mem memory and providing accompanying ioctl()s. (This isn't used @@ -86,10 +87,25 @@ int dpaa_intr_enable(char *if_name, int efd); __rte_internal int dpaa_intr_disable(char *if_name); +struct usdpaa_ioctl_link_status_args_old { + /* network device node name */ + char if_name[IF_NAME_MAX_LEN]; + /* link status(ETH_LINK_UP/DOWN) */ + int link_status; +}; + struct usdpaa_ioctl_link_status_args { /* network device node name */ char if_name[IF_NAME_MAX_LEN]; + /* link status(ETH_LINK_UP/DOWN) */ int link_status; + /* link speed (ETH_SPEED_NUM_)*/ + int link_speed; + /* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/ + int link_duplex; + /* link autoneg (ETH_LINK_AUTONEG/FIXED)*/ + int link_autoneg; + }; struct usdpaa_ioctl_update_link_status_args { @@ -99,10 +115,24 @@ struct usdpaa_ioctl_update_link_status_args { int link_status; }; -__rte_internal -int dpaa_get_link_status(char *if_name); +struct usdpaa_ioctl_update_link_speed { + /* network device node name*/ + char if_name[IF_NAME_MAX_LEN]; + /* link speed (ETH_SPEED_NUM_)*/ + int link_speed; + /* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/ + int link_duplex; +}; +__rte_internal +int dpaa_get_link_status(char *if_name, struct rte_eth_link *link); __rte_internal int dpaa_update_link_status(char *if_name, int link_status); +__rte_internal +int dpaa_update_link_speed(char *if_name, int speed, int duplex); +__rte_internal +int dpaa_restart_link_autoneg(char *if_name); +__rte_internal +int dpaa_get_ioctl_version_number(void); #endif /* __PROCESS_H */ diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 5b97b6eb2..26436e9fe 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -8,10 +8,13 @@ INTERNAL { bman_query_free_buffers; bman_release; bman_thread_irq; + dpaa_get_ioctl_version_number; dpaa_get_eth_port_cfg; dpaa_get_qm_channel_caam; dpaa_get_qm_channel_pool; dpaa_get_link_status; + dpaa_restart_link_autoneg; + dpaa_update_link_speed; dpaa_intr_disable; dpaa_intr_enable; dpaa_svr_family; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d5eeb280a..66bb6eb00 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -205,10 +205,12 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) uint64_t rx_offloads = eth_conf->rxmode.offloads; uint64_t tx_offloads = eth_conf->txmode.offloads; struct rte_device *rdev = dev->device; + struct rte_eth_link *link = &dev->data->dev_link; struct rte_dpaa_device *dpaa_dev; struct fman_if *fif = dev->process_private; struct __fman_if *__fif; struct rte_intr_handle *intr_handle; + int speed, duplex; int ret; PMD_INIT_FUNC_TRACE(); @@ -292,6 +294,60 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev) dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC; } } + + /* Wait for link status to get updated */ + if (!link->link_status) + sleep(1); + + /* Configure link only if link is UP*/ + if (link->link_status) { + if (eth_conf->link_speeds == ETH_LINK_SPEED_AUTONEG) { + /* Start autoneg only if link is not in autoneg mode */ + if (!link->link_autoneg) + dpaa_restart_link_autoneg(__fif->node_name); + } else if (eth_conf->link_speeds & ETH_LINK_SPEED_FIXED) { + switch (eth_conf->link_speeds & ~ETH_LINK_SPEED_FIXED) { + case ETH_LINK_SPEED_10M_HD: + speed = ETH_SPEED_NUM_10M; + duplex = ETH_LINK_HALF_DUPLEX; + break; + case ETH_LINK_SPEED_10M: + speed = ETH_SPEED_NUM_10M; + duplex = ETH_LINK_FULL_DUPLEX; + break; + case ETH_LINK_SPEED_100M_HD: + speed = ETH_SPEED_NUM_100M; + duplex = ETH_LINK_HALF_DUPLEX; + break; + case ETH_LINK_SPEED_100M: + speed = ETH_SPEED_NUM_100M; + duplex = ETH_LINK_FULL_DUPLEX; + break; + case ETH_LINK_SPEED_1G: + speed = ETH_SPEED_NUM_1G; + duplex = ETH_LINK_FULL_DUPLEX; + break; + case ETH_LINK_SPEED_2_5G: + speed = ETH_SPEED_NUM_2_5G; + duplex = ETH_LINK_FULL_DUPLEX; + break; + case ETH_LINK_SPEED_10G: + speed = ETH_SPEED_NUM_10G; + duplex = ETH_LINK_FULL_DUPLEX; + break; + default: + speed = ETH_SPEED_NUM_NONE; + duplex = ETH_LINK_FULL_DUPLEX; + break; + } + /* Set link speed */ + dpaa_update_link_speed(__fif->node_name, speed, duplex); + } else { + /* Manual autoneg - custom advertisement speed. */ + printf("Custom Advertisement speeds not supported\n"); + } + } + return 0; } @@ -377,6 +433,7 @@ static void dpaa_eth_dev_close(struct rte_eth_dev *dev) struct rte_device *rdev = dev->device; struct rte_dpaa_device *dpaa_dev; struct rte_intr_handle *intr_handle; + struct rte_eth_link *link = &dev->data->dev_link; PMD_INIT_FUNC_TRACE(); @@ -386,6 +443,10 @@ static void dpaa_eth_dev_close(struct rte_eth_dev *dev) dpaa_eth_dev_stop(dev); + /* Reset link to autoneg */ + if (link->link_status && !link->link_autoneg) + dpaa_restart_link_autoneg(__fif->node_name); + if (intr_handle && intr_handle->fd && dev->data->dev_conf.intr_conf.lsc != 0) { dpaa_intr_disable(__fif->node_name); @@ -446,12 +507,24 @@ static int dpaa_eth_dev_info(struct rte_eth_dev *dev, dev_info->flow_type_rss_offloads = DPAA_RSS_OFFLOAD_ALL; if (fif->mac_type == fman_mac_1g) { - dev_info->speed_capa = ETH_LINK_SPEED_1G; + dev_info->speed_capa = ETH_LINK_SPEED_10M_HD + | ETH_LINK_SPEED_10M + | ETH_LINK_SPEED_100M_HD + | ETH_LINK_SPEED_100M + | ETH_LINK_SPEED_1G; } else if (fif->mac_type == fman_mac_2_5g) { - dev_info->speed_capa = ETH_LINK_SPEED_1G + dev_info->speed_capa = ETH_LINK_SPEED_10M_HD + | ETH_LINK_SPEED_10M + | ETH_LINK_SPEED_100M_HD + | ETH_LINK_SPEED_100M + | ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G; } else if (fif->mac_type == fman_mac_10g) { - dev_info->speed_capa = ETH_LINK_SPEED_1G + dev_info->speed_capa = ETH_LINK_SPEED_10M_HD + | ETH_LINK_SPEED_10M + | ETH_LINK_SPEED_100M_HD + | ETH_LINK_SPEED_100M + | ETH_LINK_SPEED_1G | ETH_LINK_SPEED_2_5G | ETH_LINK_SPEED_10G; } else { @@ -548,31 +621,35 @@ static int dpaa_eth_link_update(struct rte_eth_dev *dev, struct rte_eth_link *link = &dev->data->dev_link; struct fman_if *fif = dev->process_private; struct __fman_if *__fif = container_of(fif, struct __fman_if, __if); - int ret; + int ret, ioctl_version; PMD_INIT_FUNC_TRACE(); - if (fif->mac_type == fman_mac_1g) - link->link_speed = ETH_SPEED_NUM_1G; - else if (fif->mac_type == fman_mac_2_5g) - link->link_speed = ETH_SPEED_NUM_2_5G; - else if (fif->mac_type == fman_mac_10g) - link->link_speed = ETH_SPEED_NUM_10G; - else - DPAA_PMD_ERR("invalid link_speed: %s, %d", - dpaa_intf->name, fif->mac_type); + ioctl_version = dpaa_get_ioctl_version_number(); + if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { - ret = dpaa_get_link_status(__fif->node_name); - if (ret < 0) + ret = dpaa_get_link_status(__fif->node_name, link); + if (ret) return ret; - link->link_status = ret; } else { link->link_status = dpaa_intf->valid; } - link->link_duplex = ETH_LINK_FULL_DUPLEX; - link->link_autoneg = ETH_LINK_AUTONEG; + if (ioctl_version < 2) { + link->link_duplex = ETH_LINK_FULL_DUPLEX; + link->link_autoneg = ETH_LINK_AUTONEG; + + if (fif->mac_type == fman_mac_1g) + link->link_speed = ETH_SPEED_NUM_1G; + else if (fif->mac_type == fman_mac_2_5g) + link->link_speed = ETH_SPEED_NUM_2_5G; + else if (fif->mac_type == fman_mac_10g) + link->link_speed = ETH_SPEED_NUM_10G; + else + DPAA_PMD_ERR("invalid link_speed: %s, %d", + dpaa_intf->name, fif->mac_type); + } DPAA_PMD_INFO("Port %d Link is %s\n", dev->data->port_id, link->link_status ? "Up" : "Down"); 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: 77367 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 D09D4A04B5; Fri, 11 Sep 2020 10:36:46 +0200 (CEST) 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(+) 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: 77368 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 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> 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 /**