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 5754741B89; Tue, 31 Jan 2023 06:21:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 475DC41151; Tue, 31 Jan 2023 06:21:16 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 35A0F4114A for ; Tue, 31 Jan 2023 06:21: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=1675142474; x=1706678474; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=2oQYE5EboODgMSeL39bh4imk8LTSE0SiXXCV2n18b8o=; b=Tz7KpJS1NmYmn6EairVdEiwr2DpMax/jPbG+qvltnPEamynIXnZvC1Dd NhdCfNVrmqwZh86HuBfM+YGJKjjyFCyFE0r+VWXT9ZclQ2kB+mz7NL/pp QkucYZpPIWh5T+/UfIvqQQhI5dp037EnelCxJ0cFEHAOFhwTG23e8YpiR 566uDEh41ALmsvfKnb7dCw280K65Hqf8tJQyyNYw3HqWFhIi1muzQC+yy q5np0DxtZwnSP1h7JDirJbVDLftt+4cWiLteQNeqEuacMvLOh1NdlNi2l gNJ8tRkFZWc9bMFTemTQqbZ3AMHvkGZ100gb+oXoiFZGTnIQGoqnZ8I5D g==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="413970980" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="413970980" 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:21:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="772820164" X-IronPort-AV: E=Sophos;i="5.97,259,1669104000"; d="scan'208";a="772820164" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 30 Jan 2023 21:21:13 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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:21:12 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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:21:12 -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:21:12 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.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:21:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NS2tRssykuyJwHRv6wAlmRRzHKCyxT20FUr/LW+A+Uo95V/SZMgkZl59M88xBa4nUX91voDo2h04DxUqXU+aSsD6iEmFJ2ioY5oLaXQfPM7B30B4hxbP4IYy6Q3X/BrdFJodIdrBYk4fM9GhjlfyIdtYMLtSAUCC9AtFyEipR3vcdCIl4LAJ/QAlzoCyHub2gua+tEXE6V3caPTU9e1o8RyQBeTG5PzJazMF9MBEyZmw+H/oWbWSC37GxPzLHYZPja4t+n6zVUM22a59nzsR0zX0Kp5EXK60b2aYoX/CVZ5DZ7ibZzLC4FGTIRx4pfHB7EJpnpUv6ZN9Qly0dOm32w== 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=cBpb0/QLMN1vU9X6ckXYOVpTf4EeR+hUTob661HiAKc=; b=B7CNT3/dU8CWmE4tg/opSdXcfuD3aqij0r0JORfkAYiOyQt7R8oT4/uYU62wpa4jGl3w5prfk4SlkK3diIz3jenX6cuNGQKCa6pipn6eCB2JXtbOM+gZuR6hEGQEIYy5d3kuKnPjcOHJ5FV3mTK890Fo/cMRdxyz0eBTO1yvpehAxJJoljIqy//CbaddyQK1bx/mB8viADFDhFnuBH9hSqghwJzUb4ye32HWZyYO5kYlya4DceP21iKdA+SdUrw7p/wvKCV+wW48u0OrVA7OWWAIcAHseFn7K0I2nlnMYR/mSa8IKIAOl2zGrTpDlT5XsqizqMDUzdabNkJGnrMLRQ== 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:21:10 +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:21:10 +0000 From: "Xia, Chenbo" To: "Coquelin, Maxime" , "dev@dpdk.org" , "david.marchand@redhat.com" , "eperezma@redhat.com" Subject: RE: [PATCH v1 13/21] net/virtio-user: simplify queues setup Thread-Topic: [PATCH v1 13/21] net/virtio-user: simplify queues setup Thread-Index: AQHZBNR1BZ3TlwbH8063HvPCb7cVuK64XfRg Date: Tue, 31 Jan 2023 05:21:10 +0000 Message-ID: References: <20221130155639.150553-1-maxime.coquelin@redhat.com> <20221130155639.150553-14-maxime.coquelin@redhat.com> In-Reply-To: <20221130155639.150553-14-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: 62eb5ce4-1ce5-4472-b8c5-08db034af6c6 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: yv0cmEJATcBShRe/HLseKdGIYUTZOXeqbZp8lbT4X1DlD7VvqVv0QMOcOWxnOCGRfnqNYV5o1MWqZ9JNRRIzAxohb3CgZvhooJ3IvV57kzAc8LunQ+LB8GoZfJ8etpcwdykIVhgk+mVS3ytaR/vbt57pTeozZC47bcGSIY0p3yOt+7VSZWSF1BkZaNyChxHiP5omSGyqVt8eh5RkfWRQfyN9VlvAdZ7lDC+6NPXooRpF3YkfvrnKu0TCOODxPYADVyQKCTxkzpasIeK/coH02gkqrFiCnc2BJudwNV4YKs4UM5zMqDA4s9QtOrzurNOTBiVkc7d54Jpu/3FvTKIeUkPIO0wjPZluj+SmKSjMDG+uhzhtzqkh0llakIZbwXn49N9allUaaQPEnm4+D8QAFUh+Cm6hTNiroidzKvxfE5KImb0a/8snF+QDjuYbfD6yTsj+Zw8f/9/shtUvfhmkVr/WZ5BWIEdzOb88vz5DruBD5zZ72TqQqm78y82hQy6oxiC0AnP7QAqU0/evIfa+diRwHkRc73niZuHbCt1uFrg1ZRF/baiLErXqJQDTkf34aOrVjEQpqQXj/x8LDIaRA4l3X7fbQJmQDsKnbEtS1tJHtNqb1GMY9NyUdDswH7VP+f7CYmbomBMDelN/vkggV8Wr/OjHbgWQju1IoKXSBiJN6n+BBR2c0reiur00kV9IG48pWyYWPdTR6hij/0V0Wg== 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?bRk2tkEZcKZ1M3I2TaSUqKeQkQy6k0sxJ0Sgl8MsOI6ijXNlP8eUM3+Ea4H9?= =?us-ascii?Q?HtALXuciDPiziJQecR+LSnuMrT6v/SBgukxBv0RpV52UMnVs10h5Z69tt3ia?= =?us-ascii?Q?n3/sgydz9hB+KP9Xe/OorWObdCXEUyJiZy34pX2GdR7tk7ShmYlx+5Ev3Mk3?= =?us-ascii?Q?N4Y/3NDOEp2XxOuG5NakRyrNVCmsf/IHGMPv2puqy3keAFmfMqQZbsCPxCnV?= =?us-ascii?Q?B2r2dDACSzLvmYiLeDU54nD11X9ocwfujbXl53w8TykFNaujQjzAYdGhKrbQ?= =?us-ascii?Q?55F2vx/e8zCYMt5sDp8V3KnbuK3Yr/z8rj7zqAr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BH0yQYHYA8a5Dn7RcBhWeCrnm8ZM5iD12nuZ6qyn2C/nF0AfetuuBAa8pP?= =?us-ascii?Q?Is0hPFJBAYI6iSBWVhOqNi3LkZW5VzMOwSxdmyiRJKaLdEJ8qQ7PyNaea8S5?= =?us-ascii?Q?HObrXTevUuSQyQJeDGZWlbLSjpl5fVDq4Bvm4iE3OIBNB+ZqjIiiJkKYlzmz?= =?us-ascii?Q?zRYnHWmDnOfX/hGaCyB2gurqsNsAqNGAlneuU+9rFQqfCJNE4IMjlfelh86K?= =?us-ascii?Q?P61e0sH7YnNBu+2RvDI5scUgqBt3b9NH3ViM0E6TjvTAdM7AQwIoNj1KfE0W?= =?us-ascii?Q?LzrjN0e7ytTdYgaej6xZvD3QgBiC8tJUtBToVtt58d4P7AtOwvhfOqe/HLKn?= =?us-ascii?Q?yQzbCLeyAi1kZAI4rZYgmrZKGFbMBK6kny8o+CZR?= 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: 62eb5ce4-1ce5-4472-b8c5-08db034af6c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2023 05:21:10.5426 (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: fr8JmBWK8RZL0eyc9aRI2Hd8k5gRpkFCnW4hRZaGdTWk24XCz+Hro7PFEshPc979ZssQABBkp8kSr6qkiaHk4w== 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 13/21] net/virtio-user: simplify queues setup >=20 > The only reason two loops were needed to iterate over > queues at setup time was to be able to print whether it > was a Tx or Rx queue. >=20 > This patch changes queues iteration to a single loop. >=20 > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_user/virtio_user_dev.c | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 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 19599aa3f6..873c6aa036 100644 > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c > @@ -118,19 +118,11 @@ static int > virtio_user_queue_setup(struct virtio_user_dev *dev, > int (*fn)(struct virtio_user_dev *, uint32_t)) > { > - uint32_t i, queue_sel; > + uint32_t i; >=20 > - for (i =3D 0; i < dev->max_queue_pairs; ++i) { > - queue_sel =3D 2 * i + VTNET_SQ_RQ_QUEUE_IDX; > - if (fn(dev, queue_sel) < 0) { > - PMD_DRV_LOG(ERR, "(%s) setup rx vq %u failed", dev->path, > i); > - return -1; > - } > - } > - for (i =3D 0; i < dev->max_queue_pairs; ++i) { > - queue_sel =3D 2 * i + VTNET_SQ_TQ_QUEUE_IDX; > - if (fn(dev, queue_sel) < 0) { > - PMD_DRV_LOG(INFO, "(%s) setup tx vq %u failed", dev- > >path, i); > + for (i =3D 0; i < dev->max_queue_pairs * 2; ++i) { > + if (fn(dev, i) < 0) { > + PMD_DRV_LOG(ERR, "(%s) setup VQ %u failed", dev->path, > i); > return -1; > } > } > -- > 2.38.1 Reviewed-by: Chenbo Xia =20