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 626E8A0556; Mon, 17 Oct 2022 08:22:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5603F40143; Mon, 17 Oct 2022 08:22:16 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 34CA2400D7 for ; Mon, 17 Oct 2022 08:22:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665987735; x=1697523735; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=e1IYTWGAHMmfUGni1S0NssvpreFro4Ttr8NPeVayOnM=; b=i7iTTXd/s0CGimbNFfa8hD02pjoU46MLyE8wYOzNv1tJivHLh4/IE3UC Y3eLNNSvwEByaPmPElACBwJ3/u3N5aSOq+BLlwnZyTs+pMwFYWmT6c+xZ Wazjz9f5va+YqTA31nQV9a5/Uw+6KXOzc4nZQXyLyBVUXmf1qZghFnqWX 0JanhHGhoQKXj9zkMkG+zKJyjqO5UQ5Np3WFKxXh4ZTY4xJavxeGZygTV pdYYP//4dgV6/gW0Q98qZj0nC/MJs7d2zOxdzN/saKhK6nkLvL+V/ACFB 8Ctuj2183r9fZz1Z6CQM92se7HxCngS7Fn+QTXRZ5hxFDJx22MeohXUSt Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10502"; a="307374881" X-IronPort-AV: E=Sophos;i="5.95,190,1661842800"; d="scan'208";a="307374881" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2022 23:22:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10502"; a="606011060" X-IronPort-AV: E=Sophos;i="5.95,190,1661842800"; d="scan'208";a="606011060" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP; 16 Oct 2022 23:22:14 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 16 Oct 2022 23:22:13 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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.2375.31; Sun, 16 Oct 2022 23:22:13 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Sun, 16 Oct 2022 23:22:13 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) 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.2375.31; Sun, 16 Oct 2022 23:22:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D90LZLRmyt2gOJC2jSb39b6OQf0gI6zVBTmGwtTcTH19eYIE83i4yOaI4Fgw7/SbKdjGsICIqChUvWNzeiWH/y26IPXL9EplzSQii1T3+yFZ4W+jGqtMy3jdwbiU3iI/2ubfygmiKXjvR3VuBgLVA50hngAOD7vzQHifjUjug7x65Jc8D6R0T8QGGKG6YAX6l5c5Isqijt1x5PL/KVmb4w2gOsfrRQqtAdV29WEThoQzxAHZnmKRvegUuSKCotrK9SBzxJLzMw1ATiuoBPA4eBk8/siwhgZmiU8yUEUiCdPuDK3kMQq2qNrKj+1BcM4YHFWqcggpE6S1L89CH1cDxg== 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=7lFFw3zgoWPTnIscm+ddHSQTZ5QxEGDxRB+oDNGwcA0=; b=ht1DrRwVoSbbG0jwCbqOc/kx0zFBXZ/FnBFlrw54cS9g8wVVmvf8hgyz32H5EB3mhkYMlDAa1UiisqbXLCq9phtKPgcfZQf+gj8//jddhXL23l4IML1BWOm7RFBkJVxXmtL+6Duo7d5FQL5shOubPHf7c1Np7Ep1UTddqMSNEEzACqWmukSS/HwikXGwbvJhVDjD64YrT1h2bsVt6yp94CdLv/9fXTOm/lnNbiphmCFsynNmj7OXdbTiYctEvXia/FtBJLm6UXHnttCETocEWSDqyHImC58ahgh/rtHTcrd4sbMscEa54LTsohCxvMs7TRz5Fzw+J5GTydpRa0gQmw== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by PH0PR11MB4935.namprd11.prod.outlook.com (2603:10b6:510:35::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Mon, 17 Oct 2022 06:22:12 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::39bf:57b1:4824:d40d]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::39bf:57b1:4824:d40d%6]) with mapi id 15.20.5723.030; Mon, 17 Oct 2022 06:22:12 +0000 From: "Xia, Chenbo" To: "Pei, Andy" , "dev@dpdk.org" CC: "Xu, Rosen" , "Huang, Wei" , "Cao, Gang" , "maxime.coquelin@redhat.com" Subject: RE: [PATCH v4 3/8] vdpa/ifc: set max queues based on virtio spec Thread-Topic: [PATCH v4 3/8] vdpa/ifc: set max queues based on virtio spec Thread-Index: AQHY3uCC0La0z5tIsEuf/AO0OqgFGq4SI5tg Date: Mon, 17 Oct 2022 06:22:11 +0000 Message-ID: References: <1661229305-240952-2-git-send-email-andy.pei@intel.com> <1665650674-291949-1-git-send-email-andy.pei@intel.com> <1665650674-291949-4-git-send-email-andy.pei@intel.com> In-Reply-To: <1665650674-291949-4-git-send-email-andy.pei@intel.com> Accept-Language: en-US, zh-CN 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=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3504:EE_|PH0PR11MB4935:EE_ x-ms-office365-filtering-correlation-id: 73c2d636-011c-4541-bba8-08dab007ed57 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fKtp3KETUCBohjlLTZasbsNkM88QhnqKim/mnTXImB7K1L8qiAfaUDfJfangJCtWXgfYzy2PhQW13OoZduHx6FviUlYDynQLEZFLgghpKGyROmYHM3k8V6i/CBVzmnW8z74ijuwuAUaQywZ+A6buyAovVcaLGz2GZuctSq0Y+WruXmJd6pnD2xgmH3LMDZll/+sWvTW1od9xiI89B6sMU0KdrljJBYhF7FSCG9Z/cN+g284wmht/FWCvc71X6ULlbDVgcH7pFPKM2FH+glahrEi2nv0WM6E30c19VLmIA6Co5tmCqP42YEq2yQCTsoK+dJKrNVNR+o9pzdnB6ko3Z6faQ+BMwLGqRmcdQcaSYbAYdctznzJXuL60OTGWuZswAJUJVfuXe4NbenRuXzozkaOXxj4KGYkTIa4CckIPNnwoMXw0fSDjRTRvwamfHXajRFCpxG1AWMPIzlvXvppn9BDL28pBF7B1xUVG0BwTdJ1sgSgjI2SIR0PWLYKQdPaFO4QhsjChdacCR4JxcWiBbzj3kQF4K1jUes3pL0N03hoEvSHcmhj7xUVFHluSMLsJCjObpdlylrCDfgUgCPf2izAVCsRDd+t2Q/5Pxejp5E+ycz6OOD2LslvFUW/mZ19Qld281FLof3uskDKpuVgNKvoiLofRNFvMM9CiDjGHB+jpTiGTcooRNPj/uwps4CSGuMwNl/1wlUxKrl6zOepNqOcITd0B5drcjJbTNb07i1Uhhkf/rB92jGd6cs8RlI/wJ+hSMx3HHOtKZYXD1monvA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(346002)(39860400002)(136003)(366004)(376002)(451199015)(33656002)(86362001)(38070700005)(122000001)(38100700002)(82960400001)(186003)(55016003)(2906002)(5660300002)(6506007)(7696005)(26005)(53546011)(9686003)(478600001)(83380400001)(316002)(71200400001)(110136005)(54906003)(76116006)(66446008)(64756008)(66946007)(66556008)(8676002)(4326008)(66476007)(41300700001)(52536014)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?50xRHcL1Klu8i5tQImf5fNQhvmq6+LDyxMqMN1Ljznr//gcpfh00iC5aTjHQ?= =?us-ascii?Q?hBxlhfZcV7XEexUqISGkTYqb1s/eET2vg6anEhWYkwcWYzm2j4SwA2TD1ccD?= =?us-ascii?Q?ePZY724sfAZa9B+BkLOs1D7A89xLt1MRVNS5IyGQz+C+zXr8h7lWdZNjtoAs?= =?us-ascii?Q?0zEaWlhOse+YYu6/qJQJpywrT7engoZ0nhvu8l2ZRpujlq9/J3zP6hVrPHcu?= =?us-ascii?Q?FJ8rfzDAPVjUgcFPMhi66YH0CiYkl1Y49VzVfIhHHR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qEEzK8dc7h8uk8Lk4/waAps7K1aGpEyYMX1s7TUFR?= =?us-ascii?Q?GGRuD6LK1LtJONbiqVJTocoLbhUUqcrGNkSsjYw/6a9geIQ9bzig29setiBU?= =?us-ascii?Q?77d0zeLNGHjPkWMPlTm4KVdWw0RZ4Q5L5kVlHUxr7j+W0vscFqDJY0vT0TJJ?= =?us-ascii?Q?WQIQYfKeLJTqVuf+K1aQvqeiaXuEYfrMbOIpjdStfRxspF00SweoHxNltyNB?= =?us-ascii?Q?k1Ho+IgNCCf6V1Dqj0GZul21TMD0LkfehH1UcvK0eemdQo/8rkjTc5pRYP03?= =?us-ascii?Q?v0B61SuzCZYcZToyU8NWCSaqIa0drTmfOjMVKFhGQNGx19P8KUfjchCLyCS2?= =?us-ascii?Q?IHdFYr/MmYBrMHltBoopA8bZbKUauhUiavbRyJogMSuJpCz0TSP2ztJQ7Qqg?= =?us-ascii?Q?dcn4oG2WhE0xdh0ew3Q3cfYg039J6nB0uw39sd8J?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73c2d636-011c-4541-bba8-08dab007ed57 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2022 06:22:11.8931 (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: nK9EAUks+9JkzaGP1qdWPhc/f0BOtTZ3v1MwYnuT+DZpEnf04ef61YqWWIsxdIIJqT9VYvLqKy9YM1++FdEiQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4935 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 > -----Original Message----- > From: Pei, Andy > Sent: Thursday, October 13, 2022 4:44 PM > To: dev@dpdk.org > Cc: Xia, Chenbo ; Xu, Rosen ; > Huang, Wei ; Cao, Gang ; > maxime.coquelin@redhat.com > Subject: [PATCH v4 3/8] vdpa/ifc: set max queues based on virtio spec >=20 > Set max_queues according to virtio spec. > For virtio BLK device, set max_queues to the value of num_queues > in struct virtio_blk_config Missing '.' With this fixed: Reviewed-by: Chenbo Xia > For virtio NET device, read num_queues from struct ifcvf_pci_common_cfg, > get the queue pair number using num_queues and set max_queues to it. >=20 > Signed-off-by: Andy Pei > Signed-off-by: Huang Wei > --- > drivers/vdpa/ifc/base/ifcvf.h | 2 +- > drivers/vdpa/ifc/ifcvf_vdpa.c | 19 ++++++++++++++++++- > 2 files changed, 19 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.= h > index d16d9ab..1e133c0 100644 > --- a/drivers/vdpa/ifc/base/ifcvf.h > +++ b/drivers/vdpa/ifc/base/ifcvf.h > @@ -21,7 +21,7 @@ > #define IFCVF_SUBSYS_NET_DEVICE_ID 0x0001 > #define IFCVF_SUBSYS_BLK_DEVICE_ID 0x0002 >=20 > -#define IFCVF_MAX_QUEUES 1 > +#define IFCVF_MAX_QUEUES 32 >=20 > #ifndef VIRTIO_F_IOMMU_PLATFORM > #define VIRTIO_F_IOMMU_PLATFORM 33 > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.= c > index 008cf89..5a24204 100644 > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > @@ -26,6 +26,12 @@ >=20 > #include "base/ifcvf.h" >=20 > +/* > + * RTE_MIN() cannot be used since braced-group within expression allowed > + * only inside a function. > + */ > +#define MIN(v1, v2) ((v1) < (v2) ? (v1) : (v2)) > + > RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE); > #define DRV_LOG(level, fmt, args...) \ > rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \ > @@ -1512,6 +1518,7 @@ struct rte_vdpa_dev_info dev_info[] =3D { > uint64_t capacity =3D 0; > uint8_t *byte; > uint32_t i; > + uint16_t queue_pairs; >=20 > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > return 0; > @@ -1559,7 +1566,6 @@ struct rte_vdpa_dev_info dev_info[] =3D { > } >=20 > internal->configured =3D 0; > - internal->max_queues =3D IFCVF_MAX_QUEUES; > features =3D ifcvf_get_features(&internal->hw); >=20 > device_id =3D ifcvf_pci_get_device_type(pci_dev); > @@ -1570,6 +1576,14 @@ struct rte_vdpa_dev_info dev_info[] =3D { >=20 > if (device_id =3D=3D VIRTIO_ID_NET) { > internal->hw.device_type =3D IFCVF_NET; > + /* > + * ifc device always has CTRL_VQ, > + * and supports VIRTIO_NET_F_CTRL_VQ feature. > + */ > + queue_pairs =3D (internal->hw.common_cfg->num_queues - 1) / 2; > + DRV_LOG(INFO, "%s support %u queue pairs", pci_dev->name, > + queue_pairs); > + internal->max_queues =3D MIN(IFCVF_MAX_QUEUES, queue_pairs); > internal->features =3D features & > ~(1ULL << VIRTIO_F_IOMMU_PLATFORM); > internal->features |=3D dev_info[IFCVF_NET].features; > @@ -1609,6 +1623,9 @@ struct rte_vdpa_dev_info dev_info[] =3D { > internal->hw.blk_cfg->geometry.sectors); > DRV_LOG(DEBUG, "num_queues: 0x%08x", > internal->hw.blk_cfg->num_queues); > + > + internal->max_queues =3D MIN(IFCVF_MAX_QUEUES, > + internal->hw.blk_cfg->num_queues); > } >=20 > list->internal =3D internal; > -- > 1.8.3.1