From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC08BA04A5; Wed, 17 Jun 2020 17:06:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 27AE64C90; Wed, 17 Jun 2020 17:06:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A5015100C for ; Wed, 17 Jun 2020 17:06:42 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05HF2FpB006585; Wed, 17 Jun 2020 08:06:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=pfpt0818; bh=bJoIXAQ/Q9LL+Ho9c/1MW9mDKLt6fRsWR3B7sv1wxQE=; b=S/2MzY/cPdWdeMSaS5WgA1A7M7VTSQH7nRQ5bZLEKv4Gbb5vImMdC/Oen5JPDYCHIEN8 eoTjD/UJp/fQA/T8fE/nVexg1hCHjfZ0TVr/AZUG6bWjDU8jbkqrdjXzC0g1AST+2HrN qcSzsxa0ksGSqlJn20U1nGRjcONxAa7YnNaEjyac1L8H55LrhiFMGO6XClPAfAPvJPK+ U63S2jQvTozu2GNAOMLj7+2zBAYe+sK4y2N3xD+4rVhv864U5RkzX7aQuJ4Ar2p3FBJR y3GlTJb8acxIJDP3T7T4s5/hCNExARlQ7KbghBc20nY9E8leVfppabtmFalGCdCDM7Ra BQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 31q658n07m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jun 2020 08:06:41 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 08:06:40 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.53) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 17 Jun 2020 08:06:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Boq6LxVKz6Oc3Ln4r3hssguRQyB5lpTQtNBaYA1XxJa8QIzQmQ84ORU0RBu4/REzoeFX4/ZkI/l3ulmYpfmefTQ7Md4BhQjS0byH626ZhpJMXAsAR0vmrW5YLKv3hTWSQs88P1ewLDFf5wYkJQPa+YbmN4la+YzD3YqmkQTs+2TGDTQO0BglLFLGo8YOk9FWyXzjCQWNUWZn1ZFTUGEq1S3TefAzutCcnwU3OOp3w/EMBvRzPjTqpxa658fIGRrvKhwSAx/YWEONGQIY4W4OG44WTLT2m31V6h9bbtmNc67dAQCwOLiJXT2zno7Y7LF/ATKf65jPK+i8fu4cYOe9XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bJoIXAQ/Q9LL+Ho9c/1MW9mDKLt6fRsWR3B7sv1wxQE=; b=G/xK3eTf/Y6cWRXA+G3Mztj9S/q93tb7bshRrYRyFepdN/bC6y6RA77GiHOVclV/x8kOYeblxOOD1HQt1ItPp5D51hT2aYwv8la5urWNlpfHYLAqBw74JjrVXq+VBSJvdf+ZRxvJTAMXqNgIQEIIWavxU7ma2IAMI47YdBRE48u03U5AMKq2bi9gWSvqj9yhhG3pVY4TeDGLoK1B3xCwGWhftKuFY8KBeV7l0bLWyYa7/JxMwoAY6pBM6PWqlaCCLPzSgsnLv+EAe7jVuPhw4u3hxyD0gMQP+ZgCABFL9/+ayJQvPeXoG+cBFCoavIIS+u2pBfKbPI5ToQUbN03/hA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bJoIXAQ/Q9LL+Ho9c/1MW9mDKLt6fRsWR3B7sv1wxQE=; b=d9pjHBiDBQfl8V4xX0UOoERP8fCo17beeeQfCSmLu1apHb4VmZ/NUUjZ8bZZw96AGmnz+XwteOptROYjkg61je+cmG69hZVkF8LL2gH85rkSdMDVmQwActJ3SQg5U91hwToFlau702Qa0YGglleLtO85Y4ZcF9rJAcr/i2U7nw4= Received: from MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) by MW3PR18MB3450.namprd18.prod.outlook.com (2603:10b6:303:5b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Wed, 17 Jun 2020 15:06:38 +0000 Received: from MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::e895:bdac:e157:2ed2]) by MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::e895:bdac:e157:2ed2%11]) with mapi id 15.20.3088.029; Wed, 17 Jun 2020 15:06:38 +0000 From: Harman Kalra To: Jerin Jacob , Nithin Dabilpuram , John McNamara , Marko Kovacevic , Kiran Kumar K CC: , Harman Kalra Date: Wed, 17 Jun 2020 20:35:59 +0530 Message-ID: <1592406359-5720-1-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: BM1PR0101CA0028.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::14) To MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (115.113.156.2) by BM1PR0101CA0028.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3109.22 via Frontend Transport; Wed, 17 Jun 2020 15:06:35 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7ca86125-1bec-492c-ddf4-08d812d008a2 X-MS-TrafficTypeDiagnostic: MW3PR18MB3450: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-Forefront-PRVS: 04371797A5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /MiekkPq4A5uwx2VOlUyOE/swuLuXfkv7LTZ033uaziBqYEstJTk8zu/or2pP5Pjg+Nm9jA5F+3saflY39gzQ7mvAckLKd8mlxP5EDyDy7Dpl8mwG8+m1GiUZx/fQqDwMu2qqUwarqtbIinmc2qOQWW9mB0fRDR84E8S1AZrHmAEsJGZGPRnyaP9nHL0A7VV8BGWxuldJqvnpIlq+i8xNHrA6zNpZaP0fbmdJ9yA9ZTyFsXH8PnG8j6e2pHlOlZHepRriyrdxzkSS7KiYaYbJHl3RYAPBvjs0xxo3AWSZ23hIocI5s8t0dIGtw0sApdiw/YIQ95IIhD0H1TSgyEJbQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR18MB1070.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(396003)(376002)(39860400002)(366004)(6486002)(956004)(83380400001)(2616005)(55236004)(478600001)(8676002)(36756003)(6636002)(86362001)(8936002)(6666004)(16526019)(26005)(2906002)(107886003)(316002)(110136005)(5660300002)(66946007)(66476007)(66556008)(52116002)(7696005)(186003)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: mWy6MqsAy37OsA/M6ghGALdVOHJ+BSbr/gJM7tOs7nR3/h/pR334A34OZwJ/wHzuDnaYcSkPB0YttsNjaLAs5+QRF2k4fEk9CByjg1fxma8GFLEjhPdRMHThhrF44L/Xf72pD4fktcDwV35spZz1yOLzuBt2LZSL9/QunFhMatXB+OaepbivL54bf1XVwJIPFNILvEgf+opshjspbDoh6X1PciLQ3P/IE4+CdrsC533ECABqdK8N2Xc4F0jmU5RlYad4S9G3vUrCB/O76ecd92gciw6syZiTXZT6AZAn8Ycm+Fzf9df5kX/M1/b4pYs4VBq/b2U9VB+W9Zz61nDUoAVFp6/eyUKhXzYMBwED2nRtbwXC0Tq0D4EGd80C5ebODFyffT4iRot3QwPMi8Uu8j5ikKxwYJ3jpvI8rrEwrme+9ZuW0Ahcst0C+d2kNvXQ0+4C4KiV1OUdqYOm8vpXEwkMSF5Oj+TKPX06vQ4iOMU= X-MS-Exchange-CrossTenant-Network-Message-Id: 7ca86125-1bec-492c-ddf4-08d812d008a2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2020 15:06:38.3292 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qO2GOf4gBFCdqllrsM8dJCI5UrvNPuDTf8JXAzGvvJ6VHPKaL+lhYqM7ra8z+ZRi/hplJDZA6U0N3zZ8oAC6xA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR18MB3450 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-17_06:2020-06-17, 2020-06-17 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: add cn98xx support 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" New cn98xx SOC comes up with two NIX blocks wrt cn96xx, cn93xx, to achieve higher performance. Adding support for cn98xx where need a logic to detect if the LF is attached to NIX0 or NIX1 and then accordingly use the respective NIX block. Signed-off-by: Harman Kalra --- doc/guides/platform/octeontx2.rst | 1 + drivers/common/octeontx2/hw/otx2_rvu.h | 3 ++- drivers/net/octeontx2/otx2_ethdev.c | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/guides/platform/octeontx2.rst b/doc/guides/platform/octeontx2.rst index 15b1641cf..13255eec5 100644 --- a/doc/guides/platform/octeontx2.rst +++ b/doc/guides/platform/octeontx2.rst @@ -13,6 +13,7 @@ More information about OCTEON TX2 SoC can be found at `Marvell Official Website Supported OCTEON TX2 SoCs ------------------------- +- CN98xx - CN96xx - CN93xx diff --git a/drivers/common/octeontx2/hw/otx2_rvu.h b/drivers/common/octeontx2/hw/otx2_rvu.h index f2037ec57..330bfb37f 100644 --- a/drivers/common/octeontx2/hw/otx2_rvu.h +++ b/drivers/common/octeontx2/hw/otx2_rvu.h @@ -134,11 +134,12 @@ #define RVU_BLOCK_ADDR_RVUM (0x0ull) #define RVU_BLOCK_ADDR_LMT (0x1ull) #define RVU_BLOCK_ADDR_NPA (0x3ull) +#define RVU_BLOCK_ADDR_NIX0 (0x4ull) +#define RVU_BLOCK_ADDR_NIX1 (0x5ull) #define RVU_BLOCK_ADDR_NPC (0x6ull) #define RVU_BLOCK_ADDR_SSO (0x7ull) #define RVU_BLOCK_ADDR_SSOW (0x8ull) #define RVU_BLOCK_ADDR_TIM (0x9ull) -#define RVU_BLOCK_ADDR_NIX0 (0x4ull) #define RVU_BLOCK_ADDR_CPT0 (0xaull) #define RVU_BLOCK_ADDR_NDC0 (0xcull) #define RVU_BLOCK_ADDR_NDC1 (0xdull) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 3f3f0a693..095506034 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -2177,6 +2177,20 @@ otx2_eth_dev_is_sdp(struct rte_pci_device *pci_dev) return false; } +static inline uint64_t +nix_get_blkaddr(struct otx2_eth_dev *dev) +{ + uint64_t reg; + + /* Reading the discovery register to know which NIX is the LF + * attached to. + */ + reg = otx2_read64(dev->bar2 + + RVU_PF_BLOCK_ADDRX_DISC(RVU_BLOCK_ADDR_NIX0)); + + return reg & 0x1FFULL ? RVU_BLOCK_ADDR_NIX0 : RVU_BLOCK_ADDR_NIX1; +} + static int otx2_eth_dev_init(struct rte_eth_dev *eth_dev) { @@ -2236,7 +2250,6 @@ otx2_eth_dev_init(struct rte_eth_dev *eth_dev) dev->configured = 0; dev->drv_inited = true; dev->ptype_disable = 0; - dev->base = dev->bar2 + (RVU_BLOCK_ADDR_NIX0 << 20); dev->lmt_addr = dev->bar2 + (RVU_BLOCK_ADDR_LMT << 20); /* Attach NIX LF */ @@ -2244,6 +2257,8 @@ otx2_eth_dev_init(struct rte_eth_dev *eth_dev) if (rc) goto otx2_npa_uninit; + dev->base = dev->bar2 + (nix_get_blkaddr(dev) << 20); + /* Get NIX MSIX offset */ rc = nix_lf_get_msix_offset(dev); if (rc) -- 2.18.0