RE: [net-next V9 04/14] devlink: Support get and set state of port function
From: Parav Pandit <hidden>
Date: 2021-01-22 03:35:17
Also in:
linux-rdma
From: Samudrala, Sridhar <sridhar.samudrala@intel.com> Sent: Friday, January 22, 2021 2:23 AM On 1/21/2021 12:52 AM, Saeed Mahameed wrote:quoted
From: Parav Pandit <redacted> 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. To clearly describe the state of the port function and its device's operational state in the host system, define state and opstate attributes. Example of a PCI SF port which supports a port function: Create a device with ID=10 and one physical port.Not clear what it means by creating a device with ID=10 and one physical port? I only see a SF with sfnum 88 in the following steps.quoted
That statement is no longer valid. Rest of the example covers the sfnum 88 related details and example.
quoted
$ devlink dev eswitch set pci/0000:06:00.0 mode switchdev $ devlink port show pci/0000:06:00.0/65535: type eth netdev ens2f0np0 flavour physical port 0 splittable false $ devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88 pci/0000:08:00.0/32768: type eth netdev eth6 flavour pcisf controller 0pfnum 0 sfnum 88 external false splittable falsequoted
function: hw_addr 00:00:00:00:00:00 state inactive opstate detached $ devlink port show pci/0000:06:00.0/32768 pci/0000:06:00.0/32768: type eth netdev ens2f0npf0sf88 flavour pcisfcontroller 0 pfnum 0 sfnum 88 external false splittable falsequoted
function: hw_addr 00:00:00:00:88:88 state inactive opstate detached $ devlink port function set pci/0000:06:00.0/32768 hw_addr 00:00:00:00:88:88 state active $ devlink port show pci/0000:06:00.0/32768 -jp { "port": { "pci/0000:06:00.0/32768": { "type": "eth", "netdev": "ens2f0npf0sf88", "flavour": "pcisf", "controller": 0, "pfnum": 0, "sfnum": 88, "external": false, "splittable": false, "function": { "hw_addr": "00:00:00:00:88:88", "state": "active", "opstate": "attached" } } } } Signed-off-by: Parav Pandit <redacted> Reviewed-by: Jiri Pirko <redacted> Reviewed-by: Vu Pham <redacted> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> ---<snip>