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 7CD24A0350; Mon, 10 Jan 2022 14:09:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01C2D410FC; Mon, 10 Jan 2022 14:09:17 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6E0B640041; Mon, 10 Jan 2022 14:09:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641820154; x=1673356154; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ykYQOY8Nneqci1GirWB/ztGyBX0JC01RN/4JG5z56Rs=; b=kJf1sJALA7CM48P4lrRWZxKj1/dcyXKfqaIHWuqJLLcxkOZeCzNd1G9F rRbuGuNbqMEWXcYOHqnkGP5DYpECkSRQm7O9vmZrshw+X5gGfz1GFKoUY Ae2lz/3OY+FlCzNin8PvsFK0RnR396KSZXYarxvQVDvttJbSo96FJIWsg 9UMQt5vbw5X/jbsRaYn5ErWcNhMFQ2b0pI5UN6wMMbUnZzUTejnk1QiP4 T1WEn7Tf5Z/ez2dzSFZ1Cvk12RhszVjhBO4QKi3S/OKz0KfqnsbC8QPzg 7IZN5h2D0gCuLYIhEXwQvyhGWh7af9e5s2hyVwsKF/f0wAbH2pfaJs/Zp w==; X-IronPort-AV: E=McAfee;i="6200,9189,10222"; a="230559805" X-IronPort-AV: E=Sophos;i="5.88,277,1635231600"; d="scan'208";a="230559805" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2022 05:09:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,277,1635231600"; d="scan'208";a="528263435" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga008.jf.intel.com with ESMTP; 10 Jan 2022 05:09:11 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 10 Jan 2022 05:09:10 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 10 Jan 2022 05:09:10 -0800 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.20 via Frontend Transport; Mon, 10 Jan 2022 05:09:10 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) 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.20; Mon, 10 Jan 2022 05:09:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BuNmn57ucYkgHif9v4myfFnYvu4rbIilyvkSoOARj7s3h3G6iSp5VgOASBNIW++JccZaejlYm+utdvLeQWCATFKe8UTPkA9WAwonZwHESsXY03/wUMLxA6imd/DGfxJyUNrHKbtUgF0Kyyj0irUFKpUllbOa+9PrPE+7DdJ9PGafGcVeC67Xc7RtlcmjkxNokny9B+EVWLV1Z6pUOnoH1KT1G/4UveSsD70VWr+l0LZd8ZYmObEta8D+cDvRWtwrSxigHsQ2ej639pQT7LrwJPCeK3/0OnhUCn8p6cMD1A7+swTmsgL5y1Mp5MknwEXhEQvH5qF4QuriUPZ0lvUx4g== 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=yXbE504UvvZ6lYQCdWakneITyD4z2eyRcHQzqp4+p7w=; b=DD46M+Vhops8UGRlEG7wzPYINUvlOsWhLVkUQZ+3A5Pb/AyHPSHPsEAxAGP/wKjjlXktSN70nEyiGH8x6y+5g1mbXnAwwcwCwQHQlUDA2dygOOM+xXTTgoEz6Uy2kw5Y6hpVcmWTNd8P8Enw4ip5kBcyXXgDf+MrByIjz3BnCCEgB+vn+LfsA0wjsEpo8pRbD7+2pv7gHoQtF18hpcP8SYfBrQO5VSjSh21KTVHmFv6ksOOdjhnbv7rYtQvMd558b+NbuCABnjKUPx36y6uwfHSuOe4o1DqkpsWLZiwqTjIGSoeR4Lf//+ncHIvFV4uWdRq8AhjWo8ZnITZb68+GCQ== 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 DM8PR11MB5605.namprd11.prod.outlook.com (2603:10b6:8:26::11) by DM8PR11MB5671.namprd11.prod.outlook.com (2603:10b6:8:3c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.9; Mon, 10 Jan 2022 13:09:03 +0000 Received: from DM8PR11MB5605.namprd11.prod.outlook.com ([fe80::6d19:bd17:7a9:17e1]) by DM8PR11MB5605.namprd11.prod.outlook.com ([fe80::6d19:bd17:7a9:17e1%8]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 13:09:03 +0000 From: "Pai G, Sunil" To: "Richardson, Bruce" , "dev@dpdk.org" CC: "Richardson, Bruce" , "Laatz, Kevin" , "stable@dpdk.org" , "Hu, Jiayu" Subject: RE: [PATCH] dma/idxd: fix burst capacity calculation Thread-Topic: [PATCH] dma/idxd: fix burst capacity calculation Thread-Index: AQHX9cQR1Iyyg4jsP025h/EnRjKVIqxcWpgw Date: Mon, 10 Jan 2022 13:09:02 +0000 Message-ID: References: <20211220170514.736732-1-bruce.richardson@intel.com> In-Reply-To: <20211220170514.736732-1-bruce.richardson@intel.com> 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.6.200.16 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: 9ac2529e-b336-4a8e-02f6-08d9d43a5fe4 x-ms-traffictypediagnostic: DM8PR11MB5671:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CDWOnKYi5hNgufbkY/2e9lsQuvo3OPPLInnAiAksrRI8JVSj92wL8+/UaGMjjLWekKFxLMSB07Mp7/mhlRACbs4xQWLqRJJ/39BmQpvHKRvN4BBEyWL02FrsiegIzRcLBgaaXOWZ8Wqz+RYM5c0Zs5gitRrK5JOAAONSlxO9RnvREUL4vpTbwM0GZORBRi6gNmvEgoyQTj2TC9azijAr8VDiqc6h75h8NbwIrOUrcBz6pnGB0iT0XRNRlc6xO3kdFiK/UhAiUGqGYlWcwdDJk9aXIYLETak1wC0TR9UVaNpD7ziGVOVgT/msoEaJUNi5KUtP4BIL963esTyPqjI+GbWFkOsb5Y4XNZvO7a5UszYU8Iz+st5yZ1hSiQ2oj9Gm0MlO98yjd8BajI9EvtJSZfMTIY6JsEMpqmlaW8vF0Sll4rqTMPX9hx3Lbw0qCp4qXRoCZui9tsNAFZockNW7x2ond4Rqj6V8S92R9bLntLtBC63FZJS9oel2+ccbUuw6jYMz+YmBHfCzGiNEdaCTMwdNgpSUIZWTakX0gJ6oU5P4izq86blJ7h4tza0fd0eHbth/l1Bi33qDdPzuC5Z6a7ZwbvNIMClZWBOSFgQCF8lNMP8BSmle3HNVYAs/rtBEoKhRWvT5gYcCsGl924fPKMze7qKGYZ5MyRlkmXEr2EZqjZ0EEn/nbTYH+f0VD22yDDbRkmpliR0QSmpoL2M+OQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5605.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(4326008)(7696005)(508600001)(82960400001)(450100002)(316002)(26005)(4744005)(186003)(107886003)(66446008)(64756008)(52536014)(33656002)(66946007)(66556008)(38100700002)(66476007)(6506007)(9686003)(122000001)(2906002)(76116006)(5660300002)(8936002)(110136005)(54906003)(55016003)(38070700005)(8676002)(71200400001)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ZGq7m+6BuvWTsG1HPCgMfEI25i/totH1q7BmEFkbxI/U++GIPMorqUk5K/VQ?= =?us-ascii?Q?2G19gp1b4tKQ4bF3Vuy2Jp4eHJCEeegD8T0JKaAS2ZhVvW197hzHIlV1GjKA?= =?us-ascii?Q?rjlcWqrjJKu1O7Bz+UFkIxmC+5eQPd50bbUi3QzsHyNACloyt5kRm84k5+ib?= =?us-ascii?Q?vLg294GIG7JeQukMMuDR4MGfVcpLnSZv8E/UriTmzcCmYK15j84H2mdoyIqt?= =?us-ascii?Q?KQKMpwXgz6lBMxMjoKB+cIVyQRuAwwDb5B2kWtq1g3Z4kruM/tDIxs/NrTyy?= =?us-ascii?Q?Uj13sMF9I2OZln6sQewoMIj4kzEHEH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?Q?9G04f2q9Y8rS1n5Q1nzovET6OxXfc7xAFIrLDtXTkERCmiCu4HqiLEO+VTKA?= =?us-ascii?Q?1J14aFcgofEXUSf/OwZCX9Qz72i9nntdQCJjhDpxQpVrmYV9DEr8OuLGJJtX?= =?us-ascii?Q?i7fdNRYPV9dM8Z3jAoflupbgzZpb1i/qtReNRte+a1Idjm3Ng2gudvxex/R/?= =?us-ascii?Q?UCRWa3i5yfxU3rm0OZOXFSsaR6SwwDfOtnSO+SrHR3J/syRXdnkv8CjEYaYM?= =?us-ascii?Q?xcZF9Kj4cqCN2t7BsmiFcyGoV1RkzDSqFyibqvwnHsv8e95kjpxlkuZMYuXi?= =?us-ascii?Q?9mXdrpb5UwY0wVPyhCQ4MWZ/bgrniMEyUauFQzTuudivkDJeN19KuMn3nSII?= =?us-ascii?Q?6kVslYBRTIGN86EGsF+XysLavSQ5hW4fNt5kpekN9X3ebMI/WxwAMVlSu0wo?= =?us-ascii?Q?Cw=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: DM8PR11MB5605.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ac2529e-b336-4a8e-02f6-08d9d43a5fe4 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2022 13:09:03.0082 (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: mhULcOx6A+vSC2SkTo4vgyeq/T017WuJS4IllPo6NEsjsoVoDywLrWETlcKWHtSHknzQcamLcJhuqxRIqp0rNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5671 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 Bruce, Kevin This patch seems to have uncovered a bug in the driver. On applying, the idxd_burst_capacity API seems to return 0 for cases even w= hen there are batch descriptors and ring space available. Seems like there is a wraparound missing when calculating the descriptor ri= ng space, causing this behavior. =20 Below change seems to fix the issue. @@ -483,7 +496,7 @@ idxd_burst_capacity(const void *dev_private, uint16_t v= chan __rte_unused) /* For descriptors, check for wrap-around on write but not read */ = =20 if (idxd->ids_returned > write_idx) = =20 write_idx +=3D idxd->desc_ring_mask + 1; = =20 - used_space =3D write_idx - idxd->ids_returned; = =20 + used_space =3D (write_idx - idxd->ids_returned)&idxd->desc_ring_mas= k; =20 Could we include this fix in the current patch ? Thanks and regards, Sunil