From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0050.outbound.protection.outlook.com [104.47.37.50]) by dpdk.org (Postfix) with ESMTP id 26EAB3237 for ; Tue, 19 Dec 2017 19:03:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SS97MnJGBel5TWzD9TWcjMbomomLc3BLGeMyby9NK1k=; b=ZycRk5jK6CPPwv3sD2oxG0x0ihfpC1EPnqua4sOdO7rgeAWMup5PyWwBj5sUMcdU0fvPPik5r6Nx782tdoU7L+PyeEiw8Z6+jfgBDzFrcsWZbhFz0MrrNmmmoMxTMwZvyMP5luc6x2KggEtDTg9TNYEfKVdbesl88l2K3svjUvo= Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 18:02:59 +0000 From: Pavan Nikhilesh To: santosh.shukla@caviumnetworks.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 19 Dec 2017 23:31:44 +0530 Message-Id: <20171219180145.1858-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171128145855.27106-1-pbhagavatula@caviumnetworks.com> References: <20171128145855.27106-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR06CA0169.apcprd06.prod.outlook.com (10.175.208.23) To CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: def5b19e-6631-425f-c6b2-08d5470abe68 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153051); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:egHthKOqf0bXdt/7BiliuaeO1o2zCoytFHoRrsrUByorKZ2wXo1DWe1qWQ3Jwi1FYQdW85kn8Jtde42xnvjR9SaSobhhMVdBZdtXgPYRI5BITSG+s7YM+/J1XytqEoXCXSRNEExBDeetdB6CyZToOjAiWa5ZZw9AgO2Dr0huU4klsFl7H1BKS4p6QWnNkc14LKbazrmjwP/Zm1mFjvAY4fxyu4IP7qzr4dzet3m6osiMvTTtZrPogP40cKkUx9C0; 25:lAmXBgTcJjSuvRVNSj114sESVvyuyiYdmDIDRMcFtsFZg487HAuXFd1R98Pjs869dhH81IfxyoBhVvq5EjHEaGUQ2kfulA3G/5te7lVMHl6k/0x5oIkYdMmKYdL8HWNQhBdS4oefO1UH+YH9wGlo/uJldMDpuvuLreRMC9kXu9+kEDLsWtoozP12E4G8ZR6k+vEB5R41e+BObK59khfRoI8K/ozxPIDPMh4vA1Osk5zQTCKkmnA+AtGwIOiXmKyTD0q3RbeGWLWSjhaczM8i0qoaXze0XcrzILmpZ1s3rlbON68O/g0qZxM2EYxu5Q9gNzyumBqw6H47EJOjc2kM8w==; 31:irm+OpO75X/u0fR9OBJKQA7A43Gg52IIwjWWnQae8Tbkj9mieK+NyRSw3uj+5oZfF9NUCn3I9DQid6U8XkbgHnAwaPTg4Dfqdmr9h50piBDneNBfusuHqmAExNQGFDNEenUllX3qgMrkSBK9WohOT8ttIDVUCw2s5tyALb8V1xqL5Zc2oJNRb3Z5EewSw1UUz2UzfYYr745cRRcBZvbvPUmKbyvsnAO6GW3FTRlWD2c= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:D525Q1IGhsL8YB049D8P2d7FibHKXDrmrqEA4nTuqq6WKVTRZHE8xJ4KcBNvlpVDf2lP3GpuMqGwDGwicEt6pOR9tawrN7aWkGFiloOM6GNiUat+DEfh+S+SvWsAt9SCYy5HnJaLmMcg5VMaKBQsjTQYvuw8nM/eW1y/p64j/DDtq8Ht4dJkMureHe+CXetVGyw+39yw33HxvV5onKCn+42wxcOyQ4La3j0h5xyi7pMRd+YjMI3Du55CKfHD1aaxfKuitjoVS+tg7NUgO4Q5duzgK0+Qa7UHfPeklhVoB6dcc1lL33OTs94yOp962V8yf8Go2lYSUsWR48x3K8RGZRNZFNsMeGgO5GS2tv1ue8sJsC0b/HaznTiZ6MIrF6mWk+uL30qzifMB55N7KYcWZ8wjnXnbH7mD1fQXha+fhrORmWciFFf/vZ3R6YeOm9IMs41N5oifR0FzHmoTlR7gZhaksjUQ/l8eg71uEHhZpR6nimXlEgZQNJ75OHF/Vt3U29+P0fpmbpzu6+dFB6XbeLeTHnU7UVR2FxyxADxhMKRwX1RuMfDLeU2i9rqE5pWHBn7+iHJf8CBgDKev68NuGgh6AXHqsgySINJ4DV4eUxw=; 4:XgmQZ+/i5CEUAaPaczmdvnR3I05Az5eAAnLxFGCA3yo5aIw1tIR5UJ/p2YAxFVIO3THEUya8ggsSB+3btnixz7QJPI1wSSLRb1uCRfK87zF72N21EHmYzYClfsqsQqRhcvo6q9dlCaef+OJRb2NLMI5xb8XWGc0Nnj51YdMgxp4V4uFUYWfQfYWybTtij9Wkniv/K1SaUBOHCTMQ7YnEU5YffPLTyr9DH9dsTm0ySS5yrXjc+W2HrBDeoKbI/o0Pp/AJcG5lhk0jjkwrKyOm1A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231023)(3002001)(10201501046)(93006095)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3463; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(376002)(366004)(396003)(39860400002)(199004)(189003)(48376002)(2906002)(6486002)(72206003)(1076002)(16586007)(68736007)(7736002)(16526018)(50226002)(50466002)(5660300001)(105586002)(47776003)(305945005)(478600001)(66066001)(6512007)(6666003)(42882006)(2950100002)(81156014)(106356001)(3846002)(6116002)(8936002)(97736004)(52116002)(53936002)(5009440100003)(107886003)(81166006)(51416003)(6506007)(316002)(8676002)(36756003)(76176011)(4326008)(25786009)(386003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3463; 23:a3FChA1Zd4m6g79X/KkYJl81b88AUel6+wFet04zd?= =?us-ascii?Q?aeOvu8boSoVz33ERaqAWzDa1mIhw5BE+s9/k0b6fefTMVDB/lPtCbkeV6GJt?= =?us-ascii?Q?cI1fGnLI3uf0lzRv/3UWv9BCLX0+9xg0qz0MFeBti0M6QKI07IYy0cKH5FP3?= =?us-ascii?Q?QTtp9koIuDSCHkY0FqqN3Jdr5wn+KzTiIcSV0VAfTZ30Fww92PHKP3i9bIxY?= =?us-ascii?Q?DGUUut1oo+ZGRE8lCQO3c+c3dMMejclGgP4GjOYfZw5rHT/nsCJDiAjk4/Ef?= =?us-ascii?Q?FovbaPRiVfNFYpvflyRKgKTNdkXTlkC8PQkYMLdafzdy6y2WlZSwPde4lGsE?= =?us-ascii?Q?mx7KNPdHA85B6fKj4We3fUeE58IdNEcgkL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P6kHQUKrnPhaO4tGTw0OoC+pjZPN/9esuvMdWOmwl8jM1cE8+PngaJcssrkVrN6n1inEONX6ANRVcbIKTRwFx6PbGNmG+apXeHc47kf5/ZDlvV41gNemBwkeDO97yKV6Mr2/+JjEkwQzYA5IiT4dc0qSiD9GBC4t/kOqH4sx8hGwpk6mXpyhuOchIBatPtMXd/hY3gZ9qcm2zkU3ZR7/bUstnxmin60sKw4KxcLiu8z7j4I0v49SZjcrFfL/MBOEoHrfrAeselP5C91A2LH5YJTuwqY33p0vMNp29aLfGVhw8OUTYDUcA=; 5:wmtyOSA+siAhS+qYnoJ7b6E4KwV3Ua50PD39ZgDWutyAejYbYgVtNqwJgb4YwSnhO6JQc/6xLPx9Rp90/t6CrxEP4yc3oINFoaU0J6cKCYNXK9PmnztUnLjXGApG8OO61chaMlh/pvwLqVsKdXhqzWVqivhRyfOpTMnUiJilbQ8=; 24:E/C41QQXyfLWfJ76gJhHXuevXUJusfjZ5uRSSmFaFifTyuQeRQWKibQ3dAuFYMv9mEOHptp9v+Neq9sKsk/AIzgLJogQj0NXXl3mIbCXBQI=; 7:ZD4ILMTS6T6BiEG2iI3EjvsYqNlOOp6GCT8fxseEoNAh5Pc3Wz0FqPdyAirs3HPLEi+8Frv02oRtvbU5ORDrz6278t1AddgZv/S2i3Cj9pVSgIDvpb91nraR1X36DKe7n1w9AbbqifWZjMDOzKeWFQ7IlJxnZzmNS9kfDakGWeBCkVslZbMZsNFbbqZijBrzlYuIx+kxW6iOnvI121mBTBZOei5258OjQlT61S7S+a8eLcm2c1LUDTygjSEES003 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 18:02:59.6481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: def5b19e-6631-425f-c6b2-08d5470abe68 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3463 Subject: [dpdk-dev] [PATCH v3 1/2] net/octeontx: add channel to port id mapping 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: , X-List-Received-Date: Tue, 19 Dec 2017 18:03:03 -0000 The channel to port id map is used by event octeontx to map the received wqe to the respective ethdev port. Signed-off-by: Pavan Nikhilesh Acked-by: Santosh Shukla --- v3 changes: - Add rte_ prefix to shared variable octeontx_pchan_map. v2 changes: - Used extern instead of defining global variable drivers/net/octeontx/octeontx_ethdev.c | 6 ++++++ drivers/net/octeontx/octeontx_ethdev.h | 6 ++++++ drivers/net/octeontx/rte_pmd_octeontx_version.map | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index bd24ec330..deb41d80b 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -54,6 +54,9 @@ struct octeontx_vdev_init_params { uint8_t nr_port; }; +uint16_t +rte_octeontx_pchan_map[OCTEONTX_MAX_BGX_PORTS][OCTEONTX_MAX_LMAC_PER_BGX]; + enum octeontx_link_speed { OCTEONTX_LINK_SPEED_SGMII, OCTEONTX_LINK_SPEED_XAUI, @@ -1133,6 +1136,9 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, nic->num_tx_queues); PMD_INIT_LOG(DEBUG, "speed %d mtu %d", nic->speed, nic->mtu); + rte_octeontx_pchan_map[(nic->base_ochan >> 8) & 0x7] + [(nic->base_ochan >> 4) & 0xF] = data->port_id; + return data->port_id; err: diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h index c47d4c6d3..d37bb8a23 100644 --- a/drivers/net/octeontx/octeontx_ethdev.h +++ b/drivers/net/octeontx/octeontx_ethdev.h @@ -52,12 +52,18 @@ #define OCTEONTX_VDEV_NR_PORT_ARG ("nr_port") #define OCTEONTX_MAX_NAME_LEN 32 +#define OCTEONTX_MAX_BGX_PORTS 4 +#define OCTEONTX_MAX_LMAC_PER_BGX 4 + static inline struct octeontx_nic * octeontx_pmd_priv(struct rte_eth_dev *dev) { return dev->data->dev_private; } +extern uint16_t +rte_octeontx_pchan_map[OCTEONTX_MAX_BGX_PORTS][OCTEONTX_MAX_LMAC_PER_BGX]; + /* Octeontx ethdev nic */ struct octeontx_nic { struct rte_eth_dev *dev; diff --git a/drivers/net/octeontx/rte_pmd_octeontx_version.map b/drivers/net/octeontx/rte_pmd_octeontx_version.map index a70bd197b..a741274ce 100644 --- a/drivers/net/octeontx/rte_pmd_octeontx_version.map +++ b/drivers/net/octeontx/rte_pmd_octeontx_version.map @@ -2,3 +2,10 @@ DPDK_17.11 { local: *; }; + +DPDK_18.04 { + global: + + rte_octeontx_pchan_map; + +}; -- 2.14.1