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 49444A0C41; Wed, 6 Oct 2021 15:28:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB68A41100; Wed, 6 Oct 2021 15:28:46 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10068.outbound.protection.outlook.com [40.107.1.68]) by mails.dpdk.org (Postfix) with ESMTP id 380CE40140 for ; Wed, 6 Oct 2021 15:28:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SYidNEUSF45KAp/m92GWJ00LJJx9JF7p50S5bBDbv2lJuv2OeUR8Af7mank+74rnNgLCj3cs4HGp/W2GlU757C42YZpOzN1VDW00A5PI/PuwpMb+8OyAd1NDi84ByvOD5Tt8QQixaFfnuOu4nTDdtqkaMImdNrBb0p608CkJ9kGRCbHEiWwqPiS/gUn3kdSjH5dodZOmulFqZQjBIRwAm7FiHg1zjLzUyYe0i5c3tTTtVuXhPOj83hAuibbv/dmB7RAoTEweM8E6Sw1yXg7ByDDcXpnmPHQtY17NYKCcCIHvcrNWg29f6ebTgEqjZhgNlh86WYpPLCpLWz+nfhpGmA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7nYC44WgvMGuQLpIVLgtQyJ5iofF384Xs8wZi49r1ro=; b=VZ1yhleNnQ0Jq+kb9fL3r3HDSLuORgHu+9GlcSSk/w2zrdTVa/oDW0PEQIkJYOKZBZFh8I+4RYRP0sQVM5vFnbLznz6FWmDw7sqKYIod4HR/66qNPlJGjQPcRSKy75rLCQx4tWoMav+X3h4ZMPuzdOX7+S6KpHITKvHxuS1FMPN1vmZjwCZlc4hGZS6dpMWBmnheR3HAgSRKjkO9EnQUi7DACQNaSsP4W6VEM35bQqb+VIn4hxDcXRCOZhM42YKmg2E667G+VJ5p+CFDUMPrHLzUIl/xQjH0XVJDOQUXfGxbkHD98bgO++EO6gyLwVpuEOVdnj14vkZOzMnLl85PXw== 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=7nYC44WgvMGuQLpIVLgtQyJ5iofF384Xs8wZi49r1ro=; b=ZLsvWeT+EmDEX6O/gwD/xVsINJKq1Z5/aZRcC069TJzC4LlWwueQsj9rK/MBaN4Xukp7yCvYhK0HhfI30/l7s8l4YAo351qW/1mgdQHbh+BkGfyC2K0BifpLtyKOI7Ra3H6c5ayF+sQ3eqWU8N5Q6BsQ9LXWJJsZ3mpX0/sF1cw= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8789.eurprd04.prod.outlook.com (2603:10a6:10:2e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Wed, 6 Oct 2021 13:28:43 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4566.022; Wed, 6 Oct 2021 13:28:42 +0000 Message-ID: Date: Wed, 6 Oct 2021 18:58:32 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Content-Language: en-US To: nipun.gupta@nxp.com, dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com References: <20210927122650.30881-1-nipun.gupta@nxp.com> <20210927122650.30881-2-nipun.gupta@nxp.com> From: Hemant Agrawal In-Reply-To: <20210927122650.30881-2-nipun.gupta@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0085.apcprd02.prod.outlook.com (2603:1096:4:90::25) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.2] (122.161.73.74) by SG2PR02CA0085.apcprd02.prod.outlook.com (2603:1096:4:90::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.21 via Frontend Transport; Wed, 6 Oct 2021 13:28:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3d8535d-aa26-401f-3940-08d988cd370f X-MS-TrafficTypeDiagnostic: DU2PR04MB8789: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IEfTTrAlsz+wb1PaBu1V1zPEA27v27Qk4CfSOfJshJY1JaqSAPHs09lrnjsOutxQO0wi70pdHoKcftz73QMeRd+sS70RkotO3wWfYgeAt/bQEDb/iOeeGaS4O2EWd46r6ml0BXcmGNHY1VAWma1FQBeK/esHEbxqwFtlbGvjJKDKL36GBiCpU6JjsbI+KyFDQe3+6Brwzahh7KIYFQj1qxpKaJDAs7IoyQ0DRaBU/2lnR65bPcQTEzb5DLmZT5xmNPFIbx/M4D1Lcx5qN0FqGGCpBcoEWQ+PTrNNWmLE7Ls65uEA/PVWmTWkZXJu6CuL8gDM3ODLWRqb5TVIrRUQAWoiIU9n8PxYc1XdQxtKvZuLajKYQHfrARHDDzV1gKyvhbbn8klmVr5/NL1jQYQPNwb9ekdLmziNcGVjtOcdixXIs6kOp2xHLanDJdESvlPfzHJXkfPN9OQQ18LyGrbUTZwbVWdCP7NyVj6Hj3CArPeCu3yTrSLdkoEEJSlMRfBPvecAb+rSHfFB0cOi266BGNq+8cKibDUpfsqk27sFjGXwjNrY4vGTsr0h0UmcrdvfLztPdQvc+c+TAq9yP0x9eCvPLCxXOajf4Tj7eY545a4aFJom2x1cvqI+HJX3l60qRsgTTaBoXg7psBQv06fbzn8wucS0ytX7ODqCQV+Yjzl32Xz1biGl0R73Mw3ruUfneTjKATUcEiT2yIUO/E+hP5d5Mc1D7jZdq90H6WpGG4EhLknRekGLRO9kxYHdKhXI+LfilzAfjzFekeVATnP2ww== 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)(366004)(66476007)(26005)(15650500001)(2906002)(55236004)(8936002)(6666004)(38350700002)(508600001)(86362001)(186003)(316002)(38100700002)(8676002)(16576012)(52116002)(5660300002)(31686004)(66946007)(53546011)(30864003)(4326008)(66556008)(83380400001)(2616005)(6486002)(44832011)(956004)(31696002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?amVraEkxdXdlem1SdzlOU2tyYkxOT0Raa2xTS0w2WlVLbWhlVGlnc3V6S3JR?= =?utf-8?B?V1BQaFV6cTJLQjZGMG5rZkZSYVozM0RST0VTRmpHSGY5S2kzejdBYm5mNE1i?= =?utf-8?B?NGlXME5Ua1RjL1VmUlQ1MXRFZWVxSmlUWDN6Z2pHeXhKY0NkWXBseHhmM2Uv?= =?utf-8?B?bUJsTGxFSFJhZnhiU3NNc2c3MG1XVC9SNFB6VFY2am94YkNRR3ZxWXJldCtq?= =?utf-8?B?VTBKRDloVTEwQlkxbHVuejlLc01UcE4vMG9qelYzdVVieUF0S0txY0t1dHhy?= =?utf-8?B?Z3RoM3hOa29CalpTSFN1ZmJlMUtndTRkcXFWNUw2bGFVTDRVUkE4MWRkYmlT?= =?utf-8?B?RWFhY2FYRjZJZjNnNzlkNDVGdG9oY29oMVlZckNxMVhFeVBJSmlqQ2hYYUd2?= =?utf-8?B?SitoMjlKMG0rczFmV0ZiRmlMbVZCZmQ0Nk1iODRybkFmY0ZWcE91ZHpZcUlI?= =?utf-8?B?azN6YXdETEVmUEZVWmZneDhvRUpzUEM3eU8rWk1kdWhGOHg2SmpjWVRmaGx6?= =?utf-8?B?N2tqUDBIcXdCaWlSOEttdFpGenVHUU85TlBwanNMTE9zZUFuczd2RjcwRG1F?= =?utf-8?B?UDR5VC9YSDNOMitEUStKeE9KaHYvRURKUnEzUTliZDV2NnpjekRzVU9uOFVT?= =?utf-8?B?T2Jib08yTlE5clpSZzlQR09vTnh5Umc3YmZCWkY1bG5NNFdxWWpCREJWdzJT?= =?utf-8?B?c25yNzhSS2JheWQyYk5uRGZuVGVZcHIzNzR4WmhNYUg5SXNSdlA1aTFRRDln?= =?utf-8?B?dFJVaU1JUDJFME5kV0s2bUUrVU1zOU02YXFkK0MvTkZHNXgrc3dwenhTNFZV?= =?utf-8?B?ODkyRnZ5dzkrUTVLWE1BSHgzRUVYN0xJUjJQMlptd1dxNFNuOGpPWGc4UGJH?= =?utf-8?B?LzZvSndzRjFWcXdJYXduMlZ6WmZjOGFqVjMvQkJnQ3BDR0hnaG5abXZzOU4x?= =?utf-8?B?MUlIai94eWhtY1RxcUhRMmVoOUMveitOaFdvencySnRGbzlubU4yNUNKVFRF?= =?utf-8?B?UnBzMVhWcXRBT1BQaFEvOHJ4TTN4SXZhSGtUYjViVVVQMldhMFN1Q0FDek9h?= =?utf-8?B?YWY0T0RFMVZQQzFmVVQ1cGNLUkc3VFo4ZnJRVnFPc2NBTFl0NkErL09WS2U5?= =?utf-8?B?TENSU1N5ek1CTXljaGVwdDA0RkJzdDRqeEtCMStWK21Wc0YyVGhpc2lMZ1V3?= =?utf-8?B?OTdneGRBWHlRR2ZtOTBpWkV3dGkxQ3NrVlF2QjFKTkVhZjFhVXhoYUozSEJQ?= =?utf-8?B?Y29VTjRaOGNoTGZXWG9Ha0VqR2VUbkFOUzZockpNeGg1R1ZONzV5ZjFMOVFH?= =?utf-8?B?a0Z3Y3UxZ09sZnZXWmVBZGNLL1NDQmVIZlowWG5ySGpWSHR0RUhYRGpPekZ4?= =?utf-8?B?NzR6N2IxWjlRaHpIbUFvOWhqbkVyYjQ3OGx3cDZPT01zbXJpdHhDYi9YMGFD?= =?utf-8?B?V0NOZ2lDODlUVVc0NDFBNHBiVjRFV1hBc3E5NVZBckdNRzBEeFMvS1JHODRH?= =?utf-8?B?UFFidTBHbGc1RjVDRzQ1Q3hWa2RuR1BjOUhHeldvaUVkOEFYQUZmMHp3T2s2?= =?utf-8?B?ZmFTaGVEUjgxVmNwaDJESElSSVR1ME5Iak1hUEN6UHZnN25WSXlKY1NubUU1?= =?utf-8?B?bnpaNG1PN3JMcEU0aTlKRzZQVi80dnFWRlZ1bWd0TE9ZM1NzMlM3dG1aZFcr?= =?utf-8?B?ckJOa1pOZGRlUEtVOE1GUW9KcVBtVEVkMXhpYVBMbm52V1c3ejI5MlJCYlNM?= =?utf-8?Q?W42F/TpaFePxuM+wbsbQbCo+HBFvG3ObkiMOfON?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3d8535d-aa26-401f-3940-08d988cd370f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2021 13:28:42.8808 (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: jKaeCPzNwqBT7sjz2OCMloYgwxoYRfHHA95RqizxzSagVQQ4lRQK5X/KORK0Om+75D7sbZ+WUf0YGKa44D/z8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8789 Subject: Re: [dpdk-dev] [PATCH 01/11] bus/fslmc: updated MC FW to 10.28 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: , Reply-To: hemant.agrawal@nxp.com Errors-To: dev-bounces@dpdk.org Sender: "dev" Series- Acked-by:  Hemant Agrawal On 9/27/2021 5:56 PM, nipun.gupta@nxp.com wrote: > From: Hemant Agrawal > > Updating MC firmware support APIs to be latest. It supports > improved DPDMUX (SRIOV equivalent) for traffic split between > dpnis and additional PTP APIs. > > Signed-off-by: Hemant Agrawal > --- > drivers/bus/fslmc/mc/dpdmai.c | 4 +- > drivers/bus/fslmc/mc/fsl_dpdmai.h | 21 ++++- > drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 15 ++-- > drivers/bus/fslmc/mc/fsl_dpmng.h | 4 +- > drivers/bus/fslmc/mc/fsl_dpopr.h | 7 +- > drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- > drivers/net/dpaa2/mc/dpdmux.c | 43 +++++++++ > drivers/net/dpaa2/mc/dpni.c | 48 ++++++---- > drivers/net/dpaa2/mc/dprtc.c | 78 +++++++++++++++- > drivers/net/dpaa2/mc/fsl_dpdmux.h | 6 ++ > drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 9 ++ > drivers/net/dpaa2/mc/fsl_dpkg.h | 6 +- > drivers/net/dpaa2/mc/fsl_dpni.h | 124 ++++++++++++++++++++++---- > drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 55 +++++++++--- > drivers/net/dpaa2/mc/fsl_dprtc.h | 19 +++- > drivers/net/dpaa2/mc/fsl_dprtc_cmd.h | 25 +++++- > 16 files changed, 401 insertions(+), 65 deletions(-) > > diff --git a/drivers/bus/fslmc/mc/dpdmai.c b/drivers/bus/fslmc/mc/dpdmai.c > index dcb9d516a1..9c2f3bf9d5 100644 > --- a/drivers/bus/fslmc/mc/dpdmai.c > +++ b/drivers/bus/fslmc/mc/dpdmai.c > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: BSD-3-Clause > - * Copyright 2018 NXP > + * Copyright 2018-2021 NXP > */ > > #include > @@ -116,6 +116,7 @@ int dpdmai_create(struct fsl_mc_io *mc_io, > cmd_params->num_queues = cfg->num_queues; > cmd_params->priorities[0] = cfg->priorities[0]; > cmd_params->priorities[1] = cfg->priorities[1]; > + cmd_params->options = cpu_to_le32(cfg->adv.options); > > /* send command to mc*/ > err = mc_send_command(mc_io, &cmd); > @@ -299,6 +300,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, > attr->id = le32_to_cpu(rsp_params->id); > attr->num_of_priorities = rsp_params->num_of_priorities; > attr->num_of_queues = rsp_params->num_of_queues; > + attr->options = le32_to_cpu(rsp_params->options); > > return 0; > } > diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai.h b/drivers/bus/fslmc/mc/fsl_dpdmai.h > index 19328c00a0..5af8ed48c0 100644 > --- a/drivers/bus/fslmc/mc/fsl_dpdmai.h > +++ b/drivers/bus/fslmc/mc/fsl_dpdmai.h > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: BSD-3-Clause > - * Copyright 2018 NXP > + * Copyright 2018-2021 NXP > */ > > #ifndef __FSL_DPDMAI_H > @@ -36,15 +36,32 @@ int dpdmai_close(struct fsl_mc_io *mc_io, > uint32_t cmd_flags, > uint16_t token); > > +/* DPDMAI options */ > + > +/** > + * Enable individual Congestion Groups usage per each priority queue > + * If this option is not enabled then only one CG is used for all priority > + * queues > + * If this option is enabled then a separate specific CG is used for each > + * individual priority queue. > + * In this case the priority queue must be specified via congestion notification > + * API > + */ > +#define DPDMAI_OPT_CG_PER_PRIORITY 0x00000001 > + > /** > * struct dpdmai_cfg - Structure representing DPDMAI configuration > * @priorities: Priorities for the DMA hardware processing; valid priorities are > * configured with values 1-8; the entry following last valid entry > * should be configured with 0 > + * @options: dpdmai options > */ > struct dpdmai_cfg { > uint8_t num_queues; > uint8_t priorities[DPDMAI_PRIO_NUM]; > + struct { > + uint32_t options; > + } adv; > }; > > int dpdmai_create(struct fsl_mc_io *mc_io, > @@ -81,11 +98,13 @@ int dpdmai_reset(struct fsl_mc_io *mc_io, > * struct dpdmai_attr - Structure representing DPDMAI attributes > * @id: DPDMAI object ID > * @num_of_priorities: number of priorities > + * @options: dpdmai options > */ > struct dpdmai_attr { > int id; > uint8_t num_of_priorities; > uint8_t num_of_queues; > + uint32_t options; > }; > > __rte_internal > diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h > index 7e122de4ef..c8f6b990f8 100644 > --- a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h > +++ b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h > @@ -1,32 +1,33 @@ > /* SPDX-License-Identifier: BSD-3-Clause > - * Copyright 2018 NXP > + * Copyright 2017-2018, 2020-2021 NXP > */ > - > #ifndef _FSL_DPDMAI_CMD_H > #define _FSL_DPDMAI_CMD_H > > /* DPDMAI Version */ > #define DPDMAI_VER_MAJOR 3 > -#define DPDMAI_VER_MINOR 3 > +#define DPDMAI_VER_MINOR 4 > > /* Command versioning */ > #define DPDMAI_CMD_BASE_VERSION 1 > #define DPDMAI_CMD_VERSION_2 2 > +#define DPDMAI_CMD_VERSION_3 3 > #define DPDMAI_CMD_ID_OFFSET 4 > > #define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION) > #define DPDMAI_CMD_V2(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_2) > +#define DPDMAI_CMD_V3(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_3) > > /* Command IDs */ > #define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x800) > #define DPDMAI_CMDID_OPEN DPDMAI_CMD(0x80E) > -#define DPDMAI_CMDID_CREATE DPDMAI_CMD_V2(0x90E) > +#define DPDMAI_CMDID_CREATE DPDMAI_CMD_V3(0x90E) > #define DPDMAI_CMDID_DESTROY DPDMAI_CMD(0x98E) > #define DPDMAI_CMDID_GET_API_VERSION DPDMAI_CMD(0xa0E) > > #define DPDMAI_CMDID_ENABLE DPDMAI_CMD(0x002) > #define DPDMAI_CMDID_DISABLE DPDMAI_CMD(0x003) > -#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD_V2(0x004) > +#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD_V3(0x004) > #define DPDMAI_CMDID_RESET DPDMAI_CMD(0x005) > #define DPDMAI_CMDID_IS_ENABLED DPDMAI_CMD(0x006) > > @@ -51,6 +52,8 @@ struct dpdmai_cmd_open { > struct dpdmai_cmd_create { > uint8_t num_queues; > uint8_t priorities[2]; > + uint8_t pad; > + uint32_t options; > }; > > struct dpdmai_cmd_destroy { > @@ -69,6 +72,8 @@ struct dpdmai_rsp_get_attr { > uint32_t id; > uint8_t num_of_priorities; > uint8_t num_of_queues; > + uint16_t pad; > + uint32_t options; > }; > > #define DPDMAI_DEST_TYPE_SHIFT 0 > diff --git a/drivers/bus/fslmc/mc/fsl_dpmng.h b/drivers/bus/fslmc/mc/fsl_dpmng.h > index 8764ceaed9..7e9bd96429 100644 > --- a/drivers/bus/fslmc/mc/fsl_dpmng.h > +++ b/drivers/bus/fslmc/mc/fsl_dpmng.h > @@ -1,7 +1,7 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > * > * Copyright 2013-2015 Freescale Semiconductor Inc. > - * Copyright 2017-2019 NXP > + * Copyright 2017-2021 NXP > * > */ > #ifndef __FSL_DPMNG_H > @@ -20,7 +20,7 @@ struct fsl_mc_io; > * Management Complex firmware version information > */ > #define MC_VER_MAJOR 10 > -#define MC_VER_MINOR 18 > +#define MC_VER_MINOR 28 > > /** > * struct mc_version > diff --git a/drivers/bus/fslmc/mc/fsl_dpopr.h b/drivers/bus/fslmc/mc/fsl_dpopr.h > index fd727e011b..74dd32f783 100644 > --- a/drivers/bus/fslmc/mc/fsl_dpopr.h > +++ b/drivers/bus/fslmc/mc/fsl_dpopr.h > @@ -1,7 +1,7 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > * > * Copyright 2013-2015 Freescale Semiconductor Inc. > - * Copyright 2018 NXP > + * Copyright 2018-2021 NXP > * > */ > #ifndef __FSL_DPOPR_H_ > @@ -22,7 +22,10 @@ > * Retire an existing Order Point Record option > */ > #define OPR_OPT_RETIRE 0x2 > - > +/** > + * Assign an existing Order Point Record to a queue > + */ > +#define OPR_OPT_ASSIGN 0x4 > /** > * struct opr_cfg - Structure representing OPR configuration > * @oprrws: Order point record (OPR) restoration window size (0 to 5) > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c > index c12169578e..560b79151b 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > @@ -2273,7 +2273,7 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, > > ret = dpni_set_opr(dpni, CMD_PRI_LOW, eth_priv->token, > dpaa2_ethq->tc_index, flow_id, > - OPR_OPT_CREATE, &ocfg); > + OPR_OPT_CREATE, &ocfg, 0); > if (ret) { > DPAA2_PMD_ERR("Error setting opr: ret: %d\n", ret); > return ret; > diff --git a/drivers/net/dpaa2/mc/dpdmux.c b/drivers/net/dpaa2/mc/dpdmux.c > index 93912ef9d3..edbb01b45b 100644 > --- a/drivers/net/dpaa2/mc/dpdmux.c > +++ b/drivers/net/dpaa2/mc/dpdmux.c > @@ -491,6 +491,49 @@ int dpdmux_set_max_frame_length(struct fsl_mc_io *mc_io, > return mc_send_command(mc_io, &cmd); > } > > +/** > + * dpdmux_get_max_frame_length() - Return the maximum frame length for DPDMUX > + * interface > + * @mc_io: Pointer to MC portal's I/O object > + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > + * @token: Token of DPDMUX object > + * @if_id: Interface id > + * @max_frame_length: maximum frame length > + * > + * When dpdmux object is in VEPA mode this function will ignore if_id parameter > + * and will return maximum frame length for uplink interface (if_id==0). > + * > + * Return: '0' on Success; Error code otherwise. > + */ > +int dpdmux_get_max_frame_length(struct fsl_mc_io *mc_io, > + uint32_t cmd_flags, > + uint16_t token, > + uint16_t if_id, > + uint16_t *max_frame_length) > +{ > + struct mc_command cmd = { 0 }; > + struct dpdmux_cmd_get_max_frame_len *cmd_params; > + struct dpdmux_rsp_get_max_frame_len *rsp_params; > + int err = 0; > + > + /* prepare command */ > + cmd.header = mc_encode_cmd_header(DPDMUX_CMDID_GET_MAX_FRAME_LENGTH, > + cmd_flags, > + token); > + cmd_params = (struct dpdmux_cmd_get_max_frame_len *)cmd.params; > + cmd_params->if_id = cpu_to_le16(if_id); > + > + err = mc_send_command(mc_io, &cmd); > + if (err) > + return err; > + > + rsp_params = (struct dpdmux_rsp_get_max_frame_len *)cmd.params; > + *max_frame_length = le16_to_cpu(rsp_params->max_len); > + > + /* send command to mc*/ > + return err; > +} > + > /** > * dpdmux_ul_reset_counters() - Function resets the uplink counter > * @mc_io: Pointer to MC portal's I/O object > diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c > index b254931386..60048d6c43 100644 > --- a/drivers/net/dpaa2/mc/dpni.c > +++ b/drivers/net/dpaa2/mc/dpni.c > @@ -1,7 +1,7 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > * > * Copyright 2013-2016 Freescale Semiconductor Inc. > - * Copyright 2016-2020 NXP > + * Copyright 2016-2021 NXP > * > */ > #include > @@ -126,6 +126,8 @@ int dpni_create(struct fsl_mc_io *mc_io, > cmd_params->qos_entries = cfg->qos_entries; > cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries); > cmd_params->num_cgs = cfg->num_cgs; > + cmd_params->num_opr = cfg->num_opr; > + cmd_params->dist_key_size = cfg->dist_key_size; > > /* send command to mc*/ > err = mc_send_command(mc_io, &cmd); > @@ -1829,6 +1831,7 @@ int dpni_add_fs_entry(struct fsl_mc_io *mc_io, > cmd_params->options = cpu_to_le16(action->options); > cmd_params->flow_id = cpu_to_le16(action->flow_id); > cmd_params->flc = cpu_to_le64(action->flc); > + cmd_params->redir_token = cpu_to_le16(action->redirect_obj_token); > > /* send command to mc*/ > return mc_send_command(mc_io, &cmd); > @@ -2442,7 +2445,7 @@ int dpni_reset_statistics(struct fsl_mc_io *mc_io, > } > > /** > - * dpni_set_taildrop() - Set taildrop per queue or TC > + * dpni_set_taildrop() - Set taildrop per congestion group > * > * Setting a per-TC taildrop (cg_point = DPNI_CP_GROUP) will reset any current > * congestion notification or early drop (WRED) configuration previously applied > @@ -2451,13 +2454,14 @@ int dpni_reset_statistics(struct fsl_mc_io *mc_io, > * @mc_io: Pointer to MC portal's I/O object > * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > * @token: Token of DPNI object > - * @cg_point: Congestion point, DPNI_CP_QUEUE is only supported in > + * @cg_point: Congestion group identifier DPNI_CP_QUEUE is only supported in > * combination with DPNI_QUEUE_RX. > * @q_type: Queue type, can be DPNI_QUEUE_RX or DPNI_QUEUE_TX. > * @tc: Traffic class to apply this taildrop to > - * @q_index: Index of the queue if the DPNI supports multiple queues for > + * @index/cgid: Index of the queue if the DPNI supports multiple queues for > * traffic distribution. > - * Ignored if CONGESTION_POINT is not DPNI_CP_QUEUE. > + * If CONGESTION_POINT is DPNI_CP_CONGESTION_GROUP then it > + * represent the cgid of the congestion point > * @taildrop: Taildrop structure > * > * Return: '0' on Success; Error code otherwise. > @@ -2577,7 +2581,8 @@ int dpni_set_opr(struct fsl_mc_io *mc_io, > uint8_t tc, > uint8_t index, > uint8_t options, > - struct opr_cfg *cfg) > + struct opr_cfg *cfg, > + uint8_t opr_id) > { > struct dpni_cmd_set_opr *cmd_params; > struct mc_command cmd = { 0 }; > @@ -2591,6 +2596,7 @@ int dpni_set_opr(struct fsl_mc_io *mc_io, > cmd_params->tc_id = tc; > cmd_params->index = index; > cmd_params->options = options; > + cmd_params->opr_id = opr_id; > cmd_params->oloe = cfg->oloe; > cmd_params->oeane = cfg->oeane; > cmd_params->olws = cfg->olws; > @@ -2621,7 +2627,9 @@ int dpni_get_opr(struct fsl_mc_io *mc_io, > uint8_t tc, > uint8_t index, > struct opr_cfg *cfg, > - struct opr_qry *qry) > + struct opr_qry *qry, > + uint8_t flags, > + uint8_t opr_id) > { > struct dpni_rsp_get_opr *rsp_params; > struct dpni_cmd_get_opr *cmd_params; > @@ -2635,6 +2643,8 @@ int dpni_get_opr(struct fsl_mc_io *mc_io, > cmd_params = (struct dpni_cmd_get_opr *)cmd.params; > cmd_params->index = index; > cmd_params->tc_id = tc; > + cmd_params->flags = flags; > + cmd_params->opr_id = opr_id; > > /* send command to mc*/ > err = mc_send_command(mc_io, &cmd); > @@ -2673,7 +2683,7 @@ int dpni_get_opr(struct fsl_mc_io *mc_io, > * If the FS is already enabled with a previous call the classification > * key will be changed but all the table rules are kept. If the > * existing rules do not match the key the results will not be > - * predictable. It is the user responsibility to keep key integrity > + * predictable. It is the user responsibility to keep keyintegrity. > * If cfg.enable is set to 1 the command will create a flow steering table > * and will classify packets according to this table. The packets > * that miss all the table rules will be classified according to > @@ -2695,7 +2705,7 @@ int dpni_set_rx_fs_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > cmd_params = (struct dpni_cmd_set_rx_fs_dist *)cmd.params; > cmd_params->dist_size = cpu_to_le16(cfg->dist_size); > dpni_set_field(cmd_params->enable, RX_FS_DIST_ENABLE, cfg->enable); > - cmd_params->tc = cfg->tc; > + cmd_params->tc = cfg->tc; > cmd_params->miss_flow_id = cpu_to_le16(cfg->fs_miss_flow_id); > cmd_params->key_cfg_iova = cpu_to_le64(cfg->key_cfg_iova); > > @@ -2710,9 +2720,9 @@ int dpni_set_rx_fs_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > * @token: Token of DPNI object > * @cfg: Distribution configuration > * If cfg.enable is set to 1 the packets will be classified using a hash > - * function based on the key received in cfg.key_cfg_iova parameter > + * function based on the key received in cfg.key_cfg_iova parameter. > * If cfg.enable is set to 0 the packets will be sent to the queue configured in > - * dpni_set_rx_dist_default_queue() call > + * dpni_set_rx_dist_default_queue() call > */ > int dpni_set_rx_hash_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > uint16_t token, const struct dpni_rx_dist_cfg *cfg) > @@ -2735,9 +2745,9 @@ int dpni_set_rx_hash_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > } > > /** > - * dpni_add_custom_tpid() - Configures a distinct Ethertype value > - * (or TPID value) to indicate VLAN tag in addition to the common > - * TPID values 0x8100 and 0x88A8 > + * dpni_add_custom_tpid() - Configures a distinct Ethertype value (or TPID > + * value) to indicate VLAN tag in adition to the common TPID values > + * 0x81000 and 0x88A8 > * @mc_io: Pointer to MC portal's I/O object > * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > * @token: Token of DPNI object > @@ -2745,8 +2755,8 @@ int dpni_set_rx_hash_dist(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > * > * Only two custom values are accepted. If the function is called for the third > * time it will return error. > - * To replace an existing value use dpni_remove_custom_tpid() to remove > - * a previous TPID and after that use again the function. > + * To replace an existing value use dpni_remove_custom_tpid() to remove a > + * previous TPID and after that use again the function. > * > * Return: '0' on Success; Error code otherwise. > */ > @@ -2769,7 +2779,7 @@ int dpni_add_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > > /** > * dpni_remove_custom_tpid() - Removes a distinct Ethertype value added > - * previously with dpni_add_custom_tpid() > + * previously with dpni_add_custom_tpid() > * @mc_io: Pointer to MC portal's I/O object > * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > * @token: Token of DPNI object > @@ -2798,8 +2808,8 @@ int dpni_remove_custom_tpid(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > } > > /** > - * dpni_get_custom_tpid() - Returns custom TPID (vlan tags) values configured > - * to detect 802.1q frames > + * dpni_get_custom_tpid() - Returns custom TPID (vlan tags) values configured to > + * detect 802.1q frames > * @mc_io: Pointer to MC portal's I/O object > * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > * @token: Token of DPNI object > diff --git a/drivers/net/dpaa2/mc/dprtc.c b/drivers/net/dpaa2/mc/dprtc.c > index 42ac89150e..36e62eb0c3 100644 > --- a/drivers/net/dpaa2/mc/dprtc.c > +++ b/drivers/net/dpaa2/mc/dprtc.c > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > - * Copyright 2019 NXP > + * Copyright 2019-2021 NXP > */ > #include > #include > @@ -521,3 +521,79 @@ int dprtc_get_api_version(struct fsl_mc_io *mc_io, > > return 0; > } > + > +/** > + * dprtc_get_ext_trigger_timestamp - Retrieve the Ext trigger timestamp status > + * (timestamp + flag for unread timestamp in FIFO). > + * > + * @mc_io: Pointer to MC portal's I/O object > + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > + * @token: Token of DPRTC object > + * @id: External trigger id. > + * @status: Returned object's external trigger status > + * > + * Return: '0' on Success; Error code otherwise. > + */ > +int dprtc_get_ext_trigger_timestamp(struct fsl_mc_io *mc_io, > + uint32_t cmd_flags, > + uint16_t token, > + uint8_t id, > + struct dprtc_ext_trigger_status *status) > +{ > + struct dprtc_rsp_ext_trigger_timestamp *rsp_params; > + struct dprtc_cmd_ext_trigger_timestamp *cmd_params; > + struct mc_command cmd = { 0 }; > + int err; > + > + /* prepare command */ > + cmd.header = mc_encode_cmd_header(DPRTC_CMDID_GET_EXT_TRIGGER_TIMESTAMP, > + cmd_flags, > + token); > + > + cmd_params = (struct dprtc_cmd_ext_trigger_timestamp *)cmd.params; > + cmd_params->id = id; > + /* send command to mc*/ > + err = mc_send_command(mc_io, &cmd); > + if (err) > + return err; > + > + /* retrieve response parameters */ > + rsp_params = (struct dprtc_rsp_ext_trigger_timestamp *)cmd.params; > + status->timestamp = le64_to_cpu(rsp_params->timestamp); > + status->unread_valid_timestamp = rsp_params->unread_valid_timestamp; > + > + return 0; > +} > + > +/** > + * dprtc_set_fiper_loopback() - Set the fiper pulse as source of interrupt for > + * External Trigger stamps > + * @mc_io: Pointer to MC portal's I/O object > + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' > + * @token: Token of DPRTC object > + * @id: External trigger id. > + * @fiper_as_input: Bit used to control interrupt signal source: > + * 0 = Normal operation, interrupt external source > + * 1 = Fiper pulse is looped back into Trigger input > + * > + * Return: '0' on Success; Error code otherwise. > + */ > +int dprtc_set_fiper_loopback(struct fsl_mc_io *mc_io, > + uint32_t cmd_flags, > + uint16_t token, > + uint8_t id, > + uint8_t fiper_as_input) > +{ > + struct dprtc_ext_trigger_cfg *cmd_params; > + struct mc_command cmd = { 0 }; > + > + cmd.header = mc_encode_cmd_header(DPRTC_CMDID_SET_FIPER_LOOPBACK, > + cmd_flags, > + token); > + > + cmd_params = (struct dprtc_ext_trigger_cfg *)cmd.params; > + cmd_params->id = id; > + cmd_params->fiper_as_input = fiper_as_input; > + > + return mc_send_command(mc_io, &cmd); > +} > diff --git a/drivers/net/dpaa2/mc/fsl_dpdmux.h b/drivers/net/dpaa2/mc/fsl_dpdmux.h > index f4f9598a29..b01a98eb59 100644 > --- a/drivers/net/dpaa2/mc/fsl_dpdmux.h > +++ b/drivers/net/dpaa2/mc/fsl_dpdmux.h > @@ -196,6 +196,12 @@ int dpdmux_set_max_frame_length(struct fsl_mc_io *mc_io, > uint16_t token, > uint16_t max_frame_length); > > +int dpdmux_get_max_frame_length(struct fsl_mc_io *mc_io, > + uint32_t cmd_flags, > + uint16_t token, > + uint16_t if_id, > + uint16_t *max_frame_length); > + > /** > * enum dpdmux_counter_type - Counter types > * @DPDMUX_CNT_ING_FRAME: Counts ingress frames > diff --git a/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h b/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h > index 2ab4d75dfb..f8a1b5b1ae 100644 > --- a/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h > +++ b/drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h > @@ -39,6 +39,7 @@ > #define DPDMUX_CMDID_RESET DPDMUX_CMD(0x005) > #define DPDMUX_CMDID_IS_ENABLED DPDMUX_CMD(0x006) > #define DPDMUX_CMDID_SET_MAX_FRAME_LENGTH DPDMUX_CMD(0x0a1) > +#define DPDMUX_CMDID_GET_MAX_FRAME_LENGTH DPDMUX_CMD(0x0a2) > > #define DPDMUX_CMDID_UL_RESET_COUNTERS DPDMUX_CMD(0x0a3) > > @@ -124,6 +125,14 @@ struct dpdmux_cmd_set_max_frame_length { > uint16_t max_frame_length; > }; > > +struct dpdmux_cmd_get_max_frame_len { > + uint16_t if_id; > +}; > + > +struct dpdmux_rsp_get_max_frame_len { > + uint16_t max_len; > +}; > + > #define DPDMUX_ACCEPTED_FRAMES_TYPE_SHIFT 0 > #define DPDMUX_ACCEPTED_FRAMES_TYPE_SIZE 4 > #define DPDMUX_UNACCEPTED_FRAMES_ACTION_SHIFT 4 > diff --git a/drivers/net/dpaa2/mc/fsl_dpkg.h b/drivers/net/dpaa2/mc/fsl_dpkg.h > index 02fe8d50e7..70f2339ea5 100644 > --- a/drivers/net/dpaa2/mc/fsl_dpkg.h > +++ b/drivers/net/dpaa2/mc/fsl_dpkg.h > @@ -1,6 +1,6 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > * Copyright 2013-2015 Freescale Semiconductor Inc. > - * Copyright 2016-2017 NXP > + * Copyright 2016-2021 NXP > * > */ > #ifndef __FSL_DPKG_H_ > @@ -21,7 +21,7 @@ > /** > * Number of extractions per key profile > */ > -#define DPKG_MAX_NUM_OF_EXTRACTS 10 > +#define DPKG_MAX_NUM_OF_EXTRACTS 20 > > /** > * enum dpkg_extract_from_hdr_type - Selecting extraction by header types > @@ -177,7 +177,7 @@ struct dpni_ext_set_rx_tc_dist { > uint8_t num_extracts; > uint8_t pad[7]; > /* words 1..25 */ > - struct dpni_dist_extract extracts[10]; > + struct dpni_dist_extract extracts[DPKG_MAX_NUM_OF_EXTRACTS]; > }; > > int dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, > diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h > index df42746c9a..34c6b20033 100644 > --- a/drivers/net/dpaa2/mc/fsl_dpni.h > +++ b/drivers/net/dpaa2/mc/fsl_dpni.h > @@ -1,7 +1,7 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > * > * Copyright 2013-2016 Freescale Semiconductor Inc. > - * Copyright 2016-2020 NXP > + * Copyright 2016-2021 NXP > * > */ > #ifndef __FSL_DPNI_H > @@ -19,6 +19,11 @@ struct fsl_mc_io; > > /** General DPNI macros */ > > +/** > + * Maximum size of a key > + */ > +#define DPNI_MAX_KEY_SIZE 56 > + > /** > * Maximum number of traffic classes > */ > @@ -95,8 +100,18 @@ struct fsl_mc_io; > * Define a custom number of congestion groups > */ > #define DPNI_OPT_CUSTOM_CG 0x000200 > - > - > +/** > + * Define a custom number of order point records > + */ > +#define DPNI_OPT_CUSTOM_OPR 0x000400 > +/** > + * Hash key is shared between all traffic classes > + */ > +#define DPNI_OPT_SHARED_HASH_KEY 0x000800 > +/** > + * Flow steering table is shared between all traffic classes > + */ > +#define DPNI_OPT_SHARED_FS 0x001000 > /** > * Software sequence maximum layout size > */ > @@ -183,6 +198,8 @@ struct dpni_cfg { > uint8_t num_rx_tcs; > uint8_t qos_entries; > uint8_t num_cgs; > + uint16_t num_opr; > + uint8_t dist_key_size; > }; > > int dpni_create(struct fsl_mc_io *mc_io, > @@ -366,28 +383,45 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io, > /** > * Extract out of frame header error > */ > -#define DPNI_ERROR_EOFHE 0x00020000 > +#define DPNI_ERROR_MS 0x40000000 > +#define DPNI_ERROR_PTP 0x08000000 > +/* Ethernet multicast frame */ > +#define DPNI_ERROR_MC 0x04000000 > +/* Ethernet broadcast frame */ > +#define DPNI_ERROR_BC 0x02000000 > +#define DPNI_ERROR_KSE 0x00040000 > +#define DPNI_ERROR_EOFHE 0x00020000 > +#define DPNI_ERROR_MNLE 0x00010000 > +#define DPNI_ERROR_TIDE 0x00008000 > +#define DPNI_ERROR_PIEE 0x00004000 > /** > * Frame length error > */ > -#define DPNI_ERROR_FLE 0x00002000 > +#define DPNI_ERROR_FLE 0x00002000 > /** > * Frame physical error > */ > -#define DPNI_ERROR_FPE 0x00001000 > +#define DPNI_ERROR_FPE 0x00001000 > +#define DPNI_ERROR_PTE 0x00000080 > +#define DPNI_ERROR_ISP 0x00000040 > /** > * Parsing header error > */ > -#define DPNI_ERROR_PHE 0x00000020 > +#define DPNI_ERROR_PHE 0x00000020 > + > +#define DPNI_ERROR_BLE 0x00000010 > /** > * Parser L3 checksum error > */ > -#define DPNI_ERROR_L3CE 0x00000004 > +#define DPNI_ERROR_L3CV 0x00000008 > + > +#define DPNI_ERROR_L3CE 0x00000004 > /** > - * Parser L3 checksum error > + * Parser L4 checksum error > */ > -#define DPNI_ERROR_L4CE 0x00000001 > +#define DPNI_ERROR_L4CV 0x00000002 > > +#define DPNI_ERROR_L4CE 0x00000001 > /** > * enum dpni_error_action - Defines DPNI behavior for errors > * @DPNI_ERROR_ACTION_DISCARD: Discard the frame > @@ -455,6 +489,10 @@ int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, > * Select to modify the sw-opaque value setting > */ > #define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE 0x00000080 > +/** > + * Select to disable Scatter Gather and use single buffer > + */ > +#define DPNI_BUF_LAYOUT_OPT_NO_SG 0x00000100 > > /** > * struct dpni_buffer_layout - Structure representing DPNI buffer layout > @@ -733,7 +771,7 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io, > > /** > * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration > - * @rate_limit: Rate in Mbps > + * @rate_limit: Rate in Mbits/s > * @max_burst_size: Burst size in bytes (up to 64KB) > */ > struct dpni_tx_shaping_cfg { > @@ -798,6 +836,11 @@ int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io, > uint16_t token, > uint8_t mac_addr[6]); > > +/** > + * Set mac addr queue action > + */ > +#define DPNI_MAC_SET_QUEUE_ACTION 1 > + > int dpni_add_mac_addr(struct fsl_mc_io *mc_io, > uint32_t cmd_flags, > uint16_t token, > @@ -1464,6 +1507,7 @@ int dpni_clear_qos_table(struct fsl_mc_io *mc_io, > struct dpni_fs_action_cfg { > uint64_t flc; > uint16_t flow_id; > + uint16_t redirect_obj_token; > uint16_t options; > }; > > @@ -1595,7 +1639,8 @@ int dpni_set_opr(struct fsl_mc_io *mc_io, > uint8_t tc, > uint8_t index, > uint8_t options, > - struct opr_cfg *cfg); > + struct opr_cfg *cfg, > + uint8_t opr_id); > > int dpni_get_opr(struct fsl_mc_io *mc_io, > uint32_t cmd_flags, > @@ -1603,7 +1648,9 @@ int dpni_get_opr(struct fsl_mc_io *mc_io, > uint8_t tc, > uint8_t index, > struct opr_cfg *cfg, > - struct opr_qry *qry); > + struct opr_qry *qry, > + uint8_t flags, > + uint8_t opr_id); > > /** > * When used for queue_idx in function dpni_set_rx_dist_default_queue will > @@ -1779,14 +1826,57 @@ int dpni_get_sw_sequence_layout(struct fsl_mc_io *mc_io, > > /** > * dpni_extract_sw_sequence_layout() - extract the software sequence layout > - * @layout: software sequence layout > - * @sw_sequence_layout_buf: Zeroed 264 bytes of memory before mapping it > - * to DMA > + * @layout: software sequence layout > + * @sw_sequence_layout_buf:Zeroed 264 bytes of memory before mapping it to DMA > * > * This function has to be called after dpni_get_sw_sequence_layout > - * > */ > void dpni_extract_sw_sequence_layout(struct dpni_sw_sequence_layout *layout, > const uint8_t *sw_sequence_layout_buf); > > +/** > + * struct dpni_ptp_cfg - configure single step PTP (IEEE 1588) > + * @en: enable single step PTP. When enabled the PTPv1 functionality will > + * not work. If the field is zero, offset and ch_update parameters > + * will be ignored > + * @offset: start offset from the beginning of the frame where timestamp > + * field is found. The offset must respect all MAC headers, VLAN > + * tags and other protocol headers > + * @ch_update: when set UDP checksum will be updated inside packet > + * @peer_delay: For peer-to-peer transparent clocks add this value to the > + * correction field in addition to the transient time update. The > + * value expresses nanoseconds. > + */ > +struct dpni_single_step_cfg { > + uint8_t en; > + uint8_t ch_update; > + uint16_t offset; > + uint32_t peer_delay; > +}; > + > +int dpni_set_single_step_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > + uint16_t token, struct dpni_single_step_cfg *ptp_cfg); > + > +int dpni_get_single_step_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > + uint16_t token, struct dpni_single_step_cfg *ptp_cfg); > + > +/** > + * loopback_en field is valid when calling function dpni_set_port_cfg > + */ > +#define DPNI_PORT_CFG_LOOPBACK 0x01 > + > +/** > + * struct dpni_port_cfg - custom configuration for dpni physical port > + * @loopback_en: port loopback enabled > + */ > +struct dpni_port_cfg { > + int loopback_en; > +}; > + > +int dpni_set_port_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > + uint16_t token, uint32_t flags, struct dpni_port_cfg *port_cfg); > + > +int dpni_get_port_cfg(struct fsl_mc_io *mc_io, uint32_t cmd_flags, > + uint16_t token, struct dpni_port_cfg *port_cfg); > + > #endif /* __FSL_DPNI_H */ > diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h > index c40090b8fe..6fbd93bb38 100644 > --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h > +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h > @@ -1,7 +1,7 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > * > * Copyright 2013-2016 Freescale Semiconductor Inc. > - * Copyright 2016-2020 NXP > + * Copyright 2016-2021 NXP > * > */ > #ifndef _FSL_DPNI_CMD_H > @@ -9,21 +9,25 @@ > > /* DPNI Version */ > #define DPNI_VER_MAJOR 7 > -#define DPNI_VER_MINOR 13 > +#define DPNI_VER_MINOR 17 > > #define DPNI_CMD_BASE_VERSION 1 > #define DPNI_CMD_VERSION_2 2 > #define DPNI_CMD_VERSION_3 3 > +#define DPNI_CMD_VERSION_4 4 > +#define DPNI_CMD_VERSION_5 5 > #define DPNI_CMD_ID_OFFSET 4 > > #define DPNI_CMD(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION) > #define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2) > #define DPNI_CMD_V3(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_3) > +#define DPNI_CMD_V4(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_4) > +#define DPNI_CMD_V5(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_5) > > /* Command IDs */ > #define DPNI_CMDID_OPEN DPNI_CMD(0x801) > #define DPNI_CMDID_CLOSE DPNI_CMD(0x800) > -#define DPNI_CMDID_CREATE DPNI_CMD_V3(0x901) > +#define DPNI_CMDID_CREATE DPNI_CMD_V5(0x901) > #define DPNI_CMDID_DESTROY DPNI_CMD(0x981) > #define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01) > > @@ -67,7 +71,7 @@ > #define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232) > #define DPNI_CMDID_CLR_VLAN_FILTERS DPNI_CMD(0x233) > > -#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V3(0x235) > +#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V4(0x235) > > #define DPNI_CMDID_SET_RX_TC_POLICING DPNI_CMD(0x23E) > > @@ -75,7 +79,7 @@ > #define DPNI_CMDID_ADD_QOS_ENT DPNI_CMD_V2(0x241) > #define DPNI_CMDID_REMOVE_QOS_ENT DPNI_CMD(0x242) > #define DPNI_CMDID_CLR_QOS_TBL DPNI_CMD(0x243) > -#define DPNI_CMDID_ADD_FS_ENT DPNI_CMD(0x244) > +#define DPNI_CMDID_ADD_FS_ENT DPNI_CMD_V2(0x244) > #define DPNI_CMDID_REMOVE_FS_ENT DPNI_CMD(0x245) > #define DPNI_CMDID_CLR_FS_ENT DPNI_CMD(0x246) > > @@ -140,7 +144,9 @@ struct dpni_cmd_create { > uint16_t fs_entries; > uint8_t num_rx_tcs; > uint8_t pad4; > - uint8_t num_cgs; > + uint8_t num_cgs; > + uint16_t num_opr; > + uint8_t dist_key_size; > }; > > struct dpni_cmd_destroy { > @@ -411,8 +417,6 @@ struct dpni_rsp_get_port_mac_addr { > uint8_t mac_addr[6]; > }; > > -#define DPNI_MAC_SET_QUEUE_ACTION 1 > - > struct dpni_cmd_add_mac_addr { > uint8_t flags; > uint8_t pad; > @@ -594,6 +598,7 @@ struct dpni_cmd_add_fs_entry { > uint64_t key_iova; > uint64_t mask_iova; > uint64_t flc; > + uint16_t redir_token; > }; > > struct dpni_cmd_remove_fs_entry { > @@ -779,7 +784,7 @@ struct dpni_rsp_get_congestion_notification { > }; > > struct dpni_cmd_set_opr { > - uint8_t pad0; > + uint8_t opr_id; > uint8_t tc_id; > uint8_t index; > uint8_t options; > @@ -792,9 +797,10 @@ struct dpni_cmd_set_opr { > }; > > struct dpni_cmd_get_opr { > - uint8_t pad; > + uint8_t flags; > uint8_t tc_id; > uint8_t index; > + uint8_t opr_id; > }; > > #define DPNI_RIP_SHIFT 0 > @@ -911,5 +917,34 @@ struct dpni_sw_sequence_layout_entry { > uint16_t pad; > }; > > +#define DPNI_PTP_ENABLE_SHIFT 0 > +#define DPNI_PTP_ENABLE_SIZE 1 > +#define DPNI_PTP_CH_UPDATE_SHIFT 1 > +#define DPNI_PTP_CH_UPDATE_SIZE 1 > +struct dpni_cmd_single_step_cfg { > + uint16_t flags; > + uint16_t offset; > + uint32_t peer_delay; > +}; > + > +struct dpni_rsp_single_step_cfg { > + uint16_t flags; > + uint16_t offset; > + uint32_t peer_delay; > +}; > + > +#define DPNI_PORT_LOOPBACK_EN_SHIFT 0 > +#define DPNI_PORT_LOOPBACK_EN_SIZE 1 > + > +struct dpni_cmd_set_port_cfg { > + uint32_t flags; > + uint32_t bit_params; > +}; > + > +struct dpni_rsp_get_port_cfg { > + uint32_t flags; > + uint32_t bit_params; > +}; > + > #pragma pack(pop) > #endif /* _FSL_DPNI_CMD_H */ > diff --git a/drivers/net/dpaa2/mc/fsl_dprtc.h b/drivers/net/dpaa2/mc/fsl_dprtc.h > index 49edb5a050..84ab158444 100644 > --- a/drivers/net/dpaa2/mc/fsl_dprtc.h > +++ b/drivers/net/dpaa2/mc/fsl_dprtc.h > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > - * Copyright 2019 NXP > + * Copyright 2019-2021 NXP > */ > #ifndef __FSL_DPRTC_H > #define __FSL_DPRTC_H > @@ -86,6 +86,23 @@ int dprtc_set_alarm(struct fsl_mc_io *mc_io, > uint16_t token, > uint64_t time); > > +struct dprtc_ext_trigger_status { > + uint64_t timestamp; > + uint8_t unread_valid_timestamp; > +}; > + > +int dprtc_get_ext_trigger_timestamp(struct fsl_mc_io *mc_io, > + uint32_t cmd_flags, > + uint16_t token, > + uint8_t id, > + struct dprtc_ext_trigger_status *status); > + > +int dprtc_set_fiper_loopback(struct fsl_mc_io *mc_io, > + uint32_t cmd_flags, > + uint16_t token, > + uint8_t id, > + uint8_t fiper_as_input); > + > /** > * struct dprtc_attr - Structure representing DPRTC attributes > * @id: DPRTC object ID > diff --git a/drivers/net/dpaa2/mc/fsl_dprtc_cmd.h b/drivers/net/dpaa2/mc/fsl_dprtc_cmd.h > index eca12ff5ee..61aaa4daab 100644 > --- a/drivers/net/dpaa2/mc/fsl_dprtc_cmd.h > +++ b/drivers/net/dpaa2/mc/fsl_dprtc_cmd.h > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) > - * Copyright 2019 NXP > + * Copyright 2019-2021 NXP > */ > #include > #ifndef _FSL_DPRTC_CMD_H > @@ -7,13 +7,15 @@ > > /* DPRTC Version */ > #define DPRTC_VER_MAJOR 2 > -#define DPRTC_VER_MINOR 1 > +#define DPRTC_VER_MINOR 3 > > /* Command versioning */ > #define DPRTC_CMD_BASE_VERSION 1 > +#define DPRTC_CMD_VERSION_2 2 > #define DPRTC_CMD_ID_OFFSET 4 > > #define DPRTC_CMD(id) (((id) << DPRTC_CMD_ID_OFFSET) | DPRTC_CMD_BASE_VERSION) > +#define DPRTC_CMD_V2(id) (((id) << DPRTC_CMD_ID_OFFSET) | DPRTC_CMD_VERSION_2) > > /* Command IDs */ > #define DPRTC_CMDID_CLOSE DPRTC_CMD(0x800) > @@ -39,6 +41,7 @@ > #define DPRTC_CMDID_SET_EXT_TRIGGER DPRTC_CMD(0x1d8) > #define DPRTC_CMDID_CLEAR_EXT_TRIGGER DPRTC_CMD(0x1d9) > #define DPRTC_CMDID_GET_EXT_TRIGGER_TIMESTAMP DPRTC_CMD(0x1dA) > +#define DPRTC_CMDID_SET_FIPER_LOOPBACK DPRTC_CMD(0x1dB) > > /* Macros for accessing command fields smaller than 1byte */ > #define DPRTC_MASK(field) \ > @@ -87,5 +90,23 @@ struct dprtc_rsp_get_api_version { > uint16_t major; > uint16_t minor; > }; > + > +struct dprtc_cmd_ext_trigger_timestamp { > + uint32_t pad; > + uint8_t id; > +}; > + > +struct dprtc_rsp_ext_trigger_timestamp { > + uint8_t unread_valid_timestamp; > + uint8_t pad1; > + uint16_t pad2; > + uint32_t pad3; > + uint64_t timestamp; > +}; > + > +struct dprtc_ext_trigger_cfg { > + uint8_t id; > + uint8_t fiper_as_input; > +}; > #pragma pack(pop) > #endif /* _FSL_DPRTC_CMD_H */