From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13C62A034F; Mon, 19 Jul 2021 16:03:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F4CF4119C; Mon, 19 Jul 2021 16:02:37 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) by mails.dpdk.org (Postfix) with ESMTP id 649D241197 for ; Mon, 19 Jul 2021 16:02:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEP9H8/LtHKp2A1lC7M5GVlwYMuD0zuNGkRlYf94DH1IvqXrfewv8IxSy9EBPBE2QfqpHm2Q8qZtyQFMvQWEY/JieBymeGawY7dqpHyQourebF8u0B50oQVwYwnBWmgJ/QgxRQwo2TAYxPCHkgnE4g4RE2B9W6BbKtTH+gJO4m4ek6Y0OweRx838Fm0NvoV0HazI4aiIO4PUmEK4wAqR3WbiYJgatFfQ6M93yIg+0VJOXGDbHZCMzUPhnTzpL2tcSuu5eQ9dWyCSA8hDYW3bQ1C9tEumdzvRrKRFo+i02vQyNsQ4mdVlZNzMCcBFk4J0SsvAjedATbxpmkKZc+DBUA== 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=saH+C/SQIS0BJK42ggVhfu3qYFzdMz+gwVIe1sSbIBA=; b=kTr4xFVbPUzg9n5vlSWH1bY6MxdZIKY27WGwrmrx+bHwxeSvK3d5mm6g29ja76w0/HWdhclKbOwJ52uEEY7gZPTmp28LGNh8mPCQMK20NcTOKpxJEcMn6JoYECh60f/2KKoGJtdpcY1HaU7tnBhPMmIbuIyXSrVfVa5Zh2Lka9M2lk1zXpB77T3V+3+594owC+9n8so1OXdjf2Glmxive3A7n1R373gC8//SqOpz6nGEhEOsUsk6q54Flpz23IJ696abEi+dRE8MKZkcQ4pYwVcs50vPSkZZ89yuBfWrR4993zv3zdjxbF8L29/RPm8/U3ILXNfulA9AaGeosbvvlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=saH+C/SQIS0BJK42ggVhfu3qYFzdMz+gwVIe1sSbIBA=; b=dU2qpESnnoIkUVGtXVFApOwB0ZYF6YLYkvBDRYHuV4IZjPynbpsrl6SnoilKguaS+zr6Z2d6fe0uoXYQcDDXustrNlj+GJUJ6GjooMKhb6GAisT5tK2hnixjHudeCuxRaESR520oiQVG5FKziSEgdm+97bHT0H1Y8AIQcsY082U= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8536.eurprd04.prod.outlook.com (2603:10a6:10:2d7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.25; Mon, 19 Jul 2021 14:02:34 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::f483:9bb1:cde3:8a28]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::f483:9bb1:cde3:8a28%6]) with mapi id 15.20.4331.032; Mon, 19 Jul 2021 14:02:34 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Rohit Raj Date: Mon, 19 Jul 2021 19:29:14 +0530 Message-Id: <20210719135917.26241-5-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210719135917.26241-1-hemant.agrawal@nxp.com> References: <20210719135917.26241-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0038.apcprd02.prod.outlook.com (2603:1096:3:18::26) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR02CA0038.apcprd02.prod.outlook.com (2603:1096:3:18::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 14:02:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6258f99a-5685-4619-759a-08d94abddbb1 X-MS-TrafficTypeDiagnostic: DU2PR04MB8536: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3XxS+K/1ekI8MifePCAE/rS2AJ4Ku3xfOVgvM4HlSNDa4e3MInsP/ve/akYs5PXpreYu4HnuoTB0SjWv4ON2mv1w6WihFpSKDgeKSRtFrlRJ4gaCRB2H0FYPmC/Iu0MJ4kkDKdlkNn0XrVUu+r61XkwfXQGpV4D/Hu0UDZhMYMm98D8nt4uwHNeXxHbo1XhAhU3/cUi4IhZDoONjNM9YZhXy/l1i3CCNY2Qx30TxIprtkF9Zz79siYr2HLMoBBNuS53N90oBmVpRukwAXZMHwKszT8Rwa3CrMhp3DCdf/8ppu5sCOIcRti5d95MT6zjDohXelS3/l3KCd46WGv1lpuOPhD6OTtcmZQ71yS2iUeZ5k4jhpbCUg54SUllXAQdNgrWWfEaR+Fo7nhqge3j+bBp5gbpWKDmzVbeK9aQqSALZP+V38BLlPutXZSfQAXXLS+yEirKcpQAwZBCF4IvHj+wmi/5/yJNHvcN1fncR441ukeuW42QbUSf/cvUN1DEQGzz7P21mcMpU/KHf7Ykpiewf9HVV9jV/dIwKRf1+i3qXdzB6BPwKZO/aV4O/DBvuk4CLxYJNJ0ljbbld0TEFYwvkEGLGcOH38LajPoxGmp3xw5S7lLlP/mKP7YWFa1P8s8qkDEm2oWF1EASbze1aU9YNdxotEZovKOUimgysBJyVtWBZCqrrFgaDZhoUF2m6DHOWUw7NEN02OnvGKqv1Fg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(39860400002)(346002)(136003)(26005)(186003)(6512007)(36756003)(66946007)(66556008)(1076003)(83380400001)(66476007)(6506007)(44832011)(8676002)(2616005)(8936002)(478600001)(38350700002)(38100700002)(6666004)(86362001)(52116002)(316002)(6486002)(5660300002)(4326008)(6916009)(2906002)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?S46Fj0AXimfdUE9vjD4WHnlfXLork3vANsvZmwszezO4D5qjaTzdObfmUSoc?= =?us-ascii?Q?OI3XYIXbz3nc/QgilMKNZsThyyf6U08971YIpDliWWyRBO70s2Zz7vxTopFG?= =?us-ascii?Q?MhFAO2/4fySfYWzfu9B6QlwZz+9gWNH+r0/CNsA0dxYQDmeGXM3G6l8ITxzw?= =?us-ascii?Q?r9naTcByRQZYPC1zcyhhmb8SbazO6ALfcLG3OZohA5NS+VgfuQPPAd7QRl35?= =?us-ascii?Q?f1dSqzAL4OTdkZEyRCgIxJgd37KIwwDQ4O39YD++w6N14aEIUs2T4LFQErla?= =?us-ascii?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iwDOa+AOQ++meCkucQjUpF9AxD?= =?us-ascii?Q?QyCNdIf4T6EVL7WmrZPt3Mi9wDxvLCT5EHTl8jI8MufMFtah8YqskUhrKUAl?= =?us-ascii?Q?VJC5350qwUTlJJQpB1YzOhBuYBrgPeRHFxEqwjfIZE0dKwHoZy3vow4jSwdx?= =?us-ascii?Q?MjxDZ9T4TG0AagKyuHE6b7mV?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6258f99a-5685-4619-759a-08d94abddbb1 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2021 14:02:34.6572 (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: eNfOtY3Zc1T5vkOOTVO6AMiFHe2tZ68R+6uXSSsealsX+57pdfWGSMwPBHM7/19alQCjUE5LOTrPlCjri3Kpng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8536 Subject: [dpdk-dev] [PATCH 4/7] net/dpaa: add check for parsing default Rx queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Add check for the PCD queue from the kernel interface for default and error queues. Signed-off-by: Rohit Raj Acked-by: Hemant Agrawal --- drivers/bus/dpaa/base/fman/fman.c | 16 +++++++++++++++- drivers/bus/dpaa/include/fman.h | 7 +++++-- drivers/net/dpaa/dpaa_fmc.c | 5 ++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c index a14004d7fc..1814372a40 100644 --- a/drivers/bus/dpaa/base/fman/fman.c +++ b/drivers/bus/dpaa/base/fman/fman.c @@ -214,7 +214,7 @@ fman_if_init(const struct device_node *dpa_node) const phandle *port_cell_idx, *ext_args_cell_idx; const struct device_node *parent_node_ext_args; uint64_t tx_phandle_host[4] = {0}; - uint64_t rx_phandle_host[4] = {0}; + uint64_t rx_phandle_host[6] = {0}; uint64_t regs_addr_host = 0; uint64_t cell_idx_host = 0; uint64_t port_cell_idx_val = 0; @@ -511,6 +511,10 @@ fman_if_init(const struct device_node *dpa_node) goto err; } + /* Check if "fsl,qman-frame-queues-rx" in dtb file is valid entry or + * not. A valid entry contains at least 4 entries, rx_error_queue, + * rx_error_queue_count, fqid_rx_def and rx_error_queue_count. + */ assert(lenp >= (4 * sizeof(phandle))); na = of_n_addr_cells(mac_node); @@ -519,11 +523,21 @@ fman_if_init(const struct device_node *dpa_node) rx_phandle_host[1] = of_read_number(&rx_phandle[1], na); rx_phandle_host[2] = of_read_number(&rx_phandle[2], na); rx_phandle_host[3] = of_read_number(&rx_phandle[3], na); + rx_phandle_host[4] = of_read_number(&rx_phandle[4], na); + rx_phandle_host[5] = of_read_number(&rx_phandle[5], na); assert((rx_phandle_host[1] == 1) && (rx_phandle_host[3] == 1)); __if->__if.fqid_rx_err = rx_phandle_host[0]; __if->__if.fqid_rx_def = rx_phandle_host[2]; + /* If there are 6 entries in "fsl,qman-frame-queues-rx" in dtb file, it + * means PCD queues are also available. Hence, store that information. + */ + if (lenp == 6 * sizeof(phandle)) { + __if->__if.fqid_rx_pcd = rx_phandle_host[4]; + __if->__if.fqid_rx_pcd_count = rx_phandle_host[5]; + } + /* Extract the Tx FQIDs */ tx_phandle = of_get_property(dpa_node, "fsl,qman-frame-queues-tx", &lenp); diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h index 516c6c1515..3a6dd555a7 100644 --- a/drivers/bus/dpaa/include/fman.h +++ b/drivers/bus/dpaa/include/fman.h @@ -2,7 +2,7 @@ * * Copyright 2010-2012 Freescale Semiconductor, Inc. * All rights reserved. - * Copyright 2019-2020 NXP + * Copyright 2019-2021 NXP * */ @@ -329,8 +329,11 @@ struct fman_if { uint8_t is_shared_mac; /* The hard-coded FQIDs for this interface. Note: this doesn't cover * the PCD nor the "Rx default" FQIDs, which are configured via FMC - * and its XML-based configuration. + * and its XML-based configuration. These values are being parsed from + * kernel device tree. */ + uint32_t fqid_rx_pcd; + uint32_t fqid_rx_pcd_count; uint32_t fqid_rx_def; uint32_t fqid_rx_err; uint32_t fqid_tx_err; diff --git a/drivers/net/dpaa/dpaa_fmc.c b/drivers/net/dpaa/dpaa_fmc.c index 0ef3622744..5195053361 100644 --- a/drivers/net/dpaa/dpaa_fmc.c +++ b/drivers/net/dpaa/dpaa_fmc.c @@ -243,7 +243,10 @@ static int dpaa_port_fmc_scheme_parse(struct fman_if *fif, uint32_t fqid = fmc->scheme[idx].base_fqid + i; int k, found = 0; - if (fqid == fif->fqid_rx_def) { + if (fqid == fif->fqid_rx_def || + (fqid >= fif->fqid_rx_pcd && + fqid < (fif->fqid_rx_pcd + + fif->fqid_rx_pcd_count))) { if (fif->is_shared_mac && fmc->scheme[idx].override_storage_profile && fmc->scheme[idx].storage_profile.direct && -- 2.17.1