From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0042.outbound.protection.outlook.com [104.47.32.42]) by dpdk.org (Postfix) with ESMTP id 1760F29CF for ; Sat, 9 Dec 2017 13:56:06 +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=pKMpUZxcFTkXQthxx+XrYD/6qFGG3D3TAxHJf1yz+uo=; b=WFZS5IIbrjutfrJ01loPRqpilTykFmehGZI5zNsIyD9exobFnjnsCQkvSnQ9D24NNfRHRB+Wr5vq2Y8FeAdn4w0OsLlnO/605dHenZ+Sm1S3TeUOUkzx21wuGZERUauoWVism4+1juwHCEkANeFn27BuPOsq5etdfhr0MWxwg8Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (103.16.71.47) by DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Sat, 9 Dec 2017 12:56:03 +0000 From: Pavan Nikhilesh To: ferruh.yigit@intel.com, santosh.shukla@cavium.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Sat, 9 Dec 2017 18:25:09 +0530 Message-Id: <20171209125510.20592-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: [103.16.71.47] X-ClientProxiedBy: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (10.170.138.156) To DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6105f98-2a06-44a1-5537-08d53f043560 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 3:lyf28OCNgrhE/vfwadYn15RV5aSnTfJIeI7Wla9O/ssojUmbiH8rmjzj2S+gVwrT8hKMthLszxmeSP8I1aEJexTy5EBbrV5md/TdxRmR3nmeJcF2oKkjLoLFTtrF8DMNhJKqqbvfzEUi9Pyfc9EWdmWeFi78ORclW/0vVuS69DXqZ4QBoxUwdG+X7uF+klHRDPRCvDNKMhePqGWXyOm3D97AaHj8F/lQYMPCosHTvnDEnp+6Z4e8jClH3Q2lMyNl; 25:UaMI/T61UZUMPoVaOd/MQmiYeJV0DgQxhhp2suNLj0J95CrBNL0D08Q9ZvF5c9hjHnBdFH9EGh+WlmDjP+VZlLmBmeEk5Rgh+JVa1uigyISxMNMPLPYPcAzh8mh6P0J9ewYv69jpGl2nYmC4Q1ys62UrzDRHwGgonWpyPFUGLbOKWcs/khNfn9f0fw9sacR0/bTHa3AGEtmapafozP5ZXsxapaRtv2T4WCFDwSFzgnc+cAwHkLqz40GNlKdFchVCxWV9PbzKxeTY9KaE4xQAIvGnKfgvofwJXzFcW14aMRla0aRsXcaxCRNK9Qn5iGC2oGXtL114XHctUqAQ/qLxSA==; 31:iVRoc0v2E2wBh8Y8k73Fjwc6TVJXyx9S9LAXnfN71ixJqQCc4OVDXXaAe1pBhhYI08XHaG7yIEpmHyGUaKrvDCr4BlWGeMDBEFuuA2OI07NPwSvQEmsY03Gmg00mtCRZKiNE5Ti1wcPJbekbOd8/Vfj6dri/pDj5wqrqZORoQRXA0i6Do1pHJwFdAxbK5QkUgcKGqu+UNAk1rUViv03aN4waWq5jYIoPuYP3ji7X1/0= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:s3sZDcUaupinU+PES30WFB6l8NymNdHgbDQioPX1kSAd/A5J5z/PURwt1E7oiltSX0x6f9rNqx37MVOl8ChkKfz5XnH/b7a08LxZIWwEpuVXE2fXs7WivVPWVXOT7mW6N3DMXsBLxjFGeIJGgm5a+9HhXDONzvI1U/bu02f5nYu4QSABvjx2jfYJevh5eRuL7e6JCfI67LSbCANDayOuPYmncPPWcfXC5eJdJFoQ2LUAQf3GWhaw5EZe9PTQ+tOXyAehRjOGQeLYLW0VzG5fnU7IR9pUS2oE48XtSanfBkTMdg6C1ut26noUZ/KIjAfllufmvfJgWRMrdcsdmAGF5n0tv9DfTmfKahI3xC1EPUgJaJdfQ/KE6FKLyylR82vNRQmxO8DWw8b2ljRdenL37fADQPMdE1m0ut+Us9BgdhqODciIqppAELF5xbY7XJ4h6X1I8NlxKTU7+YZAO/2WnBph3nrUwrZN7C1IcOnxBVTund4adiCNn9rpRbfmM2VNYGUDjN0x+7vxO6BZhlCkUaMWvr0oYZ743WPmBpC1chEMycE/+jx6YZizDDCFJIi0mmze9J7nyQkPpamHBuS44UpxKRBnmWRx2Ylvfwxtp3c=; 4:XqWFbwDvn6eibu+Ouut49KhDpvLA6lfam474fib72h0o9/kFMkG5HTodHToX6b3NBnq09EDwkHoARa+6t2k0CVWTT3c6cB1jH+vh7y2RHlR2pgOke8jxYAU1O6f3PhzCqVEf1TI/HzAAFW6QgqzN7GDzJNsb9s8LBp1qBAPIXLzQ6KEzmK/C+p4b6nYzt7NU828JfGeGAeeeQe0dQBpShRpPI46+CogX/yZ1tzRw07R48raTB3CdOyJGtpOLZLalZ7EL18zI9IQghINJCq1xPQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(3231022)(10201501046)(3002001)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(6072148)(201708071742011); SRVR:DM5PR07MB3468; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3468; X-Forefront-PRVS: 05168A3970 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(376002)(199004)(189003)(81166006)(76176011)(16526018)(47776003)(105586002)(51416003)(3846002)(16586007)(72206003)(48376002)(6116002)(106356001)(6486002)(6506006)(36756003)(6512007)(53936002)(1076002)(66066001)(316002)(52116002)(50466002)(2906002)(305945005)(8936002)(50226002)(8676002)(2950100002)(107886003)(25786009)(7736002)(68736007)(478600001)(97736004)(4326008)(42882006)(81156014)(5660300001)(33646002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3468; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3468; 23:ecPLhEFZkZPODrwVBWnz4WOY67bsFXokNd908sMEl?= =?us-ascii?Q?3kHdS1xxOXLxP6iC5OIlU8HW3hxeh4D813Zjod2WuvQFehfJl3jWDlnl6o3C?= =?us-ascii?Q?uWPHIW+2Rmn36IcJtCW1FcZZeMWJLcMvubq8m6lX+lRTZWyLjprWwm44cJbv?= =?us-ascii?Q?Ix23M+2dVRwbg/Y1dJat4q0o3nK7m1BqE31pPW5MgGfUZ9prC784U1gZz0Ac?= =?us-ascii?Q?rpELuBEbJhb2j0ev3O+DGe5uQywxMmzCZ7QlgFzdH7dqQwjUp7Wz3I19Lx5+?= =?us-ascii?Q?/FZCnQc6EHnqbY0hgTVQdNTEChQ35eLOCpyQqwfqkFd56W5V4CWACLC6Xx8K?= =?us-ascii?Q?WH86Xyz/VupAc6t7amj6lRj7XHR1d3NuVj8/KHZhpK71OzeasPwGy+LBVkAG?= =?us-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T4AFRgCiEVEXlhzOSgCZ4kEIP2/eyrrXRJk500rLbSMu0oeRI0ZJ5713dJwyAyGKnvZhDCSBlyVqXx5y1KP5TzW89zDBN8w7OVAANmFk1nNlZK1M5idOr1iVRrJM6wLJVJ3pEeUkd5dqoBXYlPlw97uCm8RsdwVcF29TrgXi8fHKG8Pw=; 5:LFXqwox8o1UQXWsxE5guqt4eHA4wDOYcA10rpMarLV/Zpm83MAQBqd2GvnB6tIRYDhgVv4xTH+XkMBUxUbQA8gQiQNhEh9zVBXUnbJXFvj4VgYcDn7OkTc197Tw9E66q0gjvalA8gxDnr44NnTKHGrCsa7Fk/bDrnk4bQS6aGiI=; 24:naw6aVUYQCSwA2NbKDloDOQHjDleZsU1FpjKCxIer20M0GLG/huzs/jMAugXY7+sXs878W7b+QJXp3F9B9gueIVRWzYvlDNzedb9qVmSmQs=; 7:BsNBcJnCq2uX9c1/RAFaBX+QOfd4aabgMNeGQQRiP8DnmAeYONRqB9pyRBmiZcotNx5UUUznRGFcA6Ni0EjLkDZD5tMREUaY8GYSt2rdP1xsAdE09V2eUXND4+vd16Fz4XNf7sYqKTz63VRVkpRD57Btet5bcffSTpt02N2NFyA2/kZNVEnPPZaQUEFFQbGFwbD4HkAvbbj8fbIbmuGKjEw/fbEEpb0Ju8knQ/W3PmuoWlVtv1OT34NsKoN08tbV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2017 12:56:03.4780 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6105f98-2a06-44a1-5537-08d53f043560 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3468 Subject: [dpdk-dev] [PATCH v2 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: Sat, 09 Dec 2017 12:56:07 -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 --- 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 | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index bd24ec330..46cb061b4 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 +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); + 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..f046595a8 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 +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..3ec12ddb1 100644 --- a/drivers/net/octeontx/rte_pmd_octeontx_version.map +++ b/drivers/net/octeontx/rte_pmd_octeontx_version.map @@ -2,3 +2,9 @@ DPDK_17.11 { local: *; }; + +DPDK_18.04 { + global: + + octeontx_pchan_map; +}; -- 2.14.1