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 935A541B89; Tue, 31 Jan 2023 06:22:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80958410EF; Tue, 31 Jan 2023 06:22:08 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 1E306410EF for ; Tue, 31 Jan 2023 06:22:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675142527; x=1706678527; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=fzyMniqigiG0uwkpC0zMb13W8gzuBcCmfjnQcj2xtZM=; b=FK6MS20MJ+eslc1w5Xvp9qMQ2b2CeUXw2cqr3HjEqm7TSqxrX0MxFfE9 9RR/dRudsTRc6vKc/R7Wdll2Ht+BLwkWVRZSctgBbptv0n1thvTFozemj Rd81QZ9Q7jTncHXIWyRwI+SLJrw9BRxMbu4jFLrrk3+b3DCvAu7DCexES jI4un36zP8EVQL7l2rF0jlqpdW5PC3q42JpaYkLcu2p1GsM79fonS2wmD LPzndrEWRzgNwPyamQ+Ny34E0SCa+tfsaXNa+Oh6oxHqYdbnKwL6eOvDE WLJERXfODrPHd5PV3t2Hv7r2t5z8bf220B5rKUKLx8AsoBdB1zJeqtMHC w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="413971085" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="413971085" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 21:22:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="772820273" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="772820273" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 30 Jan 2023 21:22:06 -0800 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.2507.16; Mon, 30 Jan 2023 21:22:05 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2507.16; Mon, 30 Jan 2023 21:22:05 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2507.16 via Frontend Transport; Mon, 30 Jan 2023 21:22:05 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 30 Jan 2023 21:22:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CPsfFNox69LzU1vRKxC7V/WwbEHVILf+G2dB8g0mTV9BJaFx5pEtbhCHaSSYZFWfPxtgcEyAnoVFYe+IhfW/Ml/wspTkTCfbNx+yvFmB0QCDHx0Ov2j3ffrVXfG94z0GeLcR5fBtRcTR5syZXqz9BArz6Ta+O7lioy+UsD5KpYALuYeDlWr+q3D7H0KO+IprUXECJt9KjXtc4Q6FGiOxXBun8SB2dh8wlGnXhl3M6sOdJuMIS8QHR5Ts+ej2kkO6jiyg1o5MZFKQD33pZ8b1fPhe9RQl2d8XcwJJPcLEWOVk8jDe4JS6Hrze2f4gnAew+bBE7/PuSw4nllXXAlTQwQ== 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=teah81rs2Mvph+9lp7z2ZwYio9QegSwtvh14A0iv1Qw=; b=LnvFloviCm3gdDNTZxJwIolP1z93AB+17/PxrMDaryuQazqfUBBIkdV/V6pm70jE/uon/hcRnnOStGzaTGEWiQ4sRTnYXXG3lr+NzRCjZatx/vKtYVPYSjXezJQbXuEf8c/IyBSSBKjY7S1u1+Q+KYkVbboL1GP40iOe6Qc+aqmbiSNY4Yd1vvr+zkVJH3Is6yZDGxixGyTqKGkfngqqD6gXYKUmL8akqc6sEgKXcNpP36OlItfKAKHQCo6YrgR4E26gaO8CMcXlFaswcdKE2gHxTlTZ4lKzyRHt7EjuKMiKEAWCuiBq+xdPE+DCFhV1ZhD17BCx8m6U4N0XoCDCsg== 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 SA2PR11MB5050.namprd11.prod.outlook.com (2603:10b6:806:fb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 05:22:02 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3%5]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 05:22:02 +0000 From: "Xia, Chenbo" To: "Coquelin, Maxime" , "dev@dpdk.org" , "david.marchand@redhat.com" , "eperezma@redhat.com" Subject: RE: [PATCH v1 17/21] net/virtio-user: send shadow virtqueue info to the backend Thread-Topic: [PATCH v1 17/21] net/virtio-user: send shadow virtqueue info to the backend Thread-Index: AQHZBNR0eWyB+zrnwUyQpMf3x4Eu7K64XjWg Date: Tue, 31 Jan 2023 05:22:02 +0000 Message-ID: References: <20221130155639.150553-1-maxime.coquelin@redhat.com> <20221130155639.150553-18-maxime.coquelin@redhat.com> In-Reply-To: <20221130155639.150553-18-maxime.coquelin@redhat.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_|SA2PR11MB5050:EE_ x-ms-office365-filtering-correlation-id: 3367d0b6-d5b9-4ac3-4b6e-08db034b15ed x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F3CyBAVk1XlUCZFSmVWxj4+kon7/bcz2qCzhv3uWP6UjrBixTWxEi4amd6spbT+AwuCFam8Cil5cp5ttxWc98lF/kDe8jhuwwqYdJeJ5kACginnMrYw50wCbCJ2CDth9uCxSV4GQaPVDVHULdCXserCygBlaWCV0r5Ze99Ajde3t0rchIg4zv3ispT/rqJ3Kg3ZP9XzIFjB+49R2EAl1n6u99E1ptWLbKaLcnqhyh5MTh1KvuPTuBw07GurafnxP3qNdfV7KbNf/uWZMrpuN8gS08h47AyLTc+Ydkfcf6byXJnoNqrC1Oa9s+T0s5yruaRkIIKhwZf/4ZC/hZQA7hveKUxsMDd2J5nI0z2+r9RfcbOYOjeou3MH4tmHddS6+ck56reckb50nHefyLFW5G2wWUkPBwVlecVpL9/kEu30vVjpYlUMMRs6gY1B/ILp1Lpk3aWiv7ITAtNUS2XmZ97LebNwX8Xf6dmmIIyvC1cIo2v4QPA/bCkvpbMcH3XFU3SvPxFdHiB/yRhEh1FQwspUIHnNEAU0Vj2y3dROTKL2GaHnAWJHuk2kAljjJZoIAFgb4qQQJm+T9eOBg6NmLTi83+JKDtEXrxw83kxqWc8/cXc1brZUACnEfMhgVcK3UfMLdQvfhVtmo7YJRfW675YEHZeszT7dQ6Su0lUjPiuo/Du0nuI6+5nr/NhE4yIEIEA1I5M2sqmyzj6P4Sk5naQ== 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:(13230025)(376002)(366004)(136003)(396003)(346002)(39860400002)(451199018)(122000001)(110136005)(71200400001)(7696005)(33656002)(82960400001)(5660300002)(83380400001)(53546011)(55016003)(6506007)(38100700002)(316002)(52536014)(41300700001)(2906002)(86362001)(8936002)(38070700005)(9686003)(26005)(186003)(8676002)(478600001)(76116006)(64756008)(66556008)(66946007)(66476007)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Dz/58vT3nIXHnKhhM2P+Z506I1qgH8RUgRl0etYsyQ+Z5hMumsyfsmt/A/Zh?= =?us-ascii?Q?nYpUFKJ5q8y/T1TKWD2g8xC04Qcta8AMlqCtwB0xqDdf239msLVe392hGstY?= =?us-ascii?Q?AcJIABQMrC1xAVqU0D0DXftygZN/pv11rqKRk5UrsRrDiONl5a0J20MeenYh?= =?us-ascii?Q?bKVPBHzaDb3sV+TddRe+xtm15qaUQ7ErHybNJe7wgdHdXNOMui/TXNhV/I7V?= =?us-ascii?Q?KH5jBZU5LOXjOUxmk7BpHc9ibD6RaRwNCe2Edn50eR2vfj8UXtEtx2HLLfx4?= =?us-ascii?Q?fI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38wo6kdKcRe?= =?us-ascii?Q?JhPAxMsIspkgYaYZ4MOgqDQ6tOH1jrB5Czcx8VQgueKA3Cvld8YTAilHIUVG?= =?us-ascii?Q?HU4CpiqwwvIyyXdqk6favSvduu4NE+voDv8tcMwTENyEh2v48sow7dvsopTp?= =?us-ascii?Q?XXS4RNAUpzmBelw4GxNruDwssOCWrqgHq+MuexpeXpUIXwwfpgCyWnzB5C4i?= =?us-ascii?Q?6EIYZLDAozmXnVK5gv4ssevxdrSmEbcoJG92QKWhzaiZMVQLW2ch+acUmV5I?= =?us-ascii?Q?gISc3fPUik4m0JoAv09g4oYpfARttKRSnib5Z2UeWvnRUz8i+0EzywgRcg5B?= =?us-ascii?Q?GMmU+tOaidwr2gNKa3H4/BOBQgwZS2tosokk35RKmUDV2w8s0E93Tk0EagmL?= =?us-ascii?Q?+GjhuX+hK/WbTbrzzs/BS+hq2h/j6QaU0//p3IF+?= 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: 3367d0b6-d5b9-4ac3-4b6e-08db034b15ed X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2023 05:22:02.8048 (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: bMUg5Jn3QeSWc8Y/+6HOIo+DGnwR+ESvoPAZ9qt2bnEB8QwO8WATt7/rCnns5wTzW6fIKtJCqJqIZNquF9EpwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5050 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: Maxime Coquelin > Sent: Wednesday, November 30, 2022 11:57 PM > To: dev@dpdk.org; Xia, Chenbo ; > david.marchand@redhat.com; eperezma@redhat.com > Cc: Maxime Coquelin > Subject: [PATCH v1 17/21] net/virtio-user: send shadow virtqueue info to > the backend >=20 > This patch adds sending the shadow control queue info > to the backend. >=20 > Signed-off-by: Maxime Coquelin > --- > .../net/virtio/virtio_user/virtio_user_dev.c | 28 ++++++++++++++++--- > 1 file changed, 24 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c > b/drivers/net/virtio/virtio_user/virtio_user_dev.c > index 16a0e07413..1a5386a3f6 100644 > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c > @@ -66,6 +66,18 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, > uint32_t queue_sel) > .flags =3D 0, /* disable log */ > }; >=20 > + if (queue_sel =3D=3D dev->max_queue_pairs * 2) { > + if (!dev->scvq) { > + PMD_INIT_LOG(ERR, "(%s) Shadow control queue expected > but missing", > + dev->path); > + goto err; > + } > + > + /* Use shadow control queue information */ > + vring =3D &dev->scvq->vq_split.ring; > + pq_vring =3D &dev->scvq->vq_packed.ring; > + } > + > if (dev->features & (1ULL << VIRTIO_F_RING_PACKED)) { > addr.desc_user_addr =3D > (uint64_t)(uintptr_t)pq_vring->desc; > @@ -118,9 +130,13 @@ static int > virtio_user_queue_setup(struct virtio_user_dev *dev, > int (*fn)(struct virtio_user_dev *, uint32_t)) > { > - uint32_t i; > + uint32_t i, nr_vq; >=20 > - for (i =3D 0; i < dev->max_queue_pairs * 2; ++i) { > + nr_vq =3D dev->max_queue_pairs * 2; > + if (dev->hw_cvq) > + nr_vq++; > + > + for (i =3D 0; i < nr_vq; i++) { > if (fn(dev, i) < 0) { > PMD_DRV_LOG(ERR, "(%s) setup VQ %u failed", dev->path, > i); > return -1; > @@ -381,11 +397,15 @@ virtio_user_dev_init_mac(struct virtio_user_dev *de= v, > const char *mac) > static int > virtio_user_dev_init_notify(struct virtio_user_dev *dev) > { > - uint32_t i, j; > + uint32_t i, j, nr_vq; > int callfd; > int kickfd; >=20 > - for (i =3D 0; i < dev->max_queue_pairs * 2; i++) { > + nr_vq =3D dev->max_queue_pairs * 2; > + if (dev->hw_cvq) > + nr_vq++; > + > + for (i =3D 0; i < nr_vq; i++) { > /* May use invalid flag, but some backend uses kickfd and > * callfd as criteria to judge if dev is alive. so finally we > * use real event_fd. > -- > 2.38.1 Reviewed-by: Chenbo Xia =20