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 EB585A0547; Wed, 29 Sep 2021 15:19:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CD0F410EA; Wed, 29 Sep 2021 15:19:16 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 73004410E5 for ; Wed, 29 Sep 2021 15:19:14 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="212193168" X-IronPort-AV: E=Sophos;i="5.85,332,1624345200"; d="scan'208";a="212193168" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 06:19:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,332,1624345200"; d="scan'208";a="554810338" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by FMSMGA003.fm.intel.com with ESMTP; 29 Sep 2021 06:19:13 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 29 Sep 2021 06:19:12 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 29 Sep 2021 06:19:12 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 29 Sep 2021 06:19:12 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) 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.2242.12; Wed, 29 Sep 2021 06:19:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V90qneD0QleC5rJQsvnmO7vthbohUlJrGax89SvnbvZDSm5vFnPNvpQyCLQLTxqD3sHC+FaoA7TgH0taeMuF/UcG1bjYvHqXMuxnMBW5+LzwSogJKuIcF9fLsxvLiS/1apb30hmbKz2J3pz4wYTRgCOaaRFDcQKwbKmyxGJ3BqKVM4gyWQ8vH289L1OYyZp0v0y1X5L4aEnckCcEgZAUOI3ctJuFVSbqv2dOk+3ry1vCL0E10GF+F1ewChK9vlzBmEK0oXxh+gd661pFsIJ8tFYn+txKmy4DgZIOQ9g8J05O6R5jT/seMHXBm2M9HjWN3G4bwS3yUCNp2p+z92QMjg== 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; bh=z4lhBL9lUI5x1xgAJVnAmG0zdBLaYxWFzhktEI5ZhvU=; b=Vh4tVI5mLRk5iWQUi1SV20noObzTgm1S4J/+5kjJkZhb1RvCjRXolA9rfjFTxZXKXOSXpG+S1azPGhTErp6OLjAixr1AsGsRqvOewKfQSHoTJStjeOVZRa/pjdGE8vgKXRJlXtPLcv6J5HQkJQFZSJiwsCCHYA8HNRqCcXOKUmCvViKp2p5BNITSL48sTnTkxEbU2MPNx5jlKsKit1ojhJI813ymyBXywTkpbaeyw7vWGhQXCverdyiibAoJJB3sZ9P2Ppe2Gc/MAVFVdaFPTA8A5EkBnmxPIM/C8fMgL5671zpbgRChGZlGqr6z2dCytdCGtg3gVf3kXwSWNR2TNg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z4lhBL9lUI5x1xgAJVnAmG0zdBLaYxWFzhktEI5ZhvU=; b=UFGHBQIgWF+cKHxirb1FHzStNDjv6dBjV0Orgin/EMIddcfk2gQCmTgI3tsW+GLYajT234z/p38cCpvIJ+8g5zrzDymag5gOF0VdhdyL9b0jtlxGYZ/bez9nSomLiv0AJhrdpDuDJdhbvO9uT2HRxAqELcDomcb++tUsn3728WQ= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4919.namprd11.prod.outlook.com (2603:10b6:510:34::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Wed, 29 Sep 2021 13:19:11 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%5]) with mapi id 15.20.4544.021; Wed, 29 Sep 2021 13:19:10 +0000 To: David Marchand , CC: , Maxime Coquelin , Chenbo Xia References: <20210917093344.31719-1-david.marchand@redhat.com> <20210928085114.30737-1-david.marchand@redhat.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <8acaa61f-a5c8-b118-045b-c42b4ad3f6b9@intel.com> Date: Wed, 29 Sep 2021 14:19:04 +0100 In-Reply-To: <20210928085114.30737-1-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DBBPR09CA0043.eurprd09.prod.outlook.com (2603:10a6:10:d4::31) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DBBPR09CA0043.eurprd09.prod.outlook.com (2603:10a6:10:d4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Wed, 29 Sep 2021 13:19:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f3827dd-f076-46dd-57e1-08d9834bb948 X-MS-TrafficTypeDiagnostic: PH0PR11MB4919: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:181; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G9EonO5WoEdNN28TVqsXXOv+phl62XBtaV23tJzat8fjZ8qfRAFvI8fUyhYRTTa1hH55A0JcAZtFg78s3KYg2qUhrktzY7zum5suEra4KzZ9QEpLszxjE/S3OI2Ph00ey2JlF92snEPvyEshRZtEkIzn5yhv+OsabiA4Ahg57bBmW1otXHe4fzC8r7SAsEgM1RnOu1JJ/AsWl2P2lF9y3XweHZfw2VqZt8B2J9Z0NsY5F1HOCC1EH9OKi03QWAss04fgQCuTgtg0F7iSuxa9/WnrNtvIjGxiUUpkoCUmj0TFDBwheyYP7zF/5+9cUaTLS8QOgeBOWewN54yKVJPAsSPSQz6Vg4HhJGZ5mqe15+UxfcipY5jW7lPaLQUDu/Dh1420nO2CVp8cell2xSjhbDV0YulsPhbpnw/WEVh3w855KgukBahZzbMwV337BAEpOpuSfaVSFessp2H3UIagsYGdDbc1IYHP++b+vyFNz15eBO2iYF+rYtfq69JF7pjTT/meFWTpHdtaNPdk6JHie27r5f38ARdzG7tSxVHzwtbYkEdU5Y6OHdC+AnhTwV84qVwJcpPhUzDMSDh/+3F7mEB12r7dwXD92qVVZnEjcJF6HgWC/T4BHNTc4GEEWbHjCtj9K4YNNwgvQDyUiVORKfB3fuFj9PpkPkXLtpDm1pVqgeVAa/0ihcVmVhb1WETRYDLnxegYXXVUIwx5oRe/iw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(186003)(8676002)(316002)(956004)(16576012)(6486002)(2616005)(5660300002)(86362001)(107886003)(83380400001)(44832011)(508600001)(53546011)(66556008)(66476007)(36756003)(6666004)(38100700002)(2906002)(8936002)(54906003)(31696002)(31686004)(26005)(4326008)(66946007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Zk4wQlpZQ3JIUlBCZktPYTM2dUlnb1NhQ1MzNWJPR0dyVzg0eUt3TmEwTVd4?= =?utf-8?B?TkRsbEQ0Z0VNTlZWSzBTbXRGclcyNE8wN0ZQczBDKzd1Ty9MT05WSHE1KzND?= =?utf-8?B?Ynd6dXRydFZvUGhUNG9yM1k5K0o3SXRSVDlhNEozM2tTVXdmZHFSNnhtelhh?= =?utf-8?B?YXlML29CdmRYejRQVVU3SXYvVCsyTW1GbXVUWHVKWnZSRUhFRGFwKzAxemFB?= =?utf-8?B?Q0FGbWV6eDhJOWpkb01KNTJJdmRvalNGRE1acXo5WnFkaG9WcXRFNmt1QUJs?= =?utf-8?B?WG9haGVaM3FndjZhN1JBaXU0ZEQ0RVJkUlhldmtkL1Z4SG9KSlB1RDg3ZGRY?= =?utf-8?B?a2pjQ1Jka083RituN1Z6b3pOdGxnQ2VxUUpGaGc2YS9SZjdVeTJXemtBMUhR?= =?utf-8?B?R0NYdmhVUDMyS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zNSTjFLbS9GU3FU?= =?utf-8?B?WE16SGtqREVpUG1iVmZDS2lYUjg1UllzQWdBZTkxbmdWSkVmOFhGaFdOSDQr?= =?utf-8?B?T3QyR2ttR09wRmZFZWZRRi82bkdRSnY1eUk0a3kyMytNTXNBd05CZEpLREdU?= =?utf-8?B?Rk5qK0dqNEdTZGNYeFFneUhzSlVSVXp3b2IyM0FEWnRTOHZ2UWV2TEh3ZHhk?= =?utf-8?B?ZDRvRU40elF4UDBhS2hiRGdXWTViWThteU9DSkdaUXo5dEx4aVNYRjRXdk9x?= =?utf-8?B?UFdxREpZOXhXdk9mSkxteDFpaVcxYlZDRmRtMlA0a3lCVDh6SU8waFlQemhQ?= =?utf-8?B?ZWlZQ0xhOHduTUVtaFgwQlVmcklKcnRqeG9rWDdiRjZzSDdlbFdJVlg3VEdQ?= =?utf-8?B?elVwQzJnRmc0alVxd3FQaDhiWXpOMTltWW5hb0RJOXVCTXdMVEhkTzU0TVVS?= =?utf-8?Q?WkTdKAcp8PJe/fcp1OhUxxod3/9VNHtrtYT0809?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7f3827dd-f076-46dd-57e1-08d9834bb948 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 13:19:10.7293 (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: W/zEjemO3+ET7l6F72wqkVXqdiwV+7qsMJ4keieEKgfyUp+A89GTI00UhEdQwvAmaL7Rnxul5Akn4wZStHs3kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4919 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] net/virtio: fix virtio-user init when using existing tap 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 Sender: "dev" On 9/28/2021 9:51 AM, David Marchand wrote: > When attaching to an existing mono queue tap, the virtio-user was not > reporting that the virtio device was not properly initialised which > prevented from starting the port later. > > $ ip tuntap add test mode tap > $ dpdk-testpmd --vdev \ > net_virtio_user0,iface=test,path=/dev/vhost-net,queues=2 -- -i > > ... > virtio_user_dev_init_mac(): (/dev/vhost-net) No valid MAC in devargs or > device, use random > vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument > vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel > virtio_user_start_device(): (/dev/vhost-net) Failed to start device > ... > Configuring Port 0 (socket 0) > vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument > vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel > virtio_set_multiple_queues(): Multiqueue configured but send command > failed, this is too late now... > Fail to start port 0: Invalid argument > Please stop the ports first > Done > > The virtio-user with vhost-kernel backend was going through a lot > of complications to initialise tap fds only when using them. > > For each qp enabled for the first time, a tapfd was created via > TUNSETIFF with unneeded additional steps (see below) and then mapped to > the right qp in the vhost-net backend. > Unneeded steps (as long as it has been done once for the port): > - tap features were queried while this is a constant on a running > system, > - the device name in DPDK was updated, > - the mac address of the tap was set, > > On subsequent qps state change, the vhost-net backend fd mapping was > updated and the associated queue/tapfd were disabled/enabled via > TUNSETQUEUE. > > Now, this patch simplifies the whole logic by keeping all tapfds opened > and in enabled state (from the tap point of view) at all time. > > Unused ioctl defines are removed. > > Tap features are validated earlier to fail initialisation asap. > Tap name discovery and mac address configuration are moved when > configuring qp 0. > > To support attaching to mono queue tap, the virtio-user driver now tries > to attach in multi queue first, then fallbacks to mono queue. > > Finally (but this is more for consistency), VIRTIO_NET_F_MQ feature is > exposed only if the underlying tap supports multi queue. > > Signed-off-by: David Marchand Do we want to backport this patch? If so can you please provide a fixes tag?