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 D203CA00C2 for ; Tue, 9 Aug 2022 16:57:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C794640143; Tue, 9 Aug 2022 16:57:41 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2082.outbound.protection.outlook.com [40.107.100.82]) by mails.dpdk.org (Postfix) with ESMTP id D1A6E400EF for ; Tue, 9 Aug 2022 16:57:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CetTDKSELeiF82nhu871ofuJqINH+SqCqO3JHepeLH9dAlIUv+PvTgV0D1wXztWFukMc+AH2HvzZf9G2tFiIjoyX/udpvm9edzHaXN6/n988X9uP37WYq3Fgau7MCH0BQS1TixmtWCTpS3jOrffKw33o5QMImfo5yhMFIeBBZYHWn2yZIy4v2oEE8NRBbByuumi21R1LKoP1YmoRwKQTXga7QcQJSmpy/eV4+4gRO0iyNFZpA4RINNIzafP+FRp3wEXyor5E0qOvBojRRO4mxaCB9UyMIYu+XFUIQfwqBsQS9fmuJuaUAfwBzgXVsUsKPIBB1KI+JAGiqvwuytedCw== 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=l6eAToAgEHoiAYjlSsqnkj9RcHUoifmtu5cri6dY7DA=; b=T3X8d+ERCRpArlpVxxQ+GzF3Gwm8KxQv5cKQKMF/sWvB7XS0n5doUzmzOe3rgZVT2V+5peCTJ05B0SO2rQT4fQcb1pbn8n6aN61K0yimH1yne1m9tztapmTYOwK3Ff4MoirUY9PxcI0XnGNwhdMFoF7Xvkn7KG0iATOTwaGS/RIHTT/F+QF1sKz+CLk6g6mepK6wOfrjFHUdoPYa4bsudlqjovi17+mmtj2V7qhoEUdDJbueK2zq3aBahpNfcu4SofLWYX3eTKynHp18eiOgNI9H1cYR2lNvZkNbNTsMpbT6Fay62RIUnaEACXWPYiHdVgYo2tYXSzgWJBAUjpAZ1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l6eAToAgEHoiAYjlSsqnkj9RcHUoifmtu5cri6dY7DA=; b=RplVm0CCV2Fzoipbph8e/4qbtKcA6UMkcJqyqc0ovVJQwOqm4A0n6UMuryhW5qYU+HMM1vfdumrQ/tx7vbd0mhlukaL9uij6BNNgCOMcTILZNnCnSu+YgjsTjmHPD6R6Wd4AZFCSg6M60DjIsQfA92lJMrQpG9qv8yDzTslNxC5eX7E0+z0k9b1fWhTRr2jGqjnHI3BMoa7FWboO6Pcm6ZOF8pqMpOgp1i4RUWQcEKfjcNGOWsG/0i/sNWvvCnFvr5W3LZBFZwung8BaAwqaAacVzsBZirp7t3m700GteTzWWqxhE8pVh9eiK5tDPfuOYroRvKDgdO8vyo2RZIeVrw== Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39d::14) by SN7PR12MB6886.namprd12.prod.outlook.com (2603:10b6:806:262::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Tue, 9 Aug 2022 14:57:39 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::8f0:3589:7050:3d9]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::8f0:3589:7050:3d9%5]) with mapi id 15.20.5504.020; Tue, 9 Aug 2022 14:57:39 +0000 From: "Xueming(Steven) Li" To: Li Zhang , Ori Kam , Slava Ovsiienko , Matan Azrad , Shahaf Shuler , Maxime Coquelin CC: "stable@dpdk.org" , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Raslan Darawsheh , Roni Bar Yanai Subject: RE: [PATCH 20.11] vdpa/mlx5: fix maximum number of virtqs Thread-Topic: [PATCH 20.11] vdpa/mlx5: fix maximum number of virtqs Thread-Index: AQHYnCZWDDznhsDbREqEp1/4RFlSOq2myFPw Date: Tue, 9 Aug 2022 14:57:39 +0000 Message-ID: References: <20220720104838.2815387-1-lizh@nvidia.com> In-Reply-To: <20220720104838.2815387-1-lizh@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1cb7ac7-25cd-465f-2636-08da7a1780e1 x-ms-traffictypediagnostic: SN7PR12MB6886:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HPNcBwrRXNQc1KRsOGH3kp3bKG/HUrJbxa9siOk417BFb2M1TP2f0q4ZTsSsTwZvbZ8bQD9hMK1aSR1jtLwscK4V+QACWurpI0tv8LNME0hpibAIa9VKOE4V4oPKZ1O6KbIRc2CtNTc2vx9vcejObruD5EpDNdX1TrxP2BpIDDY05yDuK7uy8Mt2XLnN+j/bHerSOF/4GnYk8oFsnOK5aiAAPhDs8RcCB3A+aS/S9kR9k0ua2/8bsdx4nYUOdhR3RLVCrwtATDC83AqJ7626Oq7ZVoavv/bzkFG+uFTLvKc635odm0QONMy85YHnb58HEUQ9S3zq97fq/RCjVXnR/jhdQWcn5zROLrmgi0wK7jjSJefEYid+FBTKKRNvMyg8eTriHvK/9aBlbztcvvZUE8LCcqd34TladeDR//c32DZJEsVzejxDEDqAW0i1ZAGkSktUJxaG6VDFhd9dJRwdIxGul4HSBzqsihArAei8njMr8g89qVPfE3J0Cy2GXfkNsvm3zFqmLYzbXJF7VjvL1JBjifvUyUY7JCT0hOAYTI4GIFV1WHr7sxGgiK807u0uF7e6h8KpnpQ/UyoHB69rIHGctpAfnqB9RQsDhZgAnQYm2iZ0FUAtMtSm3M5o0SgOKnC0XIwjq5wpPaaSPrLHv41v7FKy1/YLbN1wMpyEYf5w3qsWjhmtQeUBa/QwvSnGrL+5UQzvpzXYEgeXsw2m9ewswF+yq+2qQqq55PssPSupxrRj6HSb05ifPqizZ8767nAgMbCiWqIXSjK97Xvo/3Zv830lnQK9/WoWOvmB/mRdJtPKYR95UcJvv08YWhtL x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(316002)(4326008)(66476007)(76116006)(64756008)(66556008)(66946007)(66446008)(8676002)(7696005)(55016003)(2906002)(52536014)(38100700002)(122000001)(5660300002)(86362001)(38070700005)(8936002)(33656002)(478600001)(26005)(71200400001)(41300700001)(54906003)(110136005)(83380400001)(53546011)(6506007)(186003)(107886003)(9686003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ICQ7b0RZoKDhsM9+w4RvhHJ0ZgqShwPcva0TXHFGoPKeHxLNIcVBTdCVLlf9?= =?us-ascii?Q?l0dTO55F/bjS5Iml77Jl581/QvX2mzxji3PXmIR/7VaE59qg+eY9hUwb5SMe?= =?us-ascii?Q?w0dOXk+hESxeHA7hvpS3Z4puc8ssFbpyuti8AKuD943yP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4672nnDRoJaMQqA/qyMRNaxn26yvIv7nn?= =?us-ascii?Q?ICYSImPQbqyaULs+qJNX2HzRwiSOriCmhkkYxLKwRPgr1Y/YbeyVHEtnm1Jc?= =?us-ascii?Q?ydvwc30lBQv3qAFqsYLKhGLiQnivW+w6mlq2K+WSga8o+J8/BxXQQ+PEz4aH?= =?us-ascii?Q?wa3UCcuqDfzhOMCdy9quGlVzq8nxCpEaTBWlA9xYjxfWE01urprp5VZxVbSq?= =?us-ascii?Q?1mMzNmY6ladcnQ9hd8hDxeIIj/4u8gaAsi3f7W2pBp5Rxnb36zFAlg5QSVGz?= =?us-ascii?Q?VXRyuHeqGNxK2Z8kct8UwjIO8xtTph3LTBhpW3dmnZjstlJYjG4wAguhFDOA?= =?us-ascii?Q?NeK22Xsv+JmEQGBn+os9y/YD2sW7T0+GI27UiGQDsTCgrVnTS6VEZc4LKcPA?= =?us-ascii?Q?LhwONHCKT57k8j0nzNlQC6eln1Vo60HduBu8aqwhtzG9EYFlzEpDFCNV/d5P?= =?us-ascii?Q?wwfoci9tygq48c+E563shTB+SNYierODyXOu8AGzDHAMxhqZ0imw+fffqpsV?= =?us-ascii?Q?/H/2DKoucUaB6wy6TVDMBN9KzDdIpw6gI4hlP0/I?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1cb7ac7-25cd-465f-2636-08da7a1780e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2022 14:57:39.1265 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pj3OeUwyLFycyojGT45l9hwXL6oGYU6SaSnupH0Uqdq9Cq9VLxpPHbraXHQkS74XVoVe+6Kwz/Wr30qA1jZthw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6886 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Thanks, applied. > -----Original Message----- > From: Li Zhang > Sent: Wednesday, July 20, 2022 6:49 PM > To: Ori Kam ; Slava Ovsiienko ;= Matan Azrad ; Shahaf Shuler > ; Maxime Coquelin > Cc: stable@dpdk.org; NBU-Contact-Thomas Monjalon (EXTERNAL) ; Raslan Darawsheh ; > Roni Bar Yanai > Subject: [PATCH 20.11] vdpa/mlx5: fix maximum number of virtqs >=20 > [ upstream commit 6f065d1539bed56602e3c6159c99cccb3bca38e4 ] >=20 > The driver wrongly takes the capability value for the number of virtq pai= rs instead of just the number of virtqs. >=20 > Adjust all the usages of it to be the number of virtqs. >=20 > Fixes: c2eb33aaf967 ("vdpa/mlx5: manage virtqs by array") > Cc: stable@dpdk.org >=20 > Signed-off-by: Li Zhang > Acked-by: Matan Azrad > Reviewed-by: Maxime Coquelin > --- > drivers/vdpa/mlx5/mlx5_vdpa.c | 6 +++--- > drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.= c index 6519b9c9a..65a1edc33 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c > @@ -82,7 +82,7 @@ mlx5_vdpa_get_queue_num(struct rte_vdpa_device *vdev, u= int32_t *queue_num) > DRV_LOG(ERR, "Invalid vDPA device: %s.", vdev->device->name); > return -1; > } > - *queue_num =3D priv->caps.max_num_virtio_queues; > + *queue_num =3D priv->caps.max_num_virtio_queues / 2; > return 0; > } >=20 > @@ -139,7 +139,7 @@ mlx5_vdpa_set_vring_state(int vid, int vring, int sta= te) > DRV_LOG(ERR, "Invalid vDPA device: %s.", vdev->device->name); > return -EINVAL; > } > - if (vring >=3D (int)priv->caps.max_num_virtio_queues * 2) { > + if (vring >=3D (int)priv->caps.max_num_virtio_queues) { > DRV_LOG(ERR, "Too big vring id: %d.", vring); > return -E2BIG; > } > @@ -726,7 +726,7 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __= rte_unused, > DRV_LOG(DEBUG, "No capability to support virtq statistics."); > priv =3D rte_zmalloc("mlx5 vDPA device private", sizeof(*priv) + > sizeof(struct mlx5_vdpa_virtq) * > - attr.vdpa.max_num_virtio_queues * 2, > + attr.vdpa.max_num_virtio_queues, > RTE_CACHE_LINE_SIZE); > if (!priv) { > DRV_LOG(ERR, "Failed to allocate private memory."); diff --git a/drive= rs/vdpa/mlx5/mlx5_vdpa_virtq.c > b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > index 0d31e1d95..a1ae02292 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > @@ -450,9 +450,9 @@ mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv) > DRV_LOG(INFO, "TSO is enabled without CSUM, force CSUM."); > priv->features |=3D (1ULL << VIRTIO_NET_F_CSUM); > } > - if (nr_vring > priv->caps.max_num_virtio_queues * 2) { > + if (nr_vring > priv->caps.max_num_virtio_queues) { > DRV_LOG(ERR, "Do not support more than %d virtqs(%d).", > - (int)priv->caps.max_num_virtio_queues * 2, > + (int)priv->caps.max_num_virtio_queues, > (int)nr_vring); > return -1; > } > -- > 2.30.2