From patchwork Fri Apr 6 12:03:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10325905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA59660545 for ; Fri, 6 Apr 2018 12:05:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB3C6294ED for ; Fri, 6 Apr 2018 12:05:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFD62294EE; Fri, 6 Apr 2018 12:05:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 090CC2944F for ; Fri, 6 Apr 2018 12:05:42 +0000 (UTC) Received: from localhost ([::1]:49739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4Q7h-0006h1-9E for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Apr 2018 08:05:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4Q6e-0005gg-0d for qemu-devel@nongnu.org; Fri, 06 Apr 2018 08:04:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4Q6Z-0001YI-39 for qemu-devel@nongnu.org; Fri, 06 Apr 2018 08:04:36 -0400 Received: from mail-co1nam03on0081.outbound.protection.outlook.com ([104.47.40.81]:3680 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4Q6Y-0001XM-Ba for qemu-devel@nongnu.org; Fri, 06 Apr 2018 08:04:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aX6DgDHfE7jJmaybx/uZ6/r0d/h92W81cSE/FvP8XyQ=; b=e56YwtQpGfE/crQqq6NgwBIsnE9s+2CaiG0xWbekeMrcA9UFnoyIAwUhyuqLPjn3glPPNhEb+4bj/AlxFissFfTXFzxKZ5o6PzHUGSZLx6Q4qvqsOgevtYJhBURCptDyaowSf17drvFHzhNillnpsT00e2YSRrJFwKMO/TUFbCY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by DM2PR12MB0153.namprd12.prod.outlook.com (2a01:111:e400:50ce::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Fri, 6 Apr 2018 12:04:24 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Fri, 6 Apr 2018 07:03:56 -0500 Message-Id: <20180406120356.24757-1-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR1701CA0012.namprd17.prod.outlook.com (2603:10b6:910:5e::22) To DM2PR12MB0153.namprd12.prod.outlook.com (2a01:111:e400:50ce::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8d84ea1-18e5-45eb-7ad6-08d59bb68a36 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM2PR12MB0153; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0153; 3:x0ZUSzSFrb/QlBJ5K0YSxLgpwT6szCas87ZpsOjHmmMvYAdD7uSQBK8hRDkb4EcqwHvJB9YAhcsokSNqOOXUDmIYjRF/S/dGETxB+W07DYwQL2I0B2CQXWauhXU/zuCdEAL5aVfr1qVg40M5Ain+TBzK10WDC1bHIQHjSpnSqhyzZsRObSHDSEr5Og7SXCvRuxRZtCEDDlMqRL3RinZJx70FRvluP8QMlLD6MakNHUa9V3WCEaZbBBP9AS36ijRm; 25:7U0M9jq3q8Xnp88Kb0+GibuPYhPhmwYFsQswQkp4KLTUKXNMqQ3c8c5YTKc8HD7erbUr7hCCfyzSICyIfMX3VvcVedHtbEgPfgq2AKb1LkWnamxQ8jOmsLC0Ma1DQkAYJ/iQChDoMdkRenhKmpvIah31trDcmtXgDJ9zI4HjigcaPgI01CcVe1tc99aZ6P+OA3N4fUe42jW3LJdW3pNlmoxOKnne+J6ul8fj5W72b9Cunm8cIvV7wSCx7OWBpV67jMFriZNa8/YaYf9N/Pi/n2O+xvofi83KikAetkvcpf0y+hCaG1EVmkuH0T375l5RFJaoMz3/lLdiJO/YowaTwg==; 31:M3PtoVg9e0q2DHLzW70IofWQsHChsP/e2e6OucDl22rVgcCmScJCiAN3xMWSGSbw1a9neTjC4crXLg3HQcfE6TmDTjgAL9R+xmSswyVRnfcKJXVzwqSlrPUpppmL1GoMv2NJD57EsqbNot3ir2nRatl671cxw+Q5pdvWJc71aywJoW8qXbILGzAd1cFdHj2DFR5FDy7WeO2OTODcoNG2eXr0Z6KFuf7CGnV2qT6W9QE= X-MS-TrafficTypeDiagnostic: DM2PR12MB0153: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0153; 20:LzpNVDYIXhOIdTUHDpUzUyljo0ooDW9Xyqr4TcmwCt3XNU/pE28+IK1XPs1sxQ1e3vJ5PEaspbg0Wln+BV37RZH/Y1G13ko0i33pKy+b74i2VIhhHt66u0m7bWHiSoorK06Ue34dayNpC4OTgBOhQ1aGdw7eGLZDT5pmIi17db9ov7WHQ6a3dfYLulDRS4KNC4TMZWgCn+eOaI9OCKx4n0ZfU6pA1X2VgtwwZHzW1A1ZLhbJFRSncl5ksYMmA8ji8fonMJo18JRJbQUWbKJAinY7g4B+dte6PEDoTzR6EPn3Zn2ZMkRdSAvi63VHE8WpUizf+VL4HqRK0YonSjM9M0+JlQhwBMWZ+IQhBJpJycUZAsrDp4jOM4xYH3K18ozdB2Kg1ZzQsa1F8wLbFTvWZmRTydwgLVCxtOHgEpFTDuKdWCXYR+vmquFdoTWq007Q+BMCv9nmWMrj2fdDvOUIuZ06h6LWg8RPqgSr33aG2pHs/hJNKZ4GsRyYuSFd4+A1; 4:LlJmwz+O8Kj2qL7rdrvHyD04MUSpDwHF6KOYfvRhl1ScLBUt1JdqMsFKt5CyIBB3wr+naaPpCfRM2GJx4oHtcYUt0Jj+Q7vOhDxEf3knT15kApVm1V7D5XmWf/8EEfwzF5whAjrVN56qWfsSNesNI6rIsEtrqWnwmEiWMXHudSAZ8V0UWJdIfV7pWsto/9zY4o9fiYDOO7JipcXnuGKptnBKxY8Aey5+IZUfp/eo2EZox9WDYRyTacDImcQACfZS/MBLXudGz3jdKndyxDbAqejmGSsblBvTV4Gifj+W9f0urKaHBc2LK7ArJ+v/E/xh X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM2PR12MB0153; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0153; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(396003)(366004)(39860400002)(346002)(199004)(189003)(476003)(478600001)(2351001)(25786009)(66066001)(36756003)(81166006)(47776003)(8676002)(2361001)(305945005)(4326008)(68736007)(81156014)(97736004)(6116002)(1076002)(26005)(16526019)(7736002)(956004)(486006)(186003)(3846002)(6916009)(316002)(6486002)(53936002)(54906003)(16586007)(53416004)(105586002)(52116002)(2616005)(6666003)(7696005)(86362001)(51416003)(575784001)(50226002)(5660300001)(50466002)(386003)(106356001)(2906002)(48376002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0153; H:wsp141597wss.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0153; 23:UWLMtydE3i90N9xbeD2ae87eaYiNC9MSIOGVSvbFb?= =?us-ascii?Q?C2xfek2U0n4y9Ejh4UPcoHbZKs2RH3xv0yHZHD8H/RmvwDUoZPqZ2nFzVy/n?= =?us-ascii?Q?MfmWDIav9kmr+uV3yG4WxvKh0jcMBWfAXRs1uzNvQAyFC7b1pMzj/Yr+tIOX?= =?us-ascii?Q?nfAPIDC6QXXeTu8cailKqsaFPMHU1ZQ/zJ/yCiXvc2+tF+pA9kKQxRNH2v+w?= =?us-ascii?Q?ve6WPCzEqIuu+6Nqfz8PQ/KswXsMPLqRzUcgSJlla6kcXy5La+kGLFpmZqfm?= =?us-ascii?Q?JI77o+DIHfWXdNVP3RY/oDLuiu9OM1MBQBp9e5wTtqi1wo7dUOK8m1+BTkOT?= =?us-ascii?Q?pnKqsBGvx8NiVXHqIbCPFT68sVuvHty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?=3D?= X-Microsoft-Antispam-Message-Info: 6cvdTVjfIM/+yD4SlvrlAooUsXSLZ9UpIQdOXTYARyjZUu6HkkEVUuHV0H6Vsle0yd2sClRHLUeOuEE7iuniaiFVVESPd1Ya+3MtS1NvoQGPqJpOcqt1CKB1mHvqiM9tO6n5rK/0fxoo0XKXygnmA0YSNCJLfxTeApagDFAmVE+mT7QvwwAZ9xM8wC7TLuc1 X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0153; 6:J1kQQ5CE6U7Tau7TuMskIxJhLUTpS9bKyUyzodc+1X0yjGw3TzY3ENMMmrl+nru6XXh9WuXJIBiFZ7BBnaOEs893z81AuYhIGpJbMbejUpyMmcia/Cx6eJ/czvvxUiAP+ruhMRad/L45YS5l231u7z35UqFD5yFwBDeCrP/xLvz+1BS0xNqkdRJJy+XE/5oohfazra30f/KoBgCmshrnqNf+N8DyhQ8BAbLvoc0025E8eTmNMlwWL0Zq4q8fKvy29xxE21KCTDlRU+AZ8iCsS1WMKlSKJkXmT5CPTapds1zmv3hqogzRgv2pLsIZ2miOuXjxJkp4iGXTBTQMVOV/E/G1gWj0mJ4mAHjR8R9JHA++8oJB89U7DqTdDC9J9nxezY35i798OZY0Z0mB9f95ReMYRNzaEjX1HbFSNDi+fTTGNrPX4Iby9cR1L8F3xH0//mYl8IhLuAroDNteDmqVrQ==; 5:8WuNKhNlpVnf29hcgokUv69QfHSzh4/WjXFnxakRtKsRerJhZaMiV3UNj7MTUi6SUwxY3M5OZb6IZ3jEFp+RfOQ+7FMBpIk+ubW9gm4jegqBPzbnwpyIBfEWLy9+hcmCVqF8nVUi6+fAuWBcC/4bNNbqi5Md+mx6Xucd5Pwj1SA=; 24:1fdrgL8TN7Mc2S9hF+T741Yh2Lrc7QXSuz5m40/n7wnreKAaYc6PZ+FJulvvCb9gIjBF4vm3jpGi90taoyN8KogYXPbdXcyfrPRS0esBvYw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0153; 7:nhqoFzPIRonfT3qUkJ97DEyR4xTysly4kg9WVM56j6pK3/TE93wDmrz/6KmprxDzl/H7yGQDvOV8kNlb1AnVJM57vOT3JxmMrbhEte9lFLXfubmVwv3w2UfgIZ5dyaoUBECc9+z55RJOugnNEuXwZWxg9b5/nL6aTgy04UEt2GKmX0pPtzYgTCuu8Zs6OBQHEE9qzEo+Bo8XePl02A4kqwU5W0koe9z29U84NqJpjHouxc4+nlMiDpRA2ULBbiqB; 20:N+L3vXlY0dk3qa8yAE3jVCX6aD2yFsTeC3Dfm7v8WjnxOz1xmeMvEbr1bnen+dRaEqaT3wOSLmhXXcG/3ywyaRFdWhB3uVBmYVFswmc3WT+OuRH5LePqdNU083mdKnL70+6xPpMGsSY2rtdbVu8hT63Q1vYssc2qKwvetOgj5zdCuTd7WyaSDLoA8fp07KZF1IHC+vDqI4tLE4+h7o3zt/G9X3HZ8rc6I4ouogm1yxstpVetfLZrlHmM8eat7fYl X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 12:04:24.3597 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8d84ea1-18e5-45eb-7ad6-08d59bb68a36 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0153 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.81 Subject: [Qemu-devel] [PATCH for-2.12] tap: set vhostfd passed from qemu cli to non-blocking X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas.Lendacky@amd.com, Jason Wang , Brijesh Singh , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP A guest boot hangs while probing the network interface when iommu_platform=on is used. The following qemu cli hangs without this patch: # $QEMU \ -netdev tap,fd=3,id=hostnet0,vhost=on,vhostfd=4 3<>/dev/tap67 4<>/dev/host-net \ -device virtio-net-pci,netdev=hostnet0,id=net0,iommu_platform=on,disable-legacy=on \ ... Commit: c471ad0e9bd46 (vhost_net: device IOTLB support) took care of setting vhostfd to non-blocking when QEMU opens /dev/host-net but if the fd is passed from qemu cli then we need to ensure that fd is set to non-blocking. Fixes: c471ad0e9bd46 "vhost_net: device IOTLB support" Cc: Michael S. Tsirkin Cc: Jason Wang Signed-off-by: Brijesh Singh Reviewed-by: Michael S. Tsirkin --- net/tap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tap.c b/net/tap.c index 2b3a36f9b50d..8c026fbf95cd 100644 --- a/net/tap.c +++ b/net/tap.c @@ -693,6 +693,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, } return; } + fcntl(vhostfd, F_SETFL, O_NONBLOCK); } else { vhostfd = open("/dev/vhost-net", O_RDWR); if (vhostfd < 0) {