From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56F49A04FD; Mon, 23 May 2022 11:03:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02FAB40141; Mon, 23 May 2022 11:03:35 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id D8AD440041 for ; Mon, 23 May 2022 11:03:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653296614; x=1684832614; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=KeKVl65vyRmd84dUaO4tiSll1wpBjHTtxtjQRQf8Ps8=; b=OmCLuWCBYr0ZgGkgGH1ZOpoAE3pU9sklpw6SNDaNRo54GD7Pdg36oTZ7 9D5mWVXm1PhCsBx0kbd3CizTW8YlJeieNRu/+9SwO1v2Cu4WZ96fBZBlk tjgVATqwXt4Jpil9Ch7Zt1VePyAMjcGceFqaqfi8yyrJmrwkcH2+57RS6 sh+I8PgzwHGxwxpkCPzf9tj6m90ihgVYcSd1nn7cNPut146Ye0xLN8+9S HUpX+JRNPwwRdwDs2HPUDe4lO3FzscUNzXt8AqpQtEcJzqkbw79l4vCU7 1yKHGyfhRP5J3VJ3Qgibtml9Nzd1DTemKL6HoDtUn6XglzHWHYaMGJ5oV Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="253032356" X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="253032356" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 02:03:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="577295808" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga007.fm.intel.com with ESMTP; 23 May 2022 02:03:33 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 02:03:32 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 02:03:32 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 02:03:32 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 23 May 2022 02:03:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E0Db2aqjEnishoW2qP4OHUGBVnYvJcH6Vqkta84g1kz6StZ49IO4fpODcOwXC66jEqzbBrMHZQanA0Hf8EI+xTIY9RRXhGrX+1HqwVn/6UObZkIPpcmPqpzeI3qczLKHcOnmyhXWiG95V+rCHC+xS7+FZzVv4VJTmNBV+xgHxpmIZhv2acT0myw7/XHaDyEh6xZJIU1mAf2s08jl4HwpFWu3LD265Vfz0cVRU8UQENIBmTgWkBuFSboAvjZHPlbXHXE68SBbntp+Ovm/h4et9vYGC/gGvZi6cB3U/wz7e8fYXi9LDGZQWn/szAnpEHInW4HApQWSYG/Jsgxifq/1Zg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wnaEJDRnJIyvxDmS69h8mySmmg+g1djrbFKe//hZJyI=; b=eM9r524Mrfe4dSav9Lt23/EJCL4gZPXhqsH87TctCmkWGgBJteCF+JPZZE6HUpVmboEQUphEPZacdgQQJMw54GRadoILvxVKB+F1QQB/aX5+/L/ed0dUlh1QjgweFRJs6yfPvAqHUZUWDBfDQ9OiId1HuuMoi6ecwqg+QLl5seZ4oEm3BKq3otTWtRZnyaL+moPZz3aWLQJM7EU4iYs2eSLbwBg9Rn7QXZr6kx0RhTd0aTmFhXmjQkvqZcUr1RAy0+ZXXpKeH24sb8U6Pn9KeNa3FpHKOB50HEeayvMQ9pe+c8f9yR6aK0UObTaJVMhe/o358udWJ5MkIK2tJi9HTw== 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 Received: from DM5PR11MB1739.namprd11.prod.outlook.com (2603:10b6:3:111::22) by MWHPR11MB1534.namprd11.prod.outlook.com (2603:10b6:301:c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Mon, 23 May 2022 09:03:24 +0000 Received: from DM5PR11MB1739.namprd11.prod.outlook.com ([fe80::8c3b:8a54:d186:b555]) by DM5PR11MB1739.namprd11.prod.outlook.com ([fe80::8c3b:8a54:d186:b555%11]) with mapi id 15.20.5273.022; Mon, 23 May 2022 09:03:24 +0000 From: "Pei, Andy" To: "Xia, Chenbo" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Cao, Gang" , "Liu, Changpeng" , "Xu, Rosen" , "Xiao, QimaiX" Subject: RE: [PATCH v8 13/13] vdpa/ifc/base: access correct register for blk device Thread-Topic: [PATCH v8 13/13] vdpa/ifc/base: access correct register for blk device Thread-Index: AQHYardi3RyBGXp8kUWY2h8od7zNyK0sH3fQgAAS31A= Date: Mon, 23 May 2022 09:03:24 +0000 Message-ID: References: <1643093258-47258-2-git-send-email-andy.pei@intel.com> <1652876035-70513-1-git-send-email-andy.pei@intel.com> <1652876035-70513-14-git-send-email-andy.pei@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-version: 11.6.401.20 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 34c5cbe0-4ec6-4824-4e30-08da3c9b17f4 x-ms-traffictypediagnostic: MWHPR11MB1534:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qEAulIPNSFJb/SIau+2sNtdJQmJUHqExeGhMh9dWFgtIMlYgxAXs5tFuGITPjXk/5zN8FEIqXSGCD2E8yUZSnklZ17TKvcZsWucYCcgOX4n9BtQLjw76xNXiVovC+wtIDf51pMtQA3C1JwGQtAK89FyPXzf7HpVG3V9hqysqIuRpjXe6cGu+OieuOVCvQw0XCzQgl7TEife7nHXa/KM2IMNYJyGOQDcA0QETDj3PUptU9+iJ11uPI42i5I4o7nWvQXUXc1/4eov45NZAJswKyFkjeE5MXpCWRFqk9WRM7ya3VfB1/TWzJBMd90Rgbtujsh07Kwh84MOzqdCzaqeyW0Jm0vNlpH5ZT/MeOKinBwla9IkTFuMwPZkEjkTm5isKcypPgb60N2qzwwrNQenM08aPzVUrrD6ei8WNL2rN6QeUbpnYC7WiJg4BLPtwx7dzbUjyG4rj2QVMLiufQ5lEhCQ6mmFRAX+Pt9yEkANk1IoRjBwa7CLbKotFWFwCZEvbssHl9pXlsquoefUvfMjJ9Q640R1jDt3tCOn3t3/I4Z5bMy20Jpql0vqS5vlYVNN793hZJUU/gpCI0vkp7jh4/XyNvk2WNU+4xI3sS95euvmIyMqXNC+cGx+w7HIQ/tp3frlZhvDrLWeN4hoMhqxlqd/sngI57uiw7v1p/0ymrEs/HTrI5xBK+QJ/a1dqEmflWkNT1w/En402dUHVwxPUBg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1739.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66946007)(52536014)(8676002)(64756008)(4326008)(8936002)(76116006)(66446008)(66476007)(66556008)(26005)(316002)(6506007)(53546011)(82960400001)(9686003)(7696005)(2906002)(5660300002)(38070700005)(38100700002)(122000001)(86362001)(54906003)(107886003)(71200400001)(33656002)(110136005)(55016003)(508600001)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0PAGfgfznWP99pzR41F66sxGfbnyC/6d2KNj+fr2f6HpniNhmSkBsF3Mo+dY?= =?us-ascii?Q?zRxTzYfKnGMhBUId4l8OhpMtV7rps4AZSFZkYZn2sR00lNnRaFSGKXvSVqtW?= =?us-ascii?Q?RC75WTJBEh6YTgRVdFEaf9Le1XYua489Ipl+grCK4ukv9S9UWOt+rbV66/6e?= =?us-ascii?Q?6dUup9K2uStO78yY/HmPDSwfZgteuPn6QXmTKOuKCB30xeKLpxhZhT/Hfjh8?= =?us-ascii?Q?wUfd7acVGKsU02Ak/O7i6+PPIVVmRa+SQAJ5rsFzwM6WmMv4zNe5iBPWYnUg?= =?us-ascii?Q?arxZUTURSlgOQ2khvHCtgfVxVutzMBUsDk+3fV//9lYjA99Z4DR1t64CQIPA?=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rD2s7vuO6wtL++jIwDVM6joYx?= =?us-ascii?Q?kKnzU7y52PiHg6eRnxwrZVn7osM4eW+EJxnrZcsoXqqiKxnUS0H0g+RMAFwJ?= =?us-ascii?Q?J5CDZpwAiSIF2gSCTYj4FfYlIwizt2txj4YAdGcc21sfxbII9+AS0gaMPzCD?= =?us-ascii?Q?oFpcHRovFLIV51OuW9+a+OGiwyM9xQndP9srIOkVRcHqTH6lHStYqD6ocO9f?= =?us-ascii?Q?G+DA1YT1nwAt6UxdL87nCJDxW9/wkZc3bm9Z/no4wOoxuDJUyaWeUE1uRe0m?= =?us-ascii?Q?kMEnMr64DWABsIrDyoC5MM4yYNSTBTWwLYLN1K0bqM8E33UuLzcvq46R89w7?= =?us-ascii?Q?AErOKAZdoc7B208B6l6sO2MHivHAZWWjcFQmCHsTWPyhKHW9k58joKEUoQc0?= =?us-ascii?Q?+bzLbpxdMIiRt4Ubmnh9EndIod16T/tdyQ95U9NlL41nvznMP+pMWdyfXbM0?= =?us-ascii?Q?6OtJ3mtigssDD+ftkLqp/U5YzE6CSRRu6RrkCgxCkLlY63ZTvD1ZUkmeN3Qq?= =?us-ascii?Q?oh36KN2/kw=3D=3D?= 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: DM5PR11MB1739.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34c5cbe0-4ec6-4824-4e30-08da3c9b17f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2022 09:03:24.5518 (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: uMImXI++wptA4MhzT4DK86bCvJNPEGciLycCcAuIzHbdOZUqihYaX6lnFVbvCmxcYX51PUhTLi9P/16vZsP1pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1534 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Chenbo, Thanks for your reply. I will address in next version. > -----Original Message----- > From: Xia, Chenbo > Sent: Monday, May 23, 2022 3:56 PM > To: Pei, Andy ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Cao, Gang ; Liu, > Changpeng ; Xu, Rosen ; > Xiao, QimaiX > Subject: RE: [PATCH v8 13/13] vdpa/ifc/base: access correct register for = blk > device >=20 > > -----Original Message----- > > From: Pei, Andy > > Sent: Wednesday, May 18, 2022 8:14 PM > > To: dev@dpdk.org > > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; > > Cao, Gang ; Liu, Changpeng > > ; Xu, Rosen ; Xiao, > > QimaiX > > Subject: [PATCH v8 13/13] vdpa/ifc/base: access correct register for > > blk device > > > > Register address is different between net and blk device. > > We are re-use most of the code, when register address is >=20 > Re-using >=20 > With this fixed: >=20 > Reviewed-by: Chenbo Xia >=20 > > different, we have to check net and blk device go through different > > code. > > > > Signed-off-by: Andy Pei > > --- > > drivers/vdpa/ifc/base/ifcvf.c | 34 +++++++++++++++++++++++++++------- > > 1 file changed, 27 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/vdpa/ifc/base/ifcvf.c > > b/drivers/vdpa/ifc/base/ifcvf.c index d10c1fd..dd475a7 100644 > > --- a/drivers/vdpa/ifc/base/ifcvf.c > > +++ b/drivers/vdpa/ifc/base/ifcvf.c > > @@ -218,10 +218,17 @@ > > &cfg->queue_used_hi); > > IFCVF_WRITE_REG16(hw->vring[i].size, &cfg->queue_size); > > > > - *(u32 *)(lm_cfg + IFCVF_LM_RING_STATE_OFFSET + > > - (i / 2) * IFCVF_LM_CFG_SIZE + (i % 2) * 4) =3D > > - (u32)hw->vring[i].last_avail_idx | > > - ((u32)hw->vring[i].last_used_idx << 16); > > + if (hw->device_type =3D=3D IFCVF_BLK) > > + *(u32 *)(lm_cfg + IFCVF_LM_RING_STATE_OFFSET + > > + i * IFCVF_LM_CFG_SIZE) =3D > > + (u32)hw->vring[i].last_avail_idx | > > + ((u32)hw->vring[i].last_used_idx << 16); > > + else > > + *(u32 *)(lm_cfg + IFCVF_LM_RING_STATE_OFFSET + > > + (i / 2) * IFCVF_LM_CFG_SIZE + > > + (i % 2) * 4) =3D > > + (u32)hw->vring[i].last_avail_idx | > > + ((u32)hw->vring[i].last_used_idx << 16); > > > > IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector); > > if (IFCVF_READ_REG16(&cfg->queue_msix_vector) =3D=3D @@ - > 254,9 +261,22 > > @@ > > IFCVF_WRITE_REG16(i, &cfg->queue_select); > > IFCVF_WRITE_REG16(0, &cfg->queue_enable); > > IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg- > > >queue_msix_vector); > > - ring_state =3D *(u32 *)(hw->lm_cfg + > IFCVF_LM_RING_STATE_OFFSET > > + > > - (i / 2) * IFCVF_LM_CFG_SIZE + (i % 2) * 4); > > - hw->vring[i].last_avail_idx =3D (u16)(ring_state >> 16); > > + > > + if (hw->device_type =3D=3D IFCVF_BLK) > > + ring_state =3D *(u32 *)(hw->lm_cfg + > > + IFCVF_LM_RING_STATE_OFFSET + > > + i * IFCVF_LM_CFG_SIZE); > > + else > > + ring_state =3D *(u32 *)(hw->lm_cfg + > > + IFCVF_LM_RING_STATE_OFFSET + > > + (i / 2) * IFCVF_LM_CFG_SIZE + > > + (i % 2) * 4); > > + > > + if (hw->device_type =3D=3D IFCVF_BLK) > > + hw->vring[i].last_avail_idx =3D > > + (u16)(ring_state & IFCVF_16_BIT_MASK); > > + else > > + hw->vring[i].last_avail_idx =3D (u16)(ring_state >> 16); > > hw->vring[i].last_used_idx =3D (u16)(ring_state >> 16); > > } > > } > > -- > > 1.8.3.1