Project

General

Profile

Bug #10938

PCI hotplug probe doesn't properly handle ARI devices

Added by Robert Mustacchi 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

If after enabling the hotplug service, one uses cfgadm unconfigure on an NVMe device and then try to configure it again, it will fail. The problem is pcicfg_configure(). In this case there is only one physical function that exists on this device. However, the device also supports ARI, this combination causes us to fail.

In this particular flow, we're looking at the first function and determine that we need to enable ARI mode. When ARI mode is enabled, we're able to programatically determine the next function to visit. In this case, there is no next function to visit on this hardware device, so we go out to the done part of the loop never taking another lap. However, the way that success is determined is based on the number of laps of the loop we've taken rather than the actual number of successfully visited functions. I suspect that this particular case hadn't been hit before.

The fix is easier. Instead of using the loop counter to determine success, keep track of how many functions we've successfully visited and use that instead.

With this in place, we end up being able to successfully use cfgadm configure and unconfigure on NVMe devices, a step on the way to full hotplug.

History

#1

Updated by Electric Monk about 1 month ago

  • Status changed from New to Closed

git commit 5c7348165122ba7c5485ccebd060a97705154b26

commit  5c7348165122ba7c5485ccebd060a97705154b26
Author: Robert Mustacchi <rm@joyent.com>
Date:   2019-06-03T05:16:35.000Z

    10938 PCI hotplug probe doesn't properly handle ARI devices
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF