From patchwork Fri Sep 11 07:59:04 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: 77345 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 94F53A04B5; Fri, 11 Sep 2020 09:59:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 690741C0CD; Fri, 11 Sep 2020 09:59:30 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70079.outbound.protection.outlook.com [40.107.7.79]) by dpdk.org (Postfix) with ESMTP id 05CEA1C0CA; Fri, 11 Sep 2020 09:59:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJR/IiZM3w/xMNUOmu2tbyM4o+m9U7mI6DiLFYZfunKkHWLQHwr8TWstFMKX4XTwMQD0vEk33HReOzs3Ysqp4wEVxnKaN8HZ1x14q+KZvmLYIHQRqY3wCWMeI+jiNOWo1Ut3qIUpzkj5Uz2W8j0GqoCf22rLXgvTq8rIb5IELiDbqQXvrZY9bDPeizEkKqqQHYFXgj3CT9wMGa+hR7ouIeaAJdj2U0BclV407JsEt/iGp+x2BY2/DlalW8bEk6MNfccpFfe/0epQDZQARlBatfaIjyo4tkLeZgXkz8TwDObbR+WoD1rlvhpr14/WFEqgwZiWbhgZw9t5lrransJsUg== 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=NuYd4N3YRxCpNpIOXXdMk2D8wvk/PTDrPWYfHKcU61/OPuygnUJ0ZsnVWNQ1xUbhyi+2y17osnzBkGoqkReI82lvFhDfPs2Is007vUuZpyLaUEkU6Ozl7FPFyRMyGIjvd6FpVAU3YoyqJCgvtcrEaZ1U7SIM4os2HgvV+HD6++BFKQibcsyi4Ya5i0aQDClsM/KNE217T50w8z9mYYYGm0ryALWyxV1XbHtbGg2ykWGbtmwf2geH8lBahPiB+G6cF21ExbKI7ziSs7yRFTT211UGsAYtG9vXSO5Wf2IFk4Sv7s7EKanJmeajrcxlnn9AQYOMs7gIhrIQNz23n1L5Dg== 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=MGVKHjWXbQ4JVwQ5jHzw8fzIntRT3Qlk8fDHI6CiCr8q52mxU10g7aCAbAtKNUaYN7qAJujuC/f3jpmdkFGnGz9TqGdTt7z7Hat1xwP0/C2dGeiR31u44P/fxxuCPtAxgzvUOgAvxvsYWoQFvl+gY9HtnkmIcvaWn/WyXhbgL+c= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:26 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:26 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Cc: stable@dpdk.org Date: Fri, 11 Sep 2020 13:29:04 +0530 Message-Id: <20200911075911.3214-2-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:25 +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: 9d365387-12d7-47ab-6a17-08d856289a71 X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:370; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X/a7SgOxeHtIIwzuFhtp9EsM5XZXH7ui44piLOVkDte0GVU1Z3O3mHBE4vUFXs2F2L1Qyb6Myuf1kkfM04TkPujY9k5eezePKlJdVcJafhXVx+mpILuL1KXyBkz2Wyamr5mXmoAiTajoXsmwcIheWTab5iWNn3G0q7muw/s1ut0sJV96Bk9sffOLL6LnH6iYm/py+yvG7hAtAYRysttsVunhG/XLO+ucrfUgnNllxV4bsBvur0woDbbCtJI/bCdZQCrzoNg71KEX9pP97gEDolYYNqRBAqizOsiQylxw2i54Zbp/FcvPI6c+p5GMKGhrPat3foWyhw75S7pJ5eSF2ld3hNtNRw6g+V6RpqWtHNnB10XL827e4hVTwE+u1+El X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(4326008)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mG2FqdbR4KIY/5nYWO+26VGAOPG0lAw01rDj3FLJWuJH6xmMgC1lHLHJcqk1s9z+6h3fqtUaWLeziPPxvi7XnZOoAR/3NLmqoMnMf3lxFRXEsWJ939WaeF3+svXAzuLdsDqYyjS27x1UH8Y0arjLTT/HfULs1Bf9JfpBU7p3hQG0tNQnvWGqATnq/S8Xw5JHrTgnQEtqmKD8OAG19zGB+4lMrhxcjNXZvffr+h1BD4lWFro6wMZCc5DPxNX9YFXYj7sK5qMPc1Hs2xcuwof8JUR6ar/GSujVAB2LPhNazj8F4CeCRWNg8oU2XQhyfVlUWMIF9AT5ITQCDK/ywgp7JKIm1QlZw8ah4nB8PtDBnfqRzaBY1Wl7pUII0NUWG0xUaqL6r053AhKeTsy6zVeCCcyVD4w4IKrNY6+QZtsTmlHU5gZtshyk/BP04qmo1tdczwarMiLp/lqbfkVuEvMhOGjozeqNfOLkKOckd6TNJXODKXR40/0aV47JC5cvn4N1er9pUk05cGFOM5MvRBHLOcqZGjzcJ/PHNtuZgRztsN/wj1D27RoTom9j6LZKFV83pMCe9uV5xTTGVIbTaWDrfeL+BVLyPb4XQea7cZHKqrhRSFwT63O4+q4RyfnmH5PYfH8vTuKO2i9qtRnBer7y3A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d365387-12d7-47ab-6a17-08d856289a71 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:26.7267 (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: 53wN13keS9RhFa53/aGT44SnxT8g9kanPosCkdbny9nJBthvichV/ZffBQxcVS1wf41RrsNE2nSDfjJY6w9REw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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 --- 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 07:59:05 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: 77346 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 53FD7A04B5; Fri, 11 Sep 2020 09:59:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B857D1C0D9; Fri, 11 Sep 2020 09:59:31 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2041.outbound.protection.outlook.com [40.107.20.41]) by dpdk.org (Postfix) with ESMTP id C62921C0CA for ; Fri, 11 Sep 2020 09:59:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JECn08ttsrEUMB6BMQD+pLMu2zopZ2ZVXqtWoeo9nW2oAmYm2FvMXKMML1Vb7f4xqYPvRKoukeIFPIvMode4IzdtYhlqeFlMBbpRA7YMPkz0yzKm8ClHVKQ9dfHyrLNXw6guTeLiPLpzmwOsLZ+HUBt11bHtH5bTp+cpzmwO577EzPYNuWl03U0Yir6l/rwPXGyNFGDONfd/bAMTvRPN1QMbTbbWRjKX1f20dILgjjSrc++ByVthklE2M7QfnxgR+VgD7ORINJRN3x9GxUGmp11Bv0apBxc9IlGiQue3V3bckJy6y74tLWiM2B7hlRfjR5gCKUTRPcotHw6y46Ls/A== 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=DTRk317NzV7Kx+Afg1SW59Cg2+OeJHWiOPDsUMAsGgvDY53Xj8Pyfzuy908mPjzzB4KqYcQuqWc9i51DzWwFJEH+pyhC0F84o0u2PNPp1kFdAIS6nxQyMXtNnWOCv8jQ42AkdzRnwMPBgEHYZ0a4c/jat6TGEGVvfHh2jZdtECasZYX5y8gMh2FUjjT5KRHktJosO0qPm+IClbGIIqHPNe5ti/WN4t/CeZMlSeFP476TySfvFYQYlrOtVRZmKL7ahvYDqLoQneAFbV/lZ4Vz2t68bMAG0ogWNw70F4dP1v8TMYcGP2B5Ocu7W9/qqjZ+xlj3W1i9v3WPcE/9oqW7DQ== 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=lLrKQb+HGxuZNUWtsLhW6Oy//ej1DovpiQHRROcb8xA4WfZ0g14gLLqYJxdfnXh1yni/Nq4CCVPW77KMuOZ9ALbT/nZq4+d9rOLh8QY6e88eT9fyAv/ef9Q4jc3TJB3EzP0zvcB8MOHtYrPdBMcfQoEL2DPCebqAWHQHchMDAeU= 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 VI1PR04MB4878.eurprd04.prod.outlook.com (2603:10a6:803:5b::24) 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 07:59:28 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:28 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Sachin Saxena Date: Fri, 11 Sep 2020 13:29:05 +0530 Message-Id: <20200911075911.3214-3-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:27 +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: bd976fdf-b361-4a9c-5a01-08d856289baa X-MS-TrafficTypeDiagnostic: VI1PR04MB4878: 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: 9IfDUU6Ul7gvSsOtbhvFEBsVf28qepCHr45zaJp1407TIMScQuIgdmkCcwOHLhnYyuBDY8RpYRLFW0GjCO4F55gf3aBd9iwHWnN+FBN8Tbe6/OVTJFFiiYHAqeTbReou002H7TYZ6ccubQb0kgrARhJWFMJM7I+ABGzmR2dancd8VI9MMQypU2pOAlvcZnrEllQtKBI2lr2XcKQTANxey/pyMYwst+0R3HihVDFqa9KjaXxJ5rXaV62hrOahY+K5TVc5vycXooJJDK6k8mkuNK1rrtOkteZ6H7qHbIyNZyzVgYtSfVmOV6HktA3q7l5UDjHgH5oGNqVJmXVgu2RaThTIMdswQgtMYEdbpKJMygI8weEl05goJtcP0stqL75L X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(346002)(366004)(39860400002)(396003)(2906002)(8676002)(66946007)(66476007)(66556008)(956004)(2616005)(5660300002)(6506007)(6512007)(4326008)(52116002)(8936002)(186003)(86362001)(478600001)(16526019)(26005)(1076003)(6666004)(1006002)(83380400001)(316002)(6486002)(55236004)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Xr9/OcfsHY3ma6cQETsNd95oMGOHnBS9mUGJHu08zYSYSfPQcoVL2gMwYeE7cPKLN3lQqYGmaOFMq1zq//DDVQP0rwd3J1GKl8ivvdaJuJCE+KzKjgScB8prWqv34vjVQR63tbsV+juSLUhZ+jmICR51Z7YvxnnAO5tvRyPkjg6wN6aWK5cw13H9Lo2pUK4MoqrU6RS1TBFkNoinkw+FnODOAMZ1iQuZwPyw2QrhgyOT1iJPMJRkhLpiha/0hGZvWYdOEXwwoIoLQkzL6PYqRU+0PPpruvNHbYftDTbFakz0v2+Qlgr1tXXDWDCTMSL0yBd2n2OnYo+04DpnCYG132V3iSThK/aLjw97SrTU9s4cssNpZ+nqlZWgKGngQeRZS5YdILBUxAvedlbqF69aHvS++aWmqB5D7CNchN2fVpAQS50FnYhlBZzbKKn3726nBUcqpArfBBGKopL147XgswQW5+dZY3jhr6XfJPMm3RLnJaGSQYrfedRRutQMcvhYAJyEsM98iIrmjJN8g/jsXxgJHU7lQhg2HnKtVewiH/eJsBn/0WlvCX2IhFKyoXNndWjF8snm0GOwdwyUwvCz0+2jvHl9w5TVCspiuvSG0j9zhOwsnNru89Ibstrw5YlSLF5i49M11wcYU+f5zQjSnw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd976fdf-b361-4a9c-5a01-08d856289baa X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:28.7685 (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: Adv34oBlIh8lU5GdvVDSuwLRH4BLlGNMz8Zu2IaccyOWjHinUmsnw7IDby2z0PGGF7vJZCsByLdrf00P0U5fQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4878 Subject: [dpdk-dev] [PATCH v1 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 07:59:06 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: 77347 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 E5341A04B5; Fri, 11 Sep 2020 09:59:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D1441C0D2; Fri, 11 Sep 2020 09:59:36 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70072.outbound.protection.outlook.com [40.107.7.72]) by dpdk.org (Postfix) with ESMTP id 451601C10A for ; Fri, 11 Sep 2020 09:59:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxU60XTOHl3PUdd0K+340jQj22Buo3t8L03HRm9ziUgJRTlG111qk1VBe3fsepTaBgWMo3cOpKgi0X2LRpONWZYtffohfTJvu52YHjIsMF8psJXO06FEOcPoY8J9xhemBn0NxEoEdDtRT1xK2CHiUlnhlQAPigdTMUTI5t6YlFJYxAniesAJ110sCmAqWmg4OjEVdMcmdll7eUKTJw2ipaJ5AD30zV449ZL828l83IKQkme/fA/RGofxZTYMDD6tkxbPEYOKGQvfYfzzKLoVS/ltRBkPzi2RzgYgMq0nCrBG359XrKuQgy1QNB8bX5xr2Hulq+c8JGTV0HFwbsg/oQ== 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=gmF4xNLH3K4rI1NWlqa33aoveaz0aiiboyQgnyZDfEXvdnH/JNOlQRIPhIvsjXeXFu+0R161c13FnIYfC6u2CykSUXHKor4zD0xqOEtI1p13UOnUiUdBWRWR50p3yZ8M48nq3eWUgPwBwNhumRYaRT8xN3QVZlbH4eQh+8bhiOeKB+xVCeWhF5Fk2CsaOumfehoc2YViZP073P9jQnjPTkbCpkaZuKz0Whtt8nKL+3hYvScvxAIDoaR4xrUT4vP2eNQvl7RJTnUYjT0/142v9Dz3hpTNOajfkCVvytT+xFQnnMYi5ERNGHNF/ru5EcYYX7njARGj64F0Fz9qQS4lwg== 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=KTR0w/afm4QQensLLE2yRZpuFJ2+lNoVw3hYhTwTSLF8Ta/Rlkg/e7fzqASpdhlt8yGQpkX+AyN95mbBxxOmB7mTGWeQ1KAj1mGRGn4jElK/bRPPx9nVPFBi/TRsUbCiaqQUcHLky+tm1cW5LOWAtpSVAf38p4soN472mamnSEM= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:30 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:30 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:06 +0530 Message-Id: <20200911075911.3214-4-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:29 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c92ba1f7-f6d0-4a59-1cdc-08d856289cba X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X5DCCtZisqlKGMGp3kQwi9tQEglrUF86PiTeAIq8JpcSFkHCNkGlU/Jo2PbCNcjyu2Vs1K8H0fZtvzfDY3ZELTYEC9oI2/ZFp/Wk3hJkSG9qbaY9MgRJiKFeijIiGqh6LbPFTdeWQGJEEW9bCgHzn2Vh/h0VeoQrV2VooglxrOOpJCUBSJiMAq5q4iONv8zV/hCURQqz8K3XyHtRxDQxgQ4wTx8kz1ztcxMqupACYe+3HVLuPK0p7La54xX3cxutdxEzdboY0AXfHpuA9Aj6kh2rJV+e+lHQ02pmHlLHFizm7V9/D42klbo6EkfYdoVZp5Nd/SCVqi64MeWmveKFWjFIFXlbKJQEVDFkUo5z1n4NFilpeP2M67dyxeAHJasv X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(4744005)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: dgiHQrSjmInl12R7REfjQrLodVmwWnUHZD5V+pITROBKGLgXmC/W/00Ngr89i72Y6xLwUlp1K67lSL6/YznUu1QPQy64GWKHDTlH4wd2rnTwJfHMIZqHJlOBU6zbpgxKjs1qX77HHuRwvPlmBc1CraEgSIl5AQXUgV465o1sUbFN0dI3upPEwuKJOrQ7bHlUVKZyTF/OZ0WIsKMbNS57ybzGIMPzj3ekXKb6Rw1kW15WMvsL07ixcXe27m3z1KINWLecrcg0UqlP2kw/eMXbubZr9RBdmWSSQ9zOCkzqklPfJZIZwmuet4cG++4WhUJL9hj17eympzdJsWKXfzQ8AV+qqGaCePhIo7c5DPqZQo18USCJMzX/D+/0PZac+Vil7/bbziYtsCXSffMZlpYj6vs1qgIMiRLc485QeO8G/eKw5WySR80FUNaB5NV4oRuXlNG/TzBZxBp32uQl2pBXYuxd8dkdJXa4K/bdOUhIY0MJcyAD5H1ZHAwNO8LdjK4pLdAo8p/gJ5qkv9T412F0OG5b3nyxTC/DzqqcoHMe/+CuGTLVEG1L78fMxp85xdMz8Z0RexZk+tJYZEMzt1ANto3b8W7U3g5/sWEi7fEfAeykBGiea5MFKwmJkuT6BmYRDZuea6ZjjF+b/ACm89u+ag== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c92ba1f7-f6d0-4a59-1cdc-08d856289cba X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:30.7225 (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: rO8Hm7y1nlDkObxU9ubMU5C85zADZqX0ZrYj/spT0Nvnd/b1p1JV173LTDjeSoDtpXT99togbqV+yhNIJfE7Vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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 --- 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 07:59:07 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: 77348 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 13E55A04B6; Fri, 11 Sep 2020 10:00:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B8241C119; Fri, 11 Sep 2020 09:59:37 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70077.outbound.protection.outlook.com [40.107.7.77]) by dpdk.org (Postfix) with ESMTP id A30201C0D2 for ; Fri, 11 Sep 2020 09:59:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O2pb2aIulFf6zB1Xn8Pkhr2d2tJQ574jJRIBEC9bkoFrrnAmqVGweEXZPoCHU0JT52TkLKOjKyO7NoYZUoxku2QAuoxn5fj6dS7BE+zCNpIaqp8JoxIcM3FOY03Mv9eGaNY2O3dkhsBSSFHzyz92OkBk/iZkBaVcRHX4ycaBV+UovTsNqd3Bj36G8paby93YTJNxp8F16KT8eMyGgkMi54yZC0LxT4UIR+6qJz9KvgxXwoH4ylt6WN/TS9KKUMQnXiHILMWcm3D0gmaIyB5y8mzKDsvd0Bqc+s9klVxR2gFf/8LdlpCYJ0XIbUwpfpqvbfRIz+IZ4MQAgy83DaxyxA== 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=H16RTYEe1HdMpF/1yX6MDO3nns/vJ0Cy1o98n4VUVM8=; b=Ks5xFJZyL4rk2E1nJH+xTwKLqtDsrgXy9guaPk3I9kpgsja3dLLyxiWXOhn/0b348fWgTSo2SeJg+xaG8wxqfK3qmsBch7SkHMcdmUnNQg+mvxvTZKtedlsR1oRU6Kvnp4c8BGKPBOzt/wZVWdqYWoCPS0YkTnf0GYHjinTdzbDtg0QWbm4Hf0E1WZG2QQAZSbUbNz2yziLpLR/LpPmiJOqoeZ3xLtPR153KSsjtV/+rrdLRjuqok+TfELVFg5CvTWwE6Ftauz3L3P2ZMwTAVrA6Njoe2/b1idhmuXQMVDFSr5uyDeQQrVsV0YJmGBlgnaXrHLrBPmMHTl5OrWMnig== 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=H16RTYEe1HdMpF/1yX6MDO3nns/vJ0Cy1o98n4VUVM8=; b=jXLHjA4Fu7tPue5PdePaRWpbbCLmcaAc4hqtyVdoP20k49pwDWm6Ngmb12K8YK6mgL7mtYmRTArclH/NsRTOej/8zOTVrViXWMZTRSM/x9g/V42LFFGEAzdG0xh2UkphpOnH3u5Eownw+8ortjRCvv+8hyZpZbsNjJvwt8DMPKE= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:32 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:32 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:07 +0530 Message-Id: <20200911075911.3214-5-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:31 +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: ab1af4df-7547-4a11-68d7-08d856289de4 X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:389; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KENUu3W+NBQMahAyxyqaNLYxdB78FrwUAwROxuaXzPshqOK5Bjz4NgRK6TXMI5RgaBgcobtXvkBCFR/mzP/iF8o/2Bnh+EDLGMmv4UwiOk2Y80yyw9zcPqhpZ7bhfl//Cn4th7t+Rp+CZ98PnWkw8Gj95VCG9SaigQpVmv1BpKwewOOUOrFLfHo3YPqSYqgtlExjjtzTSevk4ZotKddeeq6E5WF7Pe5U3Z976ehDuHvpBRECoWa5+ITeni+BWkOLiYBVfdpYnajIJnGS/GwlzyEptlexdVKa6daLxYmbanuIu8yf6oXoxdd+9rpr4EM6g6KnRfDiYCeEHKWst7Y+Q9O02urTDHHnG+PKUrK7qJUW892lsS1Td/N3lYrUK/rm X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: L/pnX4ivAyDiaZ+9wCqu5jdOZYYQ7fzX6xnq+u/XUtxH0SxduJR2clmwUY0/Ed2YemA7nxzLLVqSm1S0NGR46UnZCIdbk1SgZGj0NVJb8g4RZg97EM9VIlc2v1ofexqyLcVHTWpG6sU9cE/eQZ4wx0+Qm6+0XT0j1/ssb/m4QADpHUaygDUp4nfw3cjq8gSSobXf0JQR1g0dzMY2q0dQIjbCs0OlhqbH8htyrpsUW7wrA4QMQQKoZz7+6X/z9ElOvDGnvZQGxp2UCXEyNt9Ib6NBvn47Ar2uZW8lxQA5dpHgWbOkvExGx9sAsIM4VhzG+EGuVPKsfQdpDHrJIN2tXHojBSwi1nITDeIZr5Rq7gsuJ6Tg9RJim31JgCQboU0oARdTmqyAdeVCGLQO366wUnc5ykqgzIPOftr1SUfTybA5zNDHVo2LQwiILE3WO5mBgitCvJldm09hKSRfzcLV5s5JJncSbbfaTok5462FLqny0UUksnvhiAAeEfNOE8cTas6rGX/lWnURTRpyNmIGD4sjydOd+mGG9YSRmdalpvDRmiWIQwZqdY3EaCtOkKKQS57W8JY8dgBjnPrsbeBcHmyQIzEkOfYOugM5+miJR6JSjUOtqFVDKPPfLE+LGXYaqFhlwAzLiphbaYOqa8vQMg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab1af4df-7547-4a11-68d7-08d856289de4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:32.4965 (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: b4ax6sntCHe6jIyro9aI5ibQLDGJEq2WbjC721WmTNeWcT3ZeI14fRs7vS1omvb+JfX88mD1nw1McOB0Y0ojXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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 | 18 +++- drivers/net/dpaa/dpaa_rxtx.c | 108 +++++++++++++++++++--- 6 files changed, 135 insertions(+), 17 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..ccf0bf1e8 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[ + 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[ + 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..9715f3ce8 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; + } - 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, + format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> + DPAA_FD_FORMAT_SHIFT; + + DISPLAY_PRINT( + "fqid %d bpid %d addr 0x%lx, format %d off %d, len %d stat 0x%x\r\n", + fqid, fd->bpid, (unsigned long)fd->addr, fd->format, 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"); + } - ptr = (char *)rte_dpaa_mem_ptov(fd->addr); + if (unlikely(format == qm_fd_sg)) { + /*TBD:S/G display: to be implemented*/ + return; + } + + 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,51 @@ 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 +739,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 +776,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 07:59:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sachin Saxena (OSS)" X-Patchwork-Id: 77349 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 9B2DCA04B5; Fri, 11 Sep 2020 10:00:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2EF091C122; Fri, 11 Sep 2020 09:59:39 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10079.outbound.protection.outlook.com [40.107.1.79]) by dpdk.org (Postfix) with ESMTP id 8A5B31C0D2 for ; Fri, 11 Sep 2020 09:59:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kYzcpJf+HaSbTpkKK5PMLrvnL0cuZznD13n6v4+Y8NLZGjW005IHsYiowFzyIfIW2LGALYmcSUmYpIUhzN/ShFQ6Djx+J/Id8gYeU2u1inNb0nawcbFmx8MAapbBxet+WAr582IFAJK6YbqOT6wzKWhejuExsC/L00dKbAR1g9jioVwCHUtN7oCqRohtIiz1pVQy71gFfq9o14NBFTSYVJLi9XW3FzpZbvfHD4oP6Yf+5mx/8yXw3iksHEsxSidW3L+HfBNiyd7o5LpivI7UmK6GDd/H7QfjZRjTlvV2Y5w3ce7VkmR5TGIUB/MMpl3PVoBStcbvkIw1hoWz0W2QDA== 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=MG5L5V7zT6BNrQP4uF8vYaKfcXeA03k+9IqgS+MphRfQBqC6TNH3K48K3RuJRWTswy5FJupUaRsquJmBbR9TrlYCiznOvftdDltidxUmS8Ck0LYh7LaDKJ+3FYa2OliadLFzaTtAe/3BHyWW+M9gjKJAG2B15XfBUKHshpv/fI3sZNZo+A1K0l19KMx07YaD2beKaDSLmcF53DjqMWgezJI0IZt5m66j7/L77ncZIaBF7ZoWCOlTm1lxhNPJbYKIsjk9c4mHkgbGiHyGoaN2u0bWAnRmgBdMlNYawY+4R4j22EemGC0+xOzAb7puQPJK4jqMwBcRZDcdLCJ4L3j8vQ== 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=aktbVHHYSySgiejB392ZGj6xK/wcSX+fsRgsBR8MXNXwOmMIQhwoEmbAu9wwtB1iJDmN+JJczdOgmn/ErjZfsEGACeSGIWXpLKiM5NqXDUFc/DInyQ++IWGmd5KrY1kzx1NVo0FDVkf/WxcuPJKC7tsnhADIlRttg5bZV/GCWvo= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:34 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:34 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:08 +0530 Message-Id: <20200911075911.3214-6-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:32 +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: 90fc76e9-5b82-4c5d-6880-08d856289ef3 X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lie4ZCNm+XwYaZUEsV4uIwlt7xAdb7F424Gap3GFPfhqupekNLYQja5fJyS69mK/J2W/L4fGUBR+3NpRtvyqwtKH28w1/Vuou79oKbip4Ab1goZ6kb0/QZsxRlk72tiH7aKH9I7NJ/+ljeqzTw6IA3WuAhAbMzheu5p+obECv+5nMR8gGB9ibo/zvDiQIa/xdA2NhugHTvelAIx3dGpFi97rn9zBLEqGfRM+/ckO4ks1ArJbhg6qY5xdcrwfxEvoj/VqIs9zd0lBNv286I9aM0i5IkEwZ7uMf99ofY+kloyTeG8GhWo6sK+BJvkHHEy4DaOPSFU/osb/H2STRxGcKGTcNu7RgiUyscd0Yj6BP6MZbnMsyP3oVukbcCHBhhUS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(4744005)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tF9ALRMn0QiwBhiTx5qFSS3Qa6URsrIzFjPL9XjHaEBbniS15VDYC7E3Kt8lEzK2oRsX1lmKE+zjLFgqGETHRQq70I1q/RcTyESIGRlWc5zOCI8HjO6PiP03UKnB/BauxzAyoUrrLjBBIGHcYc5NTCaZsZr/pNXUlaLwPb7902tibucVhD9Z/RaPmI/ckLgUhf4qMW7ncq1hsfFUgD8U3OdrNOq8U+To8QDV02j1ajz28auHkLfKQBoqLL+5jnoFnUB1m37EyquIGpYY+UtYnStytBCKHMsLbEE2eQxXtUiByR4IX2oMt49qUBaFmtVsfgAqgN1z4XUIVdUW6PQRjZKHZo8FKfvTWYRzByVgjAKsRXJjoc7mVCv41l+/QtahJhGNL9sRp8VEPa3ZNErpnO40VeqF4j1bxnUVI7OXGph1SCAIKHRabamAhqzoLb+7VBA/ejhzyWU/KEo8nQRtn+Nb4y9ioSX05fepO/hHrVHdkkzp4+Vh0+qZQRairPJp75yesnFBSJOp1/w/hw5Y+IbLr3c5ywI0pMI/0afHcxRWC3PMH63nCS6l0WC7W9aWXGbQCLZXdl4szLUmv9CHzSlRLH9Od3Wp/yCACAis4CyfA3+U+NxKRSvAOCb2bLouFu7N2Yw/E+Zg32sc0BcH6A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90fc76e9-5b82-4c5d-6880-08d856289ef3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:34.5224 (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: zRxovrvSkn8di1sDURdYfrI1ewrGSVndWRFtLOQ7drITYyPTtd7sLXlGaW/Zzt4c8u+ODN+Yv+ICPTZQ9MWDYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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 07:59:09 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: 77350 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 49602A04B5; Fri, 11 Sep 2020 10:00:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E53891C124; Fri, 11 Sep 2020 09:59:40 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10043.outbound.protection.outlook.com [40.107.1.43]) by dpdk.org (Postfix) with ESMTP id EDA311C10C for ; Fri, 11 Sep 2020 09:59:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uk0H/Dva8R9KtJlOLEje6ZHhC1HYqhScdBDvjhDGJDE2Ym1n8zS2QUMxm70050gOB0cn4foHZrB0WyRrENjnf/HDNEnkZe2ODQ36KfmXNHfZRHpxZww9QpPOFcyI+eRR81vhVGCFiNpK3ekQ9Y7SbMFYrK37hTpZlLxqPgy0OVylQHFoqr6TAaV42RIGTag6CqhElxsI7zX42FvF+9yP4BE/8JXRmIwzZmXlzLYfLJQsfiRDVq1tudpwKN4Ia1cZgubkP8lrzvYiJXUN7NnKX9eipl14Fl75jqY8/ka8Oz9QEq5CcH7yeIkcUr2TGHrItHP8pTkuahhbCleZ3dycbA== 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=sPCTFmX+RLoyQ4zdBOg/zqm0vya0e8nHxMfnVHBTPC8=; b=g3nMt1CRdE73eYO/QEA4RY/0kGY8+R4/NlBuu0MSEUw60NsCP0uxjwDEDPLTv5dKdIq6KxBeUQW3/SYUjUvSSAvXZzHb1DIt7wELX5IY3q4XwxbWoLxenXRQV1VjBddubQr8N1Hc0LsKl5rYsAb9Z/oDDQle+2T3HMsk67KCgyvHJXCO6Csn4sNrnE9ZZ/5LVTFXb9zJDaaMOQJMnwJe742DikqUa9jtfFKbWOjeQNnKoWaksXdJLCVxvrcyGQqr8gNyruCAH4sQvJatLF1xUrAkA9l1EoJdxedbTLE1M/DAi8g6JjtngPJl/FFp4VOQxIp9EUm2dHqLj9I8rQOQxQ== 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=sPCTFmX+RLoyQ4zdBOg/zqm0vya0e8nHxMfnVHBTPC8=; b=hPKP1uupqkvv5clc2k2OjtfcsyaR/P4NW8sKIa7VS9PzF0zZKEdEFT2XXnMGYf7KQEW7qPe4aQ3lI/rJ8EZ4yiCMH9H6oqFVLMT0WQRrG2QKjk7AXceus1Aat0531lPznDL6ZAPFXbeoOlG4uIolvwO4jwcatOu289J0Iz6ucjY= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:36 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:36 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:09 +0530 Message-Id: <20200911075911.3214-7-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:34 +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: bc47d3f6-b036-47cc-9539-08d85628a02b X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:127; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BXwbR7lzAdjVmQWCwXGlVEYkZ+IxEhBezemEx3e+px1IWEjnHBw3vd6JTTRbMyBIkbJVekX3jUCUDLlu0MM6VOYwvNsMYFPTj/BfwheXmNnIocfDQJQkkGJnhHxncvjLXXnTjfErK3LdUwxGL0Wn/Ww2zvCVhq7GHaLalkHCKEoQr5YHT7xK0U+zk0RYVu7fop7VUvZ4Oiy/X/PAjuZmwj/GxoMznWbnjaLtzMN/1G2CbXvyrRYi6BOdthx0vZQZu8dgGPWNQpRtObPhWiQL9pxH9sNb2TxpYe/UE3wp5k1zqradHIKrGWZc4XerKwsPDMplUv/7aMiARVxb8At/8pnwYUU3QsGjBBdsaPIITfErqx9CY75Yf/4B8nZ23i1M X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(30864003)(1076003)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: O8goFIpaXCnFeYM7e2XuVVNu2yZbMrvPa/WvCKx6lC0hHScR2Orbhvd+XH5cfZvEsroAwglyzmpq8TeL4HH6LVV2y9ldsYWpsq7CsOVbWUilLbJtRX+Wq5oYL3jTkslIz7VtctlLSFSrw8L9t0EgAqSaPsZ00YEEq9ukzrmxQq0aDlLSNsWB0YVksvyGSwNzeo2bVJKvhL/ANdSN/v9p2D0lj5rBZ+ZnhBWwE9+/Py1DQnKUyvkN0xuFP4oS3C/PogcYTa9ZRqC10Taj4ZtoGjmJSQCLIYFl0vs811K5XcFrTP1HKWv6ijtDsPug9MLEy/7zBI+g0CGBWfEtGIuv0e+r7/CfN3dS4HIcwMrTq68qhhl60U5AC3KhuTKo0wBYJW3SlGwHZbz3lCkJjSHu/HnMp9xX8mwGXWFzZi1811U50O2ObWqYD+/JoPYT2H4dmVIM14zbCjcy7xvhXzrS0touZNywXx05g3pJIjGXNSashi35d6uoo0TfI3taZL/JL+QYHR28rIlfxPwbnJk+P7a0sDeS4hUfags6JBK7WPd545eA5sCnBXxuf1SDyVF7pNuShdYXwS6v7dj4gKcbChYES/E7jVoUCtWMVqghSYqIxNmUrA3bNwzxi/d3HZb9wtTKkj+Ogud4rTiAIn4i0A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc47d3f6-b036-47cc-9539-08d85628a02b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:36.3364 (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: KjvQgPCYu1i7QYOhalZYr5zXyP6xB9KUE1TPINcEDY0ghugPtznBHylkGzqst7uJwqq0wk6Z56tP4Aw/tc7+/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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 mssing. 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 ccf0bf1e8..0c76fa610 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 07:59:10 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: 77351 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 D897DA04B5; Fri, 11 Sep 2020 10:00:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 841331C12C; Fri, 11 Sep 2020 09:59:42 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by dpdk.org (Postfix) with ESMTP id BA2E11C124 for ; Fri, 11 Sep 2020 09:59:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mLYKzqfbwJSeIFYlULdA3iJSVHkalGIfk6Ocq8D+u80ZykKQBwpu1gYe3yogxKvGk+0cWtB4hiVgn4xahwYu1W3ylcFj0kijoILqv6YvG2hGNCKOtby2Oc6mkkaTjjT0wGqh1+o6ScglrlSdmRBMgtVWAyXJw+JSVNB35DPuDk0nKn4LrMRz0ImV4rgd6r8c5ACpf88FKsHD0M0TBHkiBZMa8FeXTQRUSiJdY6n/l1NptNGUfqgGRo2JsIHmKTeOczp3cNb0uvNEJp0wVVwO0Y6gneCdWHXsvBBK5qXccXeVXiyUyvCB3gMgTr7cmKronB1IBEffZWKiegeLFBMtRw== 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=bITGqQDtD+OpVJgUHs+uG5Ius02aPJqUOPCyaXKUzcBdXRK0M83F0zS4+WpK6ux/Js610X4S4GOs4FzQl/YpKn60s1TMX85QudnPVWA6yHyeA0KPcjU4NCGV3Rxu2ZbUdTn2vrzd1agpBoLJLR60qMxfakKUBLiwMSaC7//EjXfibPLutxf4ie3j26XNTvy4aaaojZyBG5XpIEfKmu1h8+Dhr9yAxB4BUhU3uqLRQA4akn9hA6ne8eTQzIlcaOgnEShGt99UbuzZytq5tYkBtXq3UE64Fw6E0+BUaaqYy+56DfCUlpiF3yD3BybNamnYqOUlpi+P20MODgz0DNsqpQ== 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=P4xr2m9IHYi3FS+c+OE/k7sNxzpaFLQRO+e9N1S4G29WXzZh0iwcND1qv+Yr1om25gHpfN+HLgLGeJbHd+TMxkaRiUj48sq0ZlhL+hvWLc0DLTjI4lzCdjthPRn2lpx993f5T89v+w1HTW+grLzYyK3mNegKV5zSL3oZ6I81Xe4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:38 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:38 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:10 +0530 Message-Id: <20200911075911.3214-8-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:36 +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: e85c7b46-bbb2-4865-16cd-08d85628a13e X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:177; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gUHE7GfpB49n02xUdrgq4+P1+QKEtBqqhH/REmDyug4/B90+cmv005m2Z7j+UgceH3FJoSdGonFUfMP87QgJEpijRrl0gdffYEieuKS6FnIAMD0jFIpvTpPEimhHrQp7ZBLgkLTnjk1Uly9qZO0qr4jr1taeCA45COCBMrotCW9mCk0f1PsphIkK4qSG4HAItBxOGyxYLf4R2TQdeLqjSwByiIxKP5PwDjZOOQhMzzZKxK5MwBGKqO17IdxdLIjaTVpUhoi+qwg262yvCcR2HwokW/AD+5zgcpSiy6kTdJ1bEZDODRyE/3u/2uPTBb9JAHszHjKScKjqSZR+lUSm0s784rFvE9vvFWGxki+4qNxdN6YbDQ7Zmp0S4+m8YnKq X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(66946007)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6lVOxplShDkOSvwDsZhooQ3uahWitiueu/Z3yeubsoZPdwzASIPytvJpNiP4N+E0GH71+bB94ob70OTfbTp/5HADDChIv2D3T/Le+SPN2Z85M0yoGLgH10HUVn6I7ZRC3Z9EAM8LKBbwCdX+BcYua2y6hO00B1V646AP4PilB+lYn6yc7Xn60DjTcqHfVjwq7SBhP87aIni4vim3yd/4c/RsgqQsAcF0HMUzTRfnJJ1Q2R7YBRJRUD49yn0AyaF8bjDVrRgnV3Xv2c3C6TdYJ2bVTKo1MPm/13EvEKqsgd5jQ7mY/vqSuZ8aGadSPY4iLOvvPfxS7R4J8SBSFA5TNO496FPtk27ZKvygbjxI/WKsFYAQ6sfvjnl1GFrXnsPO4cRmsOZ+1d4foNASC/WhVIGXLzC2N1w3URGBixfpM8p9+ZBbrB7Xt7ZGkpnc7Wj5nq5jfU/H+7RoRt/zXRYMuRzA97WFOX68YRJ1SatPuGdpE1RSoNFYThHljvfRwGe2fcCeBQaLF2Us2gK5uR3uj2StwtQElxJFRSw8Y2wOzDOy1QWq3iaZW945tFfS1s2zu1q0luw0UYiUxyuMBEy/fXKxSVXQLPkbW9ZqdFFBeRg1N4Y7Vg58uCbEMr1N26k6bOGdxjRVYJ7ExYpVJzprtg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e85c7b46-bbb2-4865-16cd-08d85628a13e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:38.2473 (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: KXSbsznHYKCXKCmYdC7YIwD/mpIU4PB4BjJdxaRU+8p55+5+qhRq93R8xGHdYzxAqKvwAlLzNTKhGZLcrrdQEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 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 07:59:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sachin Saxena (OSS)" X-Patchwork-Id: 77352 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 80D30A04B5; Fri, 11 Sep 2020 10:00:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F3331C190; Fri, 11 Sep 2020 09:59:44 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10051.outbound.protection.outlook.com [40.107.1.51]) by dpdk.org (Postfix) with ESMTP id 039281C129 for ; Fri, 11 Sep 2020 09:59:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQF6M6IjQ4p+jCgTeUdsuIMcsE6P8f+E8DebXEuycbDwaLGYCtKmbGJmLTB+ek8J0X4iBPU/Gw9ECcnQfCw7A99REHwrd5tOpGKBlRu5kUbr6uN6AJivokVnTyAXw7h2Go0OEplwT5WHSDPaZsduHWCDscFIULENhDUbhdeiM4CE/5edxITeS+xK0Y6nWZtY1tM3xolnte/FsZcp+bM+sv46o7Wk9+3KTdq0TZXiWLuBB92ZSoUwQtF46N3jhgcIIrUSDkzhw/+oVzg85X9+MdURpFLzuWmJkj99QDyxU4xdQxl8iRccnX/FnqBoTXCFwiq3JptpV3ObNql1dRZQyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LqHS0cxWOzJMvJUvOb7L8cJGVtJiXSTqqrihVyy6BIk=; b=e7aIHxuUoUl3eUUIqhf8DsUwIK37UlrH7Ddeh+DoPIfetKwBoQvIVjQ2Ai0OMBoPaOqkLOqmIlduHV3WNbRpVSou5rtjQCdVNizLpzt0ZnGluFPT5T6MCCPxIVZlEwWXo/StSEfyuXmdPGWImALbR7W/6RR4CZScO12uwd43uzAOtBpKrytuIPirLNF/BQu4gW6MBK9y23KO9E0BvmUcJJzqhQCWChfKzGg0CtVuvRZSYFAJHhH45IK41QBIKBHuU68PDQJE+bRx4Zt1WvKA2dYImqVgWC1hyAs7CsDpiHCWrX/StgtSGDz1IxdYcNu2hjqx24tqcFckfDCZVovwrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LqHS0cxWOzJMvJUvOb7L8cJGVtJiXSTqqrihVyy6BIk=; b=OYI/Y31K+2Q9Ln7wqClvZQjtjI4rrz10wqpFeEShsIuYgst4ABy6YF+jTWrdQiXwYdnfx02W1Tmq/vLgpvwibI9VD6sXEHTdmIBdaKBhCoyqLfeflvH7MaF8vrkss5blOHIjqaPrvEHuGrP5fi65/QcV9C6yjpHRBd76ZA1V75U= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB6094.eurprd04.prod.outlook.com (2603:10a6:803:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Fri, 11 Sep 2020 07:59:40 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 07:59:40 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 11 Sep 2020 13:29:11 +0530 Message-Id: <20200911075911.3214-9-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> References: <20200911075911.3214-1-sachin.saxena@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR06CA0136.apcprd06.prod.outlook.com (2603:1096:1:1f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 07:59:38 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 05f2bd8d-b5b7-44ff-acf4-08d85628a261 X-MS-TrafficTypeDiagnostic: VI1PR04MB6094: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:854; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8lHvAq+hHwoUi2wyRE7xCOCohb+L8hBodWD0F+dk5TZ2i9PVfrJTuZoG9atQUkmK1TzjO16msDszN3uUwAZ+LdINYFrpVwXNR+qJReneSVcOiCDiOhlVRzqcROZZWXpnMYkVLztMP8TmRaGAXyx2P4dzO0iYS/RKY1I1lqq5O02djZlh+0QOUQ8KQh1GwQbFFRYgmRJUXeB/hYaw7zYDqKjJYPNtOWnngyseqm1ILbgMRMhjgEjNyJ2lelnS8U89Iz8j6WETsdNPk/YDAjHvbanYsBmElWHu5WiGolBBP+x5yJ0il8Lap+Uq4DomypIchv776p9Sqyk6pVJ2Pnq5gflMz/nM2QXLLELmQmYqEimQZohyT0sAubDC8LdS4bx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(478600001)(52116002)(2616005)(55236004)(86362001)(6486002)(6506007)(8676002)(316002)(16526019)(8936002)(26005)(186003)(6512007)(2906002)(956004)(5660300002)(66556008)(66476007)(1076003)(66946007)(83380400001)(6666004)(1006002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZJwr7/m+XZ9kPPZA7zHfdBXAxHnkTK7MsDvR9MJI7/DO6cj0SwH9gTAyR40sSDPJDm6mclXTL+eFRSxVFdB7NC+5watLQHSiEv4bSgcT1V77VCvqlBP33GFiLmPlDB63UD0R5pG5m2LnKoOAEYN5lGcjgJg0K8Yfc2EehPzR563GR8FJsUgWjkq7PatWpKX9XD7Xss0LQMH2UjCfeipgBVzu6nqrD9LQqqtymdSVgZHpCSzAqEJheHlc83G0JfRIPChFUQlDQ9+2KUzmapLVf8H1IDhTUy/TsyWix8C48tVQJI9f1kfPvM6AJeYdqh5lEGLcR48Fv2wBw6DL4dMt7aLVjfVZdJieaIXziY6F7AkPOkOt9rktm3LqBKYuum4miysX4V2rmgEoVivlOHfWePrOmEsUygmt13gp3HtEbTPX+p9uwWXxzhsZluUjhk+H2XFPhxcw6w71pRGbW3d7hSisHELGhSlDV1Wjhqy23nMqxQvDCq/i7pvnfrStN5rwlE5z1rHbcd8Zloqj7EoUMVbjb67TGAy8SVvc6W1vLKEvG7wrxcblcwkkUmL2y0AHJ0KgJNlNELrsd8ZkELfU+rZzs0f/bfwuG5Hm2RB6dCqheAQ8/h/zKx20mpmt0lvWmv1Z2QHFj47e8m9hgtQYeg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05f2bd8d-b5b7-44ff-acf4-08d85628a261 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 07:59:40.0303 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VwDfvJDeZpEHYNIhvyeTmOYmvLwLVzkMlptST73D6Qw+v593OOdri+Imq14957Wx3iwKpQ4xYGBCcjkKK4xL1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6094 Subject: [dpdk-dev] [PATCH v1 8/8] net/dpaa: send error packets to application X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nipun Gupta Send error packets to main queue (rx) to make application enable to receive error packets. Signed-off-by: Rohit Raj Signed-off-by: Nipun Gupta --- drivers/net/dpaa/dpaa_ethdev.c | 10 ++++------ drivers/net/dpaa/dpaa_rxtx.c | 17 +++++++++++++---- drivers/net/dpaa/dpaa_rxtx.h | 21 +++++++++++++++++++-- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0c76fa610..d0ac2f987 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1068,7 +1068,8 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, rxq->fqid, ret); } } - + /* Enable main queue to receive error packets also by default */ + fman_if_set_err_fqid(fif, rxq->fqid); return 0; } @@ -2030,13 +2031,10 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) fman_intf->mac_addr.addr_bytes[5]); if (!fman_intf->is_shared_mac) { - /* Disable RX mode */ -#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + /* Configure error packet handling */ fman_if_receive_rx_errors(fman_intf, FM_FD_RX_STATUS_ERR_MASK); -#else - fman_if_discard_rx_errors(fman_intf); -#endif + /* Disable RX mode */ fman_if_disable_rx(fman_intf); /* Disable promiscuous mode */ fman_if_promiscuous_disable(fman_intf); diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 9715f3ce8..7aadf8b08 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -125,6 +125,9 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) DPAA_DP_LOG(DEBUG, " Parsing mbuf: %p with annotations: %p", m, annot); + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD | + PKT_RX_L4_CKSUM_GOOD; + switch (prs) { case DPAA_PKT_TYPE_IPV4: m->packet_type = RTE_PTYPE_L2_ETHER | @@ -199,6 +202,16 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; break; + case DPAA_PKT_TYPE_IPV4_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_CSUM_ERR: + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_BAD; + break; + case DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR: + case DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR: + m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_L4_CKSUM_BAD; + break; case DPAA_PKT_TYPE_NONE: m->packet_type = 0; break; @@ -213,10 +226,6 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) /* Set the hash values */ m->hash.rss = (uint32_t)(annot->hash); - /* All packets with Bad checksum are dropped by interface (and - * corresponding notification issued to RX error queues). - */ - m->ol_flags = PKT_RX_RSS_HASH | PKT_RX_IP_CKSUM_GOOD; /* Check if Vlan is present */ if (prs & DPAA_PARSE_VLAN_MASK) diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index fe8eb6dc7..d9d7e04f5 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2017 NXP + * Copyright 2017,2020 NXP * */ @@ -61,7 +61,7 @@ * 0x8000 - Ethernet type * ShimR & Logical Port ID 0x0000 */ -#define DPAA_PARSE_MASK 0x00E044ED00800000 +#define DPAA_PARSE_MASK 0x00F044EF00800000 #define DPAA_PARSE_VLAN_MASK 0x0000000000700000 /* Parsed values (Little Endian) */ @@ -137,6 +137,23 @@ (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6) #define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \ (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_6_4) + +/* Checksum Errors */ +#define DPAA_PKT_IP_CSUM_ERR 0x0000400200000000 +#define DPAA_PKT_L4_CSUM_ERR 0x0010000000000000 +#define DPAA_PKT_TYPE_IPV4_CSUM_ERR \ + (DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV4) +#define DPAA_PKT_TYPE_IPV6_CSUM_ERR \ + (DPAA_PKT_IP_CSUM_ERR | DPAA_PKT_TYPE_IPV6) +#define DPAA_PKT_TYPE_IPV4_TCP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_TCP) +#define DPAA_PKT_TYPE_IPV6_TCP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_TCP) +#define DPAA_PKT_TYPE_IPV4_UDP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV4_UDP) +#define DPAA_PKT_TYPE_IPV6_UDP_CSUM_ERR \ + (DPAA_PKT_L4_CSUM_ERR | DPAA_PKT_TYPE_IPV6_UDP) + #define DPAA_PKT_L3_LEN_SHIFT 7 /**