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 CBB03A04B1; Mon, 7 Sep 2020 18:15:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DD561C0C9; Mon, 7 Sep 2020 18:15:51 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C10BD1C0BE for ; Mon, 7 Sep 2020 18:15:49 +0200 (CEST) IronPort-SDR: ZrXvIH+QH4GoFMj1zZo+1mfmVvaheNCdWcvoh5Lk7iQgwHmVGpLzGn5i2IEFhZxKmSIFjK9pVT UDAPJX8n2Ciw== X-IronPort-AV: E=McAfee;i="6000,8403,9737"; a="158997545" X-IronPort-AV: E=Sophos;i="5.76,402,1592895600"; d="scan'208";a="158997545" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2020 09:15:48 -0700 IronPort-SDR: ubiAZjI9kMbMM96Es89NESTuxP58ekYsW5sMRDBt2Z0E4vqpRkeaLvkKff/mU5mgDoq4/xH7ho knQ+8TspqD+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,402,1592895600"; d="scan'208";a="316911241" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 07 Sep 2020 09:15:48 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 7 Sep 2020 09:15:48 -0700 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 7 Sep 2020 09:15:48 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by ORSMSX153.amr.corp.intel.com (10.22.226.247) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 7 Sep 2020 09:15:47 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 7 Sep 2020 09:15:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wf/yMvQRIt6sBYM/46GGYqs2A02XwpA3xz9taOFGBaH1HPgiT8ydupPaFJqCAaxpa1hiwy68zOw0/VWAa+u3mjf9lEnjaX44ZEOt7NdLM1tlieyVgDWonhnEkrJ1MiOZec/05tIZEBtLag5AfZeBljf12Ar5qyJizNRpiELowptiRCN56hJks6cC/m0zgQ4VVGHqsWKcJ1I6hrsvliTmCFO5+DrNb907Hh/zwk+5JTd8KhYw9kjP2B3MJTjsVuRR/bVAWsu8LNB6TXiqqvTgiMNs8YoNfu8fH+7R/cwRTgCXkC2neYzJFML61915FBkqDuGdCNsc5XeVaT6qawPY2Q== 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=iTYGJx12dAQscPoONGfRMFCduQ0gd67ap5P4szpvCqM=; b=G4jS6OtMcR6rbDlTrTsf9PmCXYMpsICC1tzc13H84q6Hg/+sPzH+O8RhOx8dW0ObpaifXmksS94fK2a1qM9iOahe0pTXoN9MYHDP+Xa+rYc3scLFjmhEcsq/LKkmFnvFV8N6E8Sb/gQqUY0BIT5TyUPhhgL+dCa7G8NWkqeOu6VuG+2oawUVvJgGZFWhZflB9nU23+5DKOJ+q42UjhNalMpqmERxVbpVtl1aQvSFA1GiFih4Qsradk0yPlfUkHZ4d9w6/GkGK+q5AWIhNtcL2QMSXKauEA60emJTX33vlmajvImUqkkVgzhC7zuiqXXQcA5XyC2u9O0bbBj0a8Q+og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iTYGJx12dAQscPoONGfRMFCduQ0gd67ap5P4szpvCqM=; b=stK7qLFulIwiz/Z3IqvYTiPrJ1hVuFz27zDscZ1ra+kCpSryDvRp16adRdCmRTJ0OaREkIPh4fU+O2HAv0as+R4rDeOz0wx/vW4eeq7Yl89pEv4xshD+7Nuws/n7BudPgvv/pJvUrAjVhJ3zgqvPm1rXPTeawJSbJMmWokMEBUY= Received: from BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) by BN6PR1101MB2099.namprd11.prod.outlook.com (2603:10b6:405:57::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Mon, 7 Sep 2020 16:15:47 +0000 Received: from BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::a048:6dd4:66a2:1f31]) by BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::a048:6dd4:66a2:1f31%5]) with mapi id 15.20.3348.019; Mon, 7 Sep 2020 16:15:46 +0000 From: "Wu, Jingjing" To: "Li, Xiaoyun" CC: "dev@dpdk.org" , "Maslekar, Omkar" Thread-Topic: [PATCH v3] raw/ntb: add Icelake support for Intel NTB Thread-Index: AQHWhL2fpnvJBLYfoEe/O5Gnb3HmMKlc1A1wgAASEoCAAG390A== Date: Mon, 7 Sep 2020 16:15:46 +0000 Message-ID: References: <20200831045958.5589-1-xiaoyun.li@intel.com> <20200907022112.17640-1-xiaoyun.li@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.209] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 422b36f7-7b3e-4d8c-d271-08d853494777 x-ms-traffictypediagnostic: BN6PR1101MB2099: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cn/JRzyuO3/ZJpkzzjkXq88BpVjsu2Jv0GqkbxMzKy88KghHU6sFvb1OPLipEMI+GfzU/CdaJNX2PuLXh89pc4/dZ3naVOVnErN0tgozcNo5ORjPPTlVDAMSlpFjwElkIl3YXP9hQqBQfHuLIOo/qGzL4tGzj44UbycUhVL8UDS4Wrkrwe9et5FC5SQ/+3srzFtVtSmLIlwIAwIUnlErxGWWRI6Yg4vzVhIUqbnHQLqM6Ro0wAgjCN7AobVwNj4RRkKv3XyZOfGzH2BSBiT16ZMHWO/DZc37BBSYoX/vfZW3lI6e05CHumIjYdpDOxTh+Tb5PTh9K+9a8XP3UC8DoQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB4052.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(376002)(346002)(136003)(396003)(54906003)(8676002)(33656002)(5660300002)(52536014)(8936002)(6636002)(2906002)(66446008)(6862004)(6506007)(9686003)(4326008)(26005)(7696005)(66556008)(76116006)(64756008)(66476007)(107886003)(316002)(66946007)(55016002)(86362001)(186003)(478600001)(83380400001)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: AWuZLjmLUZz/EF7rkm20+FQgwuvnwINFuwrmr9fkkbpk6Tt/G7w4n+ti53F6+a0pDFYYWFgVfhnm8dzRyX47g3BwAQwdOmUVfhMxm6eS+zC0gTp2p35V9j7BscCHz0igWCh/uG6XU25T0BaPp9Xj7U3aE6X5hUiv+MGm8M3sR5LZCNBkEFWgCvaGH4AU8APwPykU1k1QMI1yiSSAk/3hdk+bqFREuWpWoKLlTGXGG/6UMLFWXCaU+uDqs4IMmIuHMeyEXfJ0XsufSkEGzzIuhvZdbbAblSN4K0aMetZJFZDBnk1jKnqO8PhMc58VIRhsMoLvdsOgZCPJBsANzeseBpJEN+r9LWUUW6EQ5dXm5DrjJn7dV9Ik9PgZ5r8IxTGAwlx2fkQlfubzF4rLYMMmhRmHFpa59yOtDLfN87mpXn6BSHqWhI2o2KVs3Qvv562TfUKJmjYAFhVzrRQT8SzfPBCiIwo2mHFiVlFsn3L/3Zto2uMegCTchWj1TkREeQeY4Mh+RvgsLHPhaEQV5zigV+hPAfYyiTbrBoaokFir4row5sq0th1Ny8xbAjjwUAmtX63hkELu6tBwkwRGfzvDvSyG0jkQgt807kdaItQwon+vX3qGXXPVSZ2gwa8VswVW1ZFa63pCx6xs1aoyn9rW7Q== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB4052.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 422b36f7-7b3e-4d8c-d271-08d853494777 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2020 16:15:46.7539 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nJjrh5pnx2030ohSl+j1oWtS+xufRMyR0yga0gh1eyhqTulVrY3rzQnuEQ+o0r5EFF3zOOT9yybU2BZ68FPXxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2099 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] raw/ntb: add Icelake support for Intel NTB 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" > > > - rte_write64(limit, limit_addr); > > > + if (is_gen3_ntb(hw)) { > > > + /* Setup the external point so that remote can access. */ > > > + xlat_off =3D XEON_EMBAR1_OFFSET + 8 * mw_idx; > > > + xlat_addr =3D hw->hw_addr + xlat_off; > > > + limit_off =3D XEON_EMBAR1XLMT_OFFSET + > > > + mw_idx * XEON_BAR_INTERVAL_OFFSET; > > > + limit_addr =3D hw->hw_addr + limit_off; > > > + base =3D rte_read64(xlat_addr); > > > + base &=3D ~0xf; > > > + limit =3D base + size; > > > + rte_write64(limit, limit_addr); > > > + } else if (is_gen4_ntb(hw)) { > > Can we use a variable in struct to indicate it's gen4 or gen3 after ini= t instead of > > check it every time? >=20 > What's the difference? It comes from the value in hw->pci_dev->id.device_= id. > Checking it in this way is trying to make it easier to extend it for gen2= ntb in the future. > It's not either gen3 or gen4. > I don't think it makes sense to have a bool value to indicate it's gen3 o= r gen4. Understand, as the inline function is very simple, it looks OK. >=20 > > > > > + /* Set translate base address index register */ > > > + xlat_off =3D XEON_GEN4_IM1XBASEIDX_OFFSET + > > > + mw_idx * XEON_GEN4_XBASEIDX_INTERVAL; > > > + xlat_addr =3D hw->hw_addr + xlat_off; > > > + rte_write16(rte_log2_u64(size), xlat_addr); > > > + } else { > > > + rte_write64(base, limit_addr); > > > + rte_write64(0, xlat_addr); > > > + return -ENOTSUP; > > > + } > > Is the else branch necessary? As if neither gen3 or gen4, the init woul= d fail. > > Would be better to print an ERR instead of just return NO support. >=20 > I don't think so. > Yes. It will fail in init. Returning err is to stop other following actio= ns like in > intel_ntb_vector_bind() since it should be stopped. > And I'd like to keep them in one coding style. As to the print, I think t= hat can be upper > layer's job to check the value and print err. > Choosing ENOTSUP is because that in init, if it's not supported hw, it wi= ll return - > ENOTSUP err. >=20 I cannot say what you did is incorrect. But try to think it like this way: = according current API design, ntb raw device is allocated when driver prob= e, if init fails, raw device would be free. How the ops be called?=20 > > > > > > return 0; > > > } > >