From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0065.outbound.protection.outlook.com [104.47.37.65]) by dpdk.org (Postfix) with ESMTP id 685351BB16 for ; Sat, 28 Oct 2017 08:23:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VKmu3sfUlJEhQJ7aqpprtRwE3BGlnZxOo0PmJrC1I5I=; b=Nwvl/OuuvHcsQ5G+LGrZvJ9pA0NuzcyWHfozcoJ2ZmNTuFOHMt9VUEE7uq6WN7CnNchXz7r2wW+FI8a7aqmnBEeqlQystemAFFOVSj+P7qYoBuTobpqNZIg6YewlrmJRdxHvIQaJT+KkRnk415D7c33o88I2APZnU0+K25cE8As= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.domain.name (111.93.218.67) by CO2PR07MB2517.namprd07.prod.outlook.com (10.166.200.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Sat, 28 Oct 2017 06:23:24 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, Jerin Jacob , Jonas Pfefferle , Anatoly Burakov Date: Sat, 28 Oct 2017 11:52:55 +0530 Message-Id: <20171028062255.11910-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0043.INDPRD01.PROD.OUTLOOK.COM (10.174.214.29) To CO2PR07MB2517.namprd07.prod.outlook.com (10.166.200.151) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03e5caf9-a915-42eb-e95d-08d51dcc6620 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:CO2PR07MB2517; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 3:44z0xbAXcGvBwPBa/sZANzAov8TwlJTlApL0Z4+237gEIVzrcqpRlsNVVmVTo/g0hmFtSg7nI2ZEUzR2sh2pf+Suf4TWPVGmjqp3JKtS8I901XYO5qQMCpCbD2YqfXkqwVfxFEi+L/mep3oMO7ONPGK+fYAZVuM+Da3FbGmb2AG7bfcSNIBIRszo/KU3pZiGrHzAyHrJvjE0jYxL7hzRRPhSWKMNAtatVaEzo31iyEdcRUpG+JSJh2qgI5IdY2yI; 25:9HQ0O216FNffX+jPzn5Lct/tljJDu3TYSV3rhFYPfiUdpt7vczvZOu3KA2ysom27t9+sbXktU8oZsx7q9Wj4MLdxJKnDbY44TPIqkWwS/jf5Fo8rjPtNhDyA7Kc3KOg2gQV/V7XIMn82cit3Ng1wlXkjOrMfIZfIu8GQ1wZ9NYk0Yja6TflfWge8BPLiHQf8W1v0UPHo015M8TApAZjOnbinKpsz4ZappF0FhDgDzZH0RI0oCMU9/tntNayMqNVqB3fZHldc1oo2hdA3k1zFEu2RcQnSkZOmKsSziWGP0f14S5h0xUEWPSRC0XwpNCcubcgdHLKW0kd6W20F/yOdLQ==; 31:ny1Nf5H3yDM9VoZkifhwBTvDfO9X+kQ0Y/xsB5LoofYr7jYP9TRtN88S/itQQu9A0b7eHluf5HY6tzJDYpqhF8NW8kbPZu9ZCarXrWx7PBpqfg6OFL/S2Bzg9sSVPsVYP/r3Q3cxweN1ErCibu0/P5AfVcBfoz73hMRIk6zYJVT2XtuDjgfdox9V4DL3Yo7flRDQxDPOqavzBExrMSOtTEjFmh2+OGNXDa76MaH9nNQ= X-MS-TrafficTypeDiagnostic: CO2PR07MB2517: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 20:zXqqX8DHya1Ci0wEfBNZAeqlXyQnYkLbIxLMda4BulY9hEqFk0TAp7pGKxIRED0VndkwqKOtM4nwqIQXw046nE9+n4QDYyYgxNGUrW68KGZAqJQBrXtAM7Y43vAp9NXG6XXCiyV9HFkNtdT7reH7RiPg0XZOGA7poj6TNwiEgeJ1uIoRCAmanhd4SVGSLsSM8IosEEuk09Wp1WZ6xxlJpm2SoDzZ7uGiS1gnJN9X+jCbAkwSZXPDn6Oj4kTraNhER8iZ3pHTUwYeZVsA9Ffp0E5KojJGRo7wqs3hpJpSutrbaxcvcKn3PRomRQJuxoJoQWzgwLbsEbFRoF0mB2/LVwxi2p6GIE+pq+d49WkOzskYqlF+EhqZsL8ztQaeeFVMp6ZkaoMn6ruPt/HJ4tnT5qolenSGfpoNAxXrxzXU+sgbC1azKyCy2jRdhpcBcBDLSXsxfjA5sbYs0VTIDVNlLgFIgd1Z+V5u/B5SZVH9dGOyufS1vBHQblp/y7V8WigDtv+kn9hJNFA/CYzmA8jeUiB+wzlWTv+Fl8vAp6WykEajjdzmSqI1lLhZrM2/KfGpg7ze7VNajNNrsmUqcO3XDQetT1XWy+Vtff4zGpba8+w= X-Exchange-Antispam-Report-Test: UriScan:(58145275503218)(104084551191319)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(3231020)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR07MB2517; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR07MB2517; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 4:gxS4IHrODOwj1Bv7Bam4jqQMiOK3qhjYOVgV+UR5G1T2HS4H7gaCTCxK7Xc4ik1J5R0m0PNXwnN1xj5SJjeBM88nqWdCrPDcLL6POq8mcV5d0Rxmno6fGgmvQN4uWBFwbWgRRf5cjMqRYzKP4Q+Wop4LtaBcUrj/C2wGg/3aT6Npt1BomgUEUQDtZYABxf4vd20SrgK7gJ5Hg73KQe6JyRnplc80cTXcsFboLV8ZDXFfoRO8tRoYAkxHBZOHk92ozoY4k5IEGzhcjAF/V4oqzysf9ECswdpBY9jRZj+x3ieZIliCRus1YAyuERiCgzUgjNisKqVjoXduSxvkYq8ruHlraGq3wU9yzisqSI2jZdPETEBO2HNeM1KrE2KERhln X-Forefront-PRVS: 04740D25F1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(478600001)(316002)(25786009)(7736002)(966005)(66066001)(305945005)(47776003)(5660300001)(97736004)(42882006)(6666003)(2906002)(6916009)(101416001)(36756003)(5003940100001)(16526018)(50466002)(53936002)(6306002)(2351001)(6486002)(33646002)(69596002)(4326008)(6506006)(2361001)(6512007)(50226002)(53416004)(68736007)(6116002)(3846002)(1076002)(72206003)(8676002)(81156014)(81166006)(54906003)(16586007)(8936002)(48376002)(50986999)(106356001)(105586002)(5009440100003)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2517; H:jerin.domain.name; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB2517; 23:8THL+0VebBjOhwZD127fih5Eyg+YX82sC2pLvOELB?= =?us-ascii?Q?Wo62Pzrx+zIN6t9gd/sw0aFfWIQ4e16piJJxMkELD7hRpaA9CjWxH1srle7i?= =?us-ascii?Q?sXQ8JwfhGYhkPBe09bOvgXaUqwGA2d1GNvEOC4/qlqCp+aD0hb87o4Y5jH0q?= =?us-ascii?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8wNDyqN2WqrL2C5vSQeUrpdS1m48XhwYlxppWOdSUGe8CKokAR8dzmwf3i7WwPar1Jtloazypt6xq+MphfDSQEBw/V0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2017 06:23:24.5509 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03e5caf9-a915-42eb-e95d-08d51dcc6620 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2517 Subject: [dpdk-dev] [PATCH] bus/pci: fix vfio device reset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Oct 2017 06:23:28 -0000 If the device is not capable of resetting, then Linux kernel updates the errno as EINVAL. http://elixir.free-electrons.com/linux/v4.9/source/drivers/vfio/pci/vfio_pci.c#L887 Honor the EINVAL errno value to avoid pci vfio setup failure. Fixes: f25f8f367644 ("bus/pci: check VFIO reset ioctl error") Cc: Jonas Pfefferle Cc: Anatoly Burakov Signed-off-by: Jerin Jacob --- drivers/bus/pci/linux/pci_vfio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 360eed380..11df64846 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -338,8 +338,11 @@ pci_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd) return -1; } - /* Reset the device */ - if (ioctl(vfio_dev_fd, VFIO_DEVICE_RESET)) { + /* + * Reset the device. If the device is not capable of resetting, + * then it updates errno as EINVAL. + */ + if (ioctl(vfio_dev_fd, VFIO_DEVICE_RESET) && errno != EINVAL) { RTE_LOG(ERR, EAL, "Unable to reset device! Error: %d (%s)\n", errno, strerror(errno)); return -1; -- 2.14.3