> From: Jakub Kicinski <kuba@xxxxxxxxxx> > Sent: Thursday, December 17, 2020 5:39 AM > > On Wed, 16 Dec 2020 05:15:04 +0000 Parav Pandit wrote: > > > From: Jakub Kicinski <kuba@xxxxxxxxxx> > > > Sent: Wednesday, December 16, 2020 6:08 AM > > > > > > On Tue, 15 Dec 2020 01:03:48 -0800 Saeed Mahameed wrote: > > > > From: Parav Pandit <parav@xxxxxxxxxx> > > > > > > > > devlink port function can be in active or inactive state. > > > > Allow users to get and set port function's state. > > > > > > > > When the port function it activated, its operational state may > > > > change after a while when the device is created and driver binds to it. > > > > Similarly on deactivation flow. > > > > > > So what's the flow device should implement? > > > > > > User requests deactivated, the device sends a notification to the > > > driver bound to the device. What if the driver ignores it? > > > > > If driver ignores it, those devices are marked unusable for new allocation. > > Device becomes usable only after it has act on the event. > > But the device remains fully operational? > > So if I'm an admin who wants to unplug a misbehaving "entity"[1] the > deactivate is not gonna help me, it's just a graceful hint? Right. > Is there no need for a forceful shutdown? In this patchset, no. I didn't add the knob for it. It is already at 15 patches. But yes, forceful shutdown extension can be done by the admin in future patchset as, $ devlink port del pci/0000:06:00.0/<port_index> force true ^^^^^^^^ Above will be the extension in control of the admin. > > [1] refer to earlier email, IDK what entity is supposed to use this > While I was replying, Saeed already answered it. > > Port function object is the one that represents function behind this port. > > It is not a new term. Port function already exists in devlink whose > operational state attribute is defined here. > > I must have missed that in review. PCI functions can host multiple ports. This is exactly why I had "multiple networking ports" above to differentiate it from devlink port. And you asked me to drop 'networking' because devlink is all networking ports, that creates this confusion. Anyways, I will rewrite the commit message as 'function', instead of 'port function' as below. New commit message snippet _start: A function can be in active or inactive state. Allow users to get and set function's state. When the function it activated, its operational state may change after a while when the device is created and driver binds to it. Similarly on deactivation flow. To clearly describe the state of the function and its device's operational state in the host system, define state and opstate attributes. _end. > So > "port function" does not compute for me. Can we drop the "function"? No. it is better to keep it. Because it clearly distinguishes the host facing function whose attribute (mac) and state are controlled. But I shorten the names, enums etc in code from port_function to port_fn. So it should be readable now.