From patchwork Mon Sep 17 10:36:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 146844 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3602886ljw; Mon, 17 Sep 2018 03:38:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZsY/QjVE2WXaRk+fcRS/cANsbuvt8h6Khsqconl9nrpfo6Xer6r43D2NhNQVdowNBk5qH X-Received: by 2002:a50:9feb:: with SMTP id c98-v6mr41079625edf.130.1537180695821; Mon, 17 Sep 2018 03:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537180695; cv=none; d=google.com; s=arc-20160816; b=qxhaHBrr5SOMQpL+ly7oNjaSWP4G1VfYr/h0ttA5R2vGW6ALun0+GRBIu9Krk7HFXC Pq0HbbQTupZk3kOEk/WPn6dhniY9/nEjJtKIcUl0+hWA+ElcVUoy4HXggB9MxeETOKnB y3e/WqCNxPf6SHEXefJ6Lh0MGmyynBpUCoix/PhobtAuuPOUGiUqNheXWXA0MyQH3wTj YTftDviUQ/QDfE22WmukxIQgFK6wgMvJC1G1YJyH6ehH724iGo1D9e2ySKPXr14ZnEoi Gy6AQCBP1iQRUmjv6v/aXhJKpyg27r2p384VwOWrgH4Pwa4LG+PZTVzGp6i0MMN7yqFg SR7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=OgfsEgpUDou0TCT/7NURysbm/Wpe+bXIhRmutQ3oqtc=; b=YWhEHlv1dQ3VMv7YiPPxIhvBWMTxLnEkdL38TUsSNKNlpYWhb6hU8+M2q/daMyBqpT tb5SCsRlQQ0vs/x73aYDcV3fGCozPvFNteQmVB4hDQusFG1DztmZPH4KLyKKqTzvlGVY /dW3ou81GW5QuxU9LimChPzhw2NcWHg80sIrVxS7MGjjyLdfM7H8YM4DkJZXue2LKoEr /U9tskH7Uvsnj8dn3T3+wfw6VGn6oGJlFmssYRfEvrfcIC3JdQnVCQa3xqcQFsrgwJxi puRQIi3astAtBTa9U7Y4fD6zj8FB/4L6PEPKtiyUEKmizuS4DWgtL2olKvFL4wgMFNaC x55Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=UXASZQIM; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id a14si1454537edx.401.2018.09.17.03.38.15; Mon, 17 Sep 2018 03:38:15 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=UXASZQIM; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D86E458CB; Mon, 17 Sep 2018 12:37:55 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40067.outbound.protection.outlook.com [40.107.4.67]) by dpdk.org (Postfix) with ESMTP id 599424F93 for ; Mon, 17 Sep 2018 12:37:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OgfsEgpUDou0TCT/7NURysbm/Wpe+bXIhRmutQ3oqtc=; b=UXASZQIMPFCJWG+LtXTNRgt5okGnUPtWH87jDxC/yd1U31R0kNvoGL+rwHH7GMwaPet0zRSfQHP/Qp4hXb7Fx5liljmkE20y5ps/3MuAnxQxQ7o1Jd4bgx17LgNCYiNAjNEBM2DRe9JN0JdNQAVZDluEJz16iQSJ9yyjsPCo+9w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4673.eurprd04.prod.outlook.com (2603:10a6:208:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 10:37:49 +0000 From: Shreyansh Jain To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Hemant Agrawal Date: Mon, 17 Sep 2018 16:06:23 +0530 Message-Id: <20180917103631.32304-4-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180917103631.32304-1-shreyansh.jain@nxp.com> References: <20180917103631.32304-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0092.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::32) To AM0PR04MB4673.eurprd04.prod.outlook.com (2603:10a6:208:75::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 952cec03-8ee5-4e46-a676-08d61c899d93 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4673; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 3:UQJuwnWlUS3KBV+Xyosy9lSJJfNWyecqOICPPz5NAy6+3d81CEUkQMicaXrBFzjwY3B460KtdA5bU/iQ7J/LHQH51SjqRNKM57SfLZ6DK+wIJbrFAs0Tfu8n+nTRWzAjolm+5ePsz59XVPnNjj5HiUcDydr2D1F9TuqBW1ZIq2aHKX5iwsWvp6q7X3HRBf7xckB8xlbiFoDOqk4CyqCEPwLf+qyZIHMK7lK8H+X+C5xEo1+2/Weo54ZaDl2DV4Kq; 25:3vXpx7Ed/pGyEmkqeV+WYpFsXTf11kUPhZoJLcJNVDiDVV9LM8Em8/hBXllJ99lIq2PAP9rdL8M0wgbjWA9dKOYqNqKBjQIf8aoSrlH4BJfIsmme74zRwE7BUpUhktx/yzZpAkk+pVagaz3Upipm59Ty/d66Af/Kk4UJQSifWpe0N03EO4678EVlhd7yHKI1XlDvltYyVfZta6S+5rrUROOJdVFaREKEm8f++6WKp9jJzihy8YVelLUH2Xm1ARKwOCBTadbNpZk52udm8gtMaCWLArsjp/xJ3hEYpUPN8QfneC3FhWzeGRAlFMznvX2/5uLyM7uerX1c9INQiJSRTg==; 31:Uk+7DuctcQ61epeb90FUPdFrwM9TheW782KmR8PwfQyf4FYNgVPwUZ4ItXdvwIO2yjQ2ozQES3CcQqHPHJKCvU0+igOKlntPt24BaBs9AdBGdEV5N4HWjNyVrL7b5JL/3zD3POhGrnEi29LndH7FCbQPwt0v8uLcsGcRY0Pr+us8A41ef8UtJzBcNtmPCyWDA/3V4UERquXkBvX0uY6DsChwA0AXT/S567/3sy0bpig= X-MS-TrafficTypeDiagnostic: AM0PR04MB4673: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 20:aZ4Bvs0qh9ji6NNyKT67KPk2V5eC4nZbPFVPsRBwlupoPBol4z/up5s8jB4Q1NuwXFO8QM+iX6TTV0sdnBkpgqKYoNfU9jBKHaPMrnsV0/EcG5DmHiRlETQs+TNDclRP7aU0UFObfvP3ygDlnBg1XbQVignFOcrpjNQdWqyuI6U2/owFp+zuCarv+5FB64Dym2BaRpcdcBoj3AqxGLmFqWlYzHuzgTgG/7JhVBDIYT0iIIDHd1iLD+9p4rGo0ihB8ciWQhqQFnKlMDEVIz84Nk9eukux2W9yTYrPC86VzbiB66vFdHiiup2N9u4Mn+nEgXiOJ3bR5+l7CPLy3eI9Kez/FQuf2Gwe/QAhnrb9YahoGtP3kwST+H8R37Si4Sxx7YhrX8IpyTvHBuMj3//c5Gd+w2jgtIZ6ocI9ir9k2A2bGwla8UgjAh12F5AZJcjaTCYwu/kBiwGJtxZY6dWmA2Ol5gn3rpB3qQ2FLzQW/oIK58GUE2jSG8JLdsxy8zXC; 4:rWWOdgcfqRXPZFUrVDUvEmNwshPtvzSjftCCW81et5HJenF/Bo8dIQSvEAdnTDM/U31Wk7LV+zAJyg2Xr989o8JPrTwlllH2uLOim9WW4WuGZWoHaOLorIKjpAL2UvtAZySoiWpNiiBwRET+BeJitPyggb5LMRt34EjwIFkDkWXswABQtoFUwWR+w4iJUceKBcOkUpzS2nanlHldMDcaVZYvltkdtxrDamnQvZl6dDFMwti8sIUHAGuutosqcH/saHNzz7BJdSyG/MlE4gOXjgGyF6YGGxHRGE276ulhdMXAubzDTzhan/5+xGdPXiBES2YOMdBEcxHh449bt/egFVuiBrPVpeBfAv0zIgE5RmI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(103651359005742); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:AM0PR04MB4673; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4673; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(366004)(376002)(39860400002)(199004)(189003)(16526019)(48376002)(186003)(1076002)(3846002)(5660300001)(486006)(6506007)(386003)(16586007)(316002)(36756003)(14444005)(44832011)(5009440100003)(52116002)(6116002)(2616005)(76176011)(446003)(51416003)(11346002)(956004)(476003)(53946003)(6512007)(47776003)(106356001)(25786009)(50226002)(2906002)(68736007)(105586002)(81156014)(81166006)(7736002)(6666003)(305945005)(8676002)(8936002)(4326008)(575784001)(86362001)(97736004)(6486002)(478600001)(50466002)(66066001)(26005)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4673; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4673; 23:XUrOROCXh7CRAiIsw3Guq5a0eNIDzpD1oLB3/ZrkX?= gE97j6mlUrmYvZF1YOGAyxHVfTfbm4wCXkIx4+PRHoL5Rl5GzqLj19JZ8DRxZv35u5Zy0LAcQgD4JPyRHCvT22iKcfmN9i0vaNLtIvpG5U7SHPfRq3DrcZX5/J4YVJuejnKwCgIz/2DVMth/7XXCqiLSUZ8893rBgKmltuMT1+taYYDePDwmOzzq59ki/MRfP0vsjcBugFcPIn0UK93eU4gLs9yTkLwLXV53VZis2dxfVCISllhHHHRh/62EWQK7vk/2J4EOQeoutOBr6C+LROXeJcTooadGw7QoUCIxp4R4jMUfm/sYtfANcSdX0k5nDld5vfOKsRdEfKUaalbIy8BVhyE0XhyD7d1Ec1TG+Ezu2WpIb4Pjh/3oQRRiHZcclVrI4yMQ+DV58Z5TpuVVSa92UzKR7UfTv0q6pdcqV+SZ3mylo0hPODyD88AbdyyOE/5CNilNyKkwpnIK9TmrnqAC0SzUkvat4H+9zlAlTYMk4wFVSmbiqnnOIfXWyuFNKqrta6grObYnOlrgjyBroC1ypmk+oKmNNDfnX7Ud5iGPeFsPZvbwsNbk0ZmxNK2lPlx/eoNFREpeLLONrxXiqB4YLSIbq39OyR7tsxCa1TKXeRCSB/uvX5CfOqdW/k0wcdBc9rklK92bKNlkkSp+KaOOTUNqAGo3SW1+qU2F4w2JkhYv6Zh6C9lbsZpO0pAxYPJENFVj4aXSOJDkc8YYoF+1H82ECk81IqzfpvJLo5e3KONXslGTPFb91K12/ye1PPTqLIkAL5I3FVEq2k4XuO76RLvd5ujmSn2s8UzIi3yqA6fZptMWDwrKEQjuwOYvX84Yuvvec3+bYjDbJNvNrO79wjeWbRHzLmQpejFIbu7n64/jEDf/6qn/ScxpXJ1/p0NgWtMRunc8Ku/+wX9XXUYi6/q6bWHpD8Wgky3mmQdXMFxyhGGJIjU/lmqw9v9JRCE9COzmc3xDDwC6jZa3FWTV/+fYBwicQtkDgdv17usJXSOxh5yiC3krrc1YryTKVLkoQsyj5NQZjpqkC0CZ2IJg9sizU30vdWwQLxzkcnI7jkWqJMFR3KaPZNv4Zw/DXXqbBOYci3/GtRDk0bEBCN9qVzA4iGNb8Ks7LhvsbUDw8GfUkGRrnsPaj7SVHxbmiFXKb9Ox/ypM/wG8aFukfoBRVfuwKnfQrSCKnte7Zovco3BdPqxL9R7ct9Ry3uwy18pF4PHzZ08f68TGwwNzU9QtZHeGxRmcA8CCwZ0G4HRtDcdwKkWPF1GT2aMeZHG6Ww= X-Microsoft-Antispam-Message-Info: xM+GYJPy32BW6G4r9T8jUjeKw+D9RDuJhhssDnPVPCuFyfeTTF0BULrNxH9Khp1KkVtbgEe1JnWibo+1mM6Ey/vKa5TIH3/Cg79pR4ox71iUAoLD/XfAM3WOthitlFPXGiD8xj/iLRE7rCkN68XYC3s2uQsTu3ZiCsG/+pzFLCIk+AF+3ZVlIO8A/Md8wu/bZT6SUdA/yVUZEw+/9uAsRwKDgXa8PN8wTUodxLPcfe42mM3Mq8pD+joGYZDn1Z/UPiSOvhhgn1VNfwOiOMatoC+wIhxA66uwHQ/kpr6N/4RavZlLkV7831HpFtWx4sYR2R1B1/thLd0vHwTpGlKZDoywP/06en2yccUx5fNeWJY= X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 6:BiP3bLMcpEIGeAOLpQNMKIOpa06eMDGbnsi9/vXzti1/bZ4YwnJkXsW9xYRq5h2u5NbiAyf/4F74zEz8VXhlHKolXgqWe4mRR3I5BmdRnGHUoUO5Tnh+B2nxy3xXhsJ3Iv8Zcgwv5jk9X8qbkjlMdM31ig3naq5mzn9HyZCbD14voAbngCgIDbMuABOWna3rrFndxEEjeCaeJ82IasueLeOX1gBKKyjSSUZl+d5+DrWy9RsDs58r9Gi65r5CyK4xQBc0MSQCs2DOj2umRIwGlR5uT2vJK82TmuDtjPNXu2DEXKs8o9SfMthWb2jWVx6E+Zl+M8XVjjr8/tbAmSU+o38bgOzyjQLisT1KsA6a2jQWfGQmiW8k8N5O2f5LHMlSSXn7X5LM0x/jxS/70VbERHSYjjjAeGLkSB1Ke0OZNB3ZHkhY0EOIMzSM/H0FDKXnz7CHicT1NCKdZrirKn3AfQ==; 5:O98eKxEqv+d5phQIaCYfOmlaDDAXmQ/ffkNr6p99rvpG4fly94mY3DUBQq0HLoXy0CqMwzaz90Ynejtv/FoY81cxL3xhp0f8IBgTLwZbSMrZblF+m3uFs9RHXQHbyjTfEC8I2qoPx9y+wjAiQNieNcz3xeAHa46dhH0yVuCeb/0=; 7:ijWxmasPYi8qjCMbrnH9tzOwBCbzOG7sMXSSwT/WSXgAT1cO3If1N+ijbaBEV2PN1dRpu306Z5EXuM6hyVP1g06kOs/h0FtVM6DPakOM8XvU/2D/tMPYgm0Bd6L1VDkhlAg6urMHBprm5veiPEOCIxQ3bGANgrjTV2wIhgaHnEIxPpp1al/TsPzMBPSY3yCwzY1D82Sjjbdzealyn/8bls/yBvrRM2udTZXBj81ZhbUhWpTsqFNZmSPoOVkGJVhE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 10:37:49.1956 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 952cec03-8ee5-4e46-a676-08d61c899d93 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4673 Subject: [dpdk-dev] [PATCH 03/11] net/dpaa2: upgrade dpni to mc FW APIs to 10.10.0 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: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 21 +- drivers/net/dpaa2/mc/dpni.c | 22 +- drivers/net/dpaa2/mc/fsl_dpni.h | 343 +++++++++++++++------------- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 17 +- drivers/net/dpaa2/mc/fsl_net.h | 2 +- 5 files changed, 229 insertions(+), 176 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 8d3d54bfe..7ae74c65d 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -219,6 +219,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv = dev->data->dev_private; uint16_t dist_idx; uint32_t vq_id; + uint8_t num_rxqueue_per_tc; struct dpaa2_queue *mc_q, *mcq; uint32_t tot_queues; int i; @@ -226,6 +227,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + num_rxqueue_per_tc = (priv->nb_rx_queues / priv->num_rx_tc); tot_queues = priv->nb_rx_queues + priv->nb_tx_queues; mc_q = rte_malloc(NULL, sizeof(struct dpaa2_queue) * tot_queues, RTE_CACHE_LINE_SIZE); @@ -264,8 +266,8 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) vq_id = 0; for (dist_idx = 0; dist_idx < priv->nb_rx_queues; dist_idx++) { mcq = (struct dpaa2_queue *)priv->rx_vq[vq_id]; - mcq->tc_index = DPAA2_DEF_TC; - mcq->flow_id = dist_idx; + mcq->tc_index = dist_idx / num_rxqueue_per_tc; + mcq->flow_id = dist_idx % num_rxqueue_per_tc; vq_id++; } @@ -428,7 +430,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; struct dpaa2_queue *dpaa2_q; struct dpni_queue cfg; - uint8_t options = 0; + uint8_t options = 0, num_rxqueue_per_tc; uint8_t flow_id; uint32_t bpid; int ret; @@ -448,8 +450,10 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id]; dpaa2_q->mb_pool = mb_pool; /**< mbuf pool to populate RX ring. */ + num_rxqueue_per_tc = (priv->nb_rx_queues / priv->num_rx_tc); + /*Get the flow id from given VQ id*/ - flow_id = rx_queue_id % priv->nb_rx_queues; + flow_id = rx_queue_id % num_rxqueue_per_tc; memset(&cfg, 0, sizeof(struct dpni_queue)); options = options | DPNI_QUEUE_OPT_USER_CTX; @@ -1793,7 +1797,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) struct dpni_attr attr; struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; struct dpni_buffer_layout layout; - int ret, hw_id; + int ret, hw_id, i; PMD_INIT_FUNC_TRACE(); @@ -1839,11 +1843,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->num_rx_tc = attr.num_rx_tcs; - /* Resetting the "num_rx_queues" to equal number of queues in first TC - * as only one TC is supported on Rx Side. Once Multiple TCs will be - * in use for Rx processing then this will be changed or removed. - */ - priv->nb_rx_queues = attr.num_queues; + for (i = 0; i < attr.num_rx_tcs; i++) + priv->nb_rx_queues += attr.num_queues; /* Using number of TX queues as number of TX TCs */ priv->nb_tx_queues = attr.num_tx_tcs; diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index 9f228169a..6f5393f26 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -121,6 +121,7 @@ int dpni_create(struct fsl_mc_io *mc_io, cmd_params->num_queues = cfg->num_queues; cmd_params->num_tcs = cfg->num_tcs; cmd_params->mac_filter_entries = cfg->mac_filter_entries; + cmd_params->num_rx_tcs = cfg->num_rx_tcs; cmd_params->vlan_filter_entries = cfg->vlan_filter_entries; cmd_params->qos_entries = cfg->qos_entries; cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries); @@ -664,9 +665,14 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpni_rsp_get_buffer_layout *)cmd.params; - layout->pass_timestamp = dpni_get_field(rsp_params->flags, PASS_TS); - layout->pass_parser_result = dpni_get_field(rsp_params->flags, PASS_PR); - layout->pass_frame_status = dpni_get_field(rsp_params->flags, PASS_FS); + layout->pass_timestamp = + (int)dpni_get_field(rsp_params->flags, PASS_TS); + layout->pass_parser_result = + (int)dpni_get_field(rsp_params->flags, PASS_PR); + layout->pass_frame_status = + (int)dpni_get_field(rsp_params->flags, PASS_FS); + layout->pass_sw_opaque = + (int)dpni_get_field(rsp_params->flags, PASS_SWO); layout->private_data_size = le16_to_cpu(rsp_params->private_data_size); layout->data_align = le16_to_cpu(rsp_params->data_align); layout->data_head_room = le16_to_cpu(rsp_params->head_room); @@ -702,10 +708,11 @@ int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpni_cmd_set_buffer_layout *)cmd.params; cmd_params->qtype = qtype; - cmd_params->options = cpu_to_le16(layout->options); + cmd_params->options = cpu_to_le16((uint16_t)layout->options); dpni_set_field(cmd_params->flags, PASS_TS, layout->pass_timestamp); dpni_set_field(cmd_params->flags, PASS_PR, layout->pass_parser_result); dpni_set_field(cmd_params->flags, PASS_FS, layout->pass_frame_status); + dpni_set_field(cmd_params->flags, PASS_SWO, layout->pass_sw_opaque); cmd_params->private_data_size = cpu_to_le16(layout->private_data_size); cmd_params->data_align = cpu_to_le16(layout->data_align); cmd_params->head_room = cpu_to_le16(layout->data_head_room); @@ -1471,6 +1478,9 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, dpni_set_field(cmd_params->keep_hash_key, KEEP_HASH_KEY, cfg->fs_cfg.keep_hash_key); + dpni_set_field(cmd_params->keep_hash_key, + KEEP_ENTRIES, + cfg->fs_cfg.keep_entries); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -1764,8 +1774,8 @@ int dpni_get_queue(struct fsl_mc_io *mc_io, * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @page: Selects the statistics page to retrieve, see - * DPNI_GET_STATISTICS output. Pages are numbered 0 to 2. - * @param: Custom parameter for some pages used to select + * DPNI_GET_STATISTICS output. Pages are numbered 0 to 3. + * @param: Custom parameter for some pages used to select * a certain statistic source, for example the TC. * @stat: Structure containing the statistics * diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h index f0edcd270..40f045c9d 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni.h +++ b/drivers/net/dpaa2/mc/fsl_dpni.h @@ -77,6 +77,11 @@ struct fsl_mc_io; */ #define DPNI_OPT_NO_FS 0x000020 +/** + * All Tx traffic classes will use a single sender (ignore num_queueus for tx) + */ +#define DPNI_OPT_SINGLE_SENDER 0x000100 + int dpni_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpni_id, @@ -88,71 +93,74 @@ int dpni_close(struct fsl_mc_io *mc_io, /** * struct dpni_cfg - Structure representing DPNI configuration - * @mac_addr: Primary MAC address - * @adv: Advanced parameters; default is all zeros; - * use this structure to change default settings + * @options: Any combination of the following options: + * DPNI_OPT_TX_FRM_RELEASE + * DPNI_OPT_NO_MAC_FILTER + * DPNI_OPT_HAS_POLICING + * DPNI_OPT_SHARED_CONGESTION + * DPNI_OPT_HAS_KEY_MASKING + * DPNI_OPT_NO_FS + * DPNI_OPT_SINGLE_SENDER + * @fs_entries: Number of entries in the flow steering table. + * This table is used to select the ingress queue for + * ingress traffic, targeting a GPP core or another. + * In addition it can be used to discard traffic that + * matches the set rule. It is either an exact match table + * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING + * bit in OPTIONS field. This field is ignored if + * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise, + * value 0 defaults to 64. Maximum supported value is 1024. + * Note that the total number of entries is limited on the + * SoC to as low as 512 entries if TCAM is used. + * @vlan_filter_entries: Number of entries in the VLAN address filtering + * table. This is an exact match table used to filter + * ingress traffic based on VLAN IDs. Value 0 disables VLAN + * filtering. Maximum supported value is 16. + * @mac_filter_entries: Number of entries in the MAC address filtering + * table. This is an exact match table and allows both + * unicast and multicast entries. The primary MAC address + * of the network interface is not part of this table, + * this contains only entries in addition to it. This + * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in + * OPTIONS field. Otherwise, value 0 defaults to 80. + * Maximum supported value is 80. + * @num_queues: Number of Tx and Rx queues used for traffic + * distribution. This is orthogonal to QoS and is only + * used to distribute traffic to multiple GPP cores. + * This configuration affects the number of Tx queues + * (logical FQs, all associated with a single CEETM queue), + * Rx queues and Tx confirmation queues, if applicable. + * Value 0 defaults to one queue. Maximum supported value + * is 8. + * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. + * TCs can have different priority levels for the purpose + * of Tx scheduling (see DPNI_SET_TX_PRIORITIES), different + * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM + * queues for traffic classes (including class queues on + * Tx). Value 0 defaults to one TC. Maximum supported value + * is 16. There are maximum 16 TCs for Tx and 8 TCs for Rx. + * When num_tcs>8 Tx will use this value but Rx will have + * only 8 traffic classes. + * @num_rx_tcs: if set to other value than zero represents number + * of TCs used for Rx. Maximum value is 8. If set to zero the + * number of Rx TCs will be initialized with the value provided + * in num_tcs parameter. + * @qos_entries: Number of entries in the QoS classification table. This + * table is used to select the TC for ingress traffic. It + * is either an exact match or a TCAM table, depending on + * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This + * field is ignored if the DPNI has a single TC. Otherwise, + * a value of 0 defaults to 64. Maximum supported value + * is 64. */ struct dpni_cfg { - /** - * @options: Any combination of the following options: - * DPNI_OPT_TX_FRM_RELEASE - * DPNI_OPT_NO_MAC_FILTER - * DPNI_OPT_HAS_POLICING - * DPNI_OPT_SHARED_CONGESTION - * DPNI_OPT_HAS_KEY_MASKING - * DPNI_OPT_NO_FS - * @fs_entries: Number of entries in the flow steering table. - * This table is used to select the ingress queue for - * ingress traffic, targeting a GPP core or another. - * In addition it can be used to discard traffic that - * matches the set rule. It is either an exact match table - * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING - * bit in OPTIONS field. This field is ignored if - * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise, - * value 0 defaults to 64. Maximum supported value is 1024. - * Note that the total number of entries is limited on the - * SoC to as low as 512 entries if TCAM is used. - * @vlan_filter_entries: Number of entries in the VLAN address filtering - * table. This is an exact match table used to filter - * ingress traffic based on VLAN IDs. Value 0 disables VLAN - * filtering. Maximum supported value is 16. - * @mac_filter_entries: Number of entries in the MAC address filtering - * table. This is an exact match table and allows both - * unicast and multicast entries. The primary MAC address - * of the network interface is not part of this table, - * this contains only entries in addition to it. This - * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in - * OPTIONS field. Otherwise, value 0 defaults to 80. - * Maximum supported value is 80. - * @num_queues: Number of Tx and Rx queues used for traffic - * distribution. This is orthogonal to QoS and is only - * used to distribute traffic to multiple GPP cores. - * This configuration affects the number of Tx queues - * (logical FQs, all associated with a single CEETM queue), - * Rx queues and Tx confirmation queues, if applicable. - * Value 0 defaults to one queue. Maximum supported value - * is 8. - * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. - * TCs can have different priority levels for the purpose - * of Tx scheduling (see DPNI_SET_TX_SELECTION), different - * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM - * queues for traffic classes (including class queues on - * Tx). Value 0 defaults to one TC. Maximum supported value - * is 8. - * @qos_entries: Number of entries in the QoS classification table. This - * table is used to select the TC for ingress traffic. It - * is either an exact match or a TCAM table, depending on - * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This - * field is ignored if the DPNI has a single TC. Otherwise, - * a value of 0 defaults to 64. Maximum supported value - * is 64. - */ uint32_t options; uint16_t fs_entries; uint8_t vlan_filter_entries; uint8_t mac_filter_entries; uint8_t num_queues; uint8_t num_tcs; + uint8_t num_rx_tcs; uint8_t qos_entries; }; @@ -172,17 +180,14 @@ int dpni_destroy(struct fsl_mc_io *mc_io, * @num_dpbp: Number of DPBPs * @pools: Array of buffer pools parameters; The number of valid entries * must match 'num_dpbp' value + * @pools.dpbp_id: DPBP object ID + * @pools.priority: Priority mask that indicates TC's used with this buffer. + * I set to 0x00 MC will assume value 0xff. + * @pools.buffer_size: Buffer size + * @pools.backup_pool: Backup pool */ struct dpni_pools_cfg { uint8_t num_dpbp; - /** - * struct pools - Buffer pools parameters - * @dpbp_id: DPBP object ID - * @priority: priority mask that indicates TC's used with this buffer. - * I set to 0x00 MC will assume value 0xff. - * @buffer_size: Buffer size - * @backup_pool: Backup pool - */ struct { int dpbp_id; uint8_t priority_mask; @@ -296,6 +301,8 @@ int dpni_clear_irq_status(struct fsl_mc_io *mc_io, * variants, * - 0x422 - WRIOP version 1.1.2, used on LS1088 and * variants. + * - 0xC00 - WRIOP version 3.0.0, used on LX2160 and + * variants. */ struct dpni_attr { uint32_t options; @@ -320,6 +327,13 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io, * DPNI errors */ +/** + * Discard error. When set all discarded frames in wriop will be enqueued to + * error queue. To be used in dpni_set_errors_behavior() only if error_action + * parameter is set to DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE. + */ +#define DPNI_ERROR_DISC 0x80000000 + /** * Extract out of frame header error */ @@ -408,6 +422,10 @@ int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, * Select to modify the data-tail-room setting */ #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM 0x00000040 +/** + * Select to modify the sw-opaque value setting + */ +#define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE 0x00000080 /** * struct dpni_buffer_layout - Structure representing DPNI buffer layout @@ -427,6 +445,7 @@ struct dpni_buffer_layout { int pass_timestamp; int pass_parser_result; int pass_frame_status; + int pass_sw_opaque; uint16_t private_data_size; uint16_t data_align; uint16_t data_head_room; @@ -501,16 +520,48 @@ int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io, #define DPNI_STATISTICS_CNT 7 +/** + * union dpni_statistics - Union describing the DPNI statistics + * @page_0: Page_0 statistics structure + * @page_0.ingress_all_frames: Ingress frame count + * @page_0.ingress_all_bytes: Ingress byte count + * @page_0.ingress_multicast_frames: Ingress multicast frame count + * @page_0.ingress_multicast_bytes: Ingress multicast byte count + * @page_0.ingress_broadcast_frames: Ingress broadcast frame count + * @page_0.ingress_broadcast_bytes: Ingress broadcast byte count + * @page_1: Page_1 statistics structure + * @page_1.egress_all_frames: Egress frame count + * @page_1.egress_all_bytes: Egress byte count + * @page_1.egress_multicast_frames: Egress multicast frame count + * @page_1.egress_multicast_bytes: Egress multicast byte count + * @page_1.egress_broadcast_frames: Egress broadcast frame count + * @page_1.egress_broadcast_bytes: Egress broadcast byte count + * @page_2: Page_2 statistics structure + * @page_2.ingress_filtered_frames: Ingress filtered frame count + * @page_2.ingress_discarded_frames: Ingress discarded frame count + * @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to + * lack of buffers + * @page_2.egress_discarded_frames: Egress discarded frame count + * @page_2.egress_confirmed_frames: Egress confirmed frame count + * @page_3: Page_3 statistics structure with values for the selected TC + * @page_3.ceetm_dequeue_bytes: Cumulative count of the number of bytes dequeued + * @page_3.ceetm_dequeue_frames: Cumulative count of the number of frames + * dequeued + * @page_3.ceetm_reject_bytes: Cumulative count of the number of bytes in all + * frames whose enqueue was rejected + * @page_3.ceetm_reject_frames: Cumulative count of all frame enqueues rejected + * @page_4: congestion point drops for seleted TC + * @page_4.cgr_reject_frames: number of rejected frames due to congestion point + * @page_4.cgr_reject_bytes: number of rejected bytes due to congestion point + * @page_5: policer statistics per TC + * @page_5.policer_cnt_red: NUmber of red colored frames + * @page_5.policer_cnt_yellow: number of yellow colored frames + * @page_5.policer_cnt_green: number of green colored frames + * @page_5.policer_cnt_re_red: number of recolored red frames + * @page_5.policer_cnt_re_yellow: number of recolored yellow frames + * @raw: raw statistics structure, used to index counters + */ union dpni_statistics { - /** - * struct page_0 - Page_0 statistics structure - * @ingress_all_frames: Ingress frame count - * @ingress_all_bytes: Ingress byte count - * @ingress_multicast_frames: Ingress multicast frame count - * @ingress_multicast_bytes: Ingress multicast byte count - * @ingress_broadcast_frames: Ingress broadcast frame count - * @ingress_broadcast_bytes: Ingress broadcast byte count - */ struct { uint64_t ingress_all_frames; uint64_t ingress_all_bytes; @@ -519,15 +570,6 @@ union dpni_statistics { uint64_t ingress_broadcast_frames; uint64_t ingress_broadcast_bytes; } page_0; - /** - * struct page_1 - Page_1 statistics structure - * @egress_all_frames: Egress frame count - * @egress_all_bytes: Egress byte count - * @egress_multicast_frames: Egress multicast frame count - * @egress_multicast_bytes: Egress multicast byte count - * @egress_broadcast_frames: Egress broadcast frame count - * @egress_broadcast_bytes: Egress broadcast byte count - */ struct { uint64_t egress_all_frames; uint64_t egress_all_bytes; @@ -536,15 +578,6 @@ union dpni_statistics { uint64_t egress_broadcast_frames; uint64_t egress_broadcast_bytes; } page_1; - /** - * struct page_2 - Page_2 statistics structure - * @ingress_filtered_frames: Ingress filtered frame count - * @ingress_discarded_frames: Ingress discarded frame count - * @ingress_nobuffer_discards: Ingress discarded frame count due to - * lack of buffers - * @egress_discarded_frames: Egress discarded frame count - * @egress_confirmed_frames: Egress confirmed frame count - */ struct { uint64_t ingress_filtered_frames; uint64_t ingress_discarded_frames; @@ -552,26 +585,23 @@ union dpni_statistics { uint64_t egress_discarded_frames; uint64_t egress_confirmed_frames; } page_2; - /** - * struct page_3 - Page_3 statistics structure with values for the - * selected TC - * @ceetm_dequeue_bytes: Cumulative count of the number of bytes - * dequeued - * @ceetm_dequeue_frames: Cumulative count of the number of frames - * dequeued - * @ceetm_reject_bytes: Cumulative count of the number of bytes in all - * frames whose enqueue was rejected - * @ceetm_reject_frames: Cumulative count of all frame enqueues rejected - */ struct { uint64_t ceetm_dequeue_bytes; uint64_t ceetm_dequeue_frames; uint64_t ceetm_reject_bytes; uint64_t ceetm_reject_frames; } page_3; - /** - * struct raw - raw statistics structure, used to index counters - */ + struct { + uint64_t cgr_reject_frames; + uint64_t cgr_reject_bytes; + } page_4; + struct { + uint64_t policer_cnt_red; + uint64_t policer_cnt_yellow; + uint64_t policer_cnt_green; + uint64_t policer_cnt_re_red; + uint64_t policer_cnt_re_yellow; + } page_5; struct { uint64_t counter[DPNI_STATISTICS_CNT]; } raw; @@ -750,11 +780,20 @@ enum dpni_fs_miss_action { * struct dpni_fs_tbl_cfg - Flow Steering table configuration * @miss_action: Miss action selection * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID' + * @keep_hash_key: used only when miss_action is set to DPNI_FS_MISS_HASH. When + * set to one unclassified frames will be distributed according to previous + * used hash key. If set to zero hash key will be replaced with the key + * provided for flow steering. + * @keep_entries: if set to one command will not delete the entries that already + * exist into FS table. Use this option with caution: if the table + * entries are not compatible with the distribution key the packets + * will not be classified properly. */ struct dpni_fs_tbl_cfg { enum dpni_fs_miss_action miss_action; uint16_t default_flow_id; char keep_hash_key; + uint8_t keep_entries; }; /** @@ -915,34 +954,52 @@ int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, /** * struct dpni_queue - Queue structure - * @user_context: User data, presented to the user along with any frames - * from this queue. Not relevant for Tx queues. + * @destination - Destination structure + * @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0. + * Identifies either a DPIO or a DPCON object. + * Not relevant for Tx queues. + * @destination.type: May be one of the following: + * 0 - No destination, queue can be manually + * queried, but will not push traffic or + * notifications to a DPIO; + * 1 - The destination is a DPIO. When traffic + * becomes available in the queue a FQDAN + * (FQ data available notification) will be + * generated to selected DPIO; + * 2 - The destination is a DPCON. The queue is + * associated with a DPCON object for the + * purpose of scheduling between multiple + * queues. The DPCON may be independently + * configured to generate notifications. + * Not relevant for Tx queues. + * @destination.hold_active: Hold active, maintains a queue scheduled for longer + * in a DPIO during dequeue to reduce spread of traffic. + * Only relevant if queues are + * not affined to a single DPIO. + * @user_context: User data, presented to the user along with any frames + * from this queue. Not relevant for Tx queues. + * @flc: FD FLow Context structure + * @flc.value: Default FLC value for traffic dequeued from + * this queue. Please check description of FD + * structure for more information. + * Note that FLC values set using dpni_add_fs_entry, + * if any, take precedence over values per queue. + * @flc.stash_control: Boolean, indicates whether the 6 lowest + * - significant bits are used for stash control. + * significant bits are used for stash control. If set, the 6 + * least significant bits in value are interpreted as follows: + * - bits 0-1: indicates the number of 64 byte units of context + * that are stashed. FLC value is interpreted as a memory address + * in this case, excluding the 6 LS bits. + * - bits 2-3: indicates the number of 64 byte units of frame + * annotation to be stashed. Annotation is placed at FD[ADDR]. + * - bits 4-5: indicates the number of 64 byte units of frame + * data to be stashed. Frame data is placed at FD[ADDR] + + * FD[OFFSET]. + * For more details check the Frame Descriptor section in the + * hardware documentation. */ struct dpni_queue { - /** - * struct destination - Destination structure - * @id: ID of the destination, only relevant if DEST_TYPE is > 0. - * Identifies either a DPIO or a DPCON object. - * Not relevant for Tx queues. - * @type: May be one of the following: - * 0 - No destination, queue can be manually - * queried, but will not push traffic or - * notifications to a DPIO; - * 1 - The destination is a DPIO. When traffic - * becomes available in the queue a FQDAN - * (FQ data available notification) will be - * generated to selected DPIO; - * 2 - The destination is a DPCON. The queue is - * associated with a DPCON object for the - * purpose of scheduling between multiple - * queues. The DPCON may be independently - * configured to generate notifications. - * Not relevant for Tx queues. - * @hold_active: Hold active, maintains a queue scheduled for longer - * in a DPIO during dequeue to reduce spread of traffic. - * Only relevant if queues are - * not affined to a single DPIO. - */ struct { uint16_t id; enum dpni_dest type; @@ -950,28 +1007,6 @@ struct dpni_queue { uint8_t priority; } destination; uint64_t user_context; - /** - * struct flc - FD FLow Context structure - * @value: Default FLC value for traffic dequeued from - * this queue. Please check description of FD - * structure for more information. - * Note that FLC values set using dpni_add_fs_entry, - * if any, take precedence over values per queue. - * @stash_control: Boolean, indicates whether the 6 lowest - * - significant bits are used for stash control. - * significant bits are used for stash control. If set, the 6 - * least significant bits in value are interpreted as follows: - * - bits 0-1: indicates the number of 64 byte units of context - * that are stashed. FLC value is interpreted as a memory address - * in this case, excluding the 6 LS bits. - * - bits 2-3: indicates the number of 64 byte units of frame - * annotation to be stashed. Annotation is placed at FD[ADDR]. - * - bits 4-5: indicates the number of 64 byte units of frame - * data to be stashed. Frame data is placed at FD[ADDR] + - * FD[OFFSET]. - * For more details check the Frame Descriptor section in the - * hardware documentation. - */ struct { uint64_t value; char stash_control; diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h index eb3e99878..fe0915968 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h @@ -9,19 +9,21 @@ /* DPNI Version */ #define DPNI_VER_MAJOR 7 -#define DPNI_VER_MINOR 3 +#define DPNI_VER_MINOR 7 #define DPNI_CMD_BASE_VERSION 1 #define DPNI_CMD_VERSION_2 2 +#define DPNI_CMD_VERSION_3 3 #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) /* Command IDs */ #define DPNI_CMDID_OPEN DPNI_CMD(0x801) #define DPNI_CMDID_CLOSE DPNI_CMD(0x800) -#define DPNI_CMDID_CREATE DPNI_CMD(0x901) +#define DPNI_CMDID_CREATE DPNI_CMD_V2(0x901) #define DPNI_CMDID_DESTROY DPNI_CMD(0x981) #define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01) @@ -65,7 +67,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_V2(0x235) +#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V3(0x235) #define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V2(0x25D) #define DPNI_CMDID_RESET_STATISTICS DPNI_CMD(0x25E) @@ -76,8 +78,8 @@ #define DPNI_CMDID_GET_PORT_MAC_ADDR DPNI_CMD(0x263) -#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD(0x264) -#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD(0x265) +#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD_V2(0x264) +#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD_V2(0x265) #define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD(0x267) #define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD(0x268) @@ -113,6 +115,7 @@ struct dpni_cmd_create { uint8_t qos_entries; uint8_t pad3; uint16_t fs_entries; + uint8_t num_rx_tcs; }; struct dpni_cmd_destroy { @@ -228,6 +231,8 @@ struct dpni_cmd_set_errors_behavior { #define DPNI_PASS_PR_SIZE 1 #define DPNI_PASS_FS_SHIFT 2 #define DPNI_PASS_FS_SIZE 1 +#define DPNI_PASS_SWO_SHIFT 3 +#define DPNI_PASS_SWO_SIZE 1 struct dpni_cmd_get_buffer_layout { uint8_t qtype; @@ -415,6 +420,8 @@ struct dpni_cmd_set_tx_priorities { #define DPNI_MISS_ACTION_SIZE 4 #define DPNI_KEEP_HASH_KEY_SHIFT 7 #define DPNI_KEEP_HASH_KEY_SIZE 1 +#define DPNI_KEEP_ENTRIES_SHIFT 6 +#define DPNI_KEEP_ENTRIES_SIZE 1 struct dpni_cmd_set_rx_tc_dist { uint16_t dist_size; diff --git a/drivers/net/dpaa2/mc/fsl_net.h b/drivers/net/dpaa2/mc/fsl_net.h index 964870ba9..0dc0131bb 100644 --- a/drivers/net/dpaa2/mc/fsl_net.h +++ b/drivers/net/dpaa2/mc/fsl_net.h @@ -180,7 +180,7 @@ #define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN (NH_FLD_SCTP_CHUNK_DATA_TYPE << 5) #define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID (NH_FLD_SCTP_CHUNK_DATA_TYPE << 6) #define NH_FLD_SCTP_CHUNK_DATA_UNORDERED (NH_FLD_SCTP_CHUNK_DATA_TYPE << 7) -#define NH_FLD_SCTP_CHUNK_DATA_BEGGINNING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) +#define NH_FLD_SCTP_CHUNK_DATA_BEGGINING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) #define NH_FLD_SCTP_CHUNK_DATA_END (NH_FLD_SCTP_CHUNK_DATA_TYPE << 9) #define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS \ ((NH_FLD_SCTP_CHUNK_DATA_TYPE << 10) - 1)