From: David Ahern Date: Sat, 11 Nov 2023 17:33:34 +0000 (+0000) Subject: Merge branch 'devlink-instances' into next X-Git-Tag: v6.8.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae0d34854ccfe995d28251b1ae5123970ae142a5;p=thirdparty%2Fiproute2.git Merge branch 'devlink-instances' into next Jiri Pirko says: ==================== Print out recently added attributes that expose relationships between devlink instances. This patchset extends the outputs by "nested_devlink" attributes. Examples: $ devlink dev pci/0000:08:00.0: nested_devlink: auxiliary/mlx5_core.eth.0 auxiliary/mlx5_core.eth.0 pci/0000:08:00.1: nested_devlink: auxiliary/mlx5_core.eth.1 auxiliary/mlx5_core.eth.1 $ devlink dev -j -p { "dev": { "pci/0000:08:00.0": { "nested_devlink": { "auxiliary/mlx5_core.eth.0": {} } }, "auxiliary/mlx5_core.eth.0": {}, "pci/0000:08:00.1": { "nested_devlink": { "auxiliary/mlx5_core.eth.1": {} } }, "auxiliary/mlx5_core.eth.1": {} } } $ devlink port add pci/0000:08:00.0 flavour pcisf pfnum 0 sfnum 106 pci/0000:08:00.0/32768: type eth netdev eth2 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false function: hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable $ devlink port function set pci/0000:08:00.0/32768 state active $ devlink port show pci/0000:08:00.0/32768 pci/0000:08:00.0/32768: type eth netdev eth2 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false function: hw_addr 00:00:00:00:00:00 state active opstate attached roce enable nested_devlink: auxiliary/mlx5_core.sf.2 $ devlink port show pci/0000:08:00.0/32768 -j -p { "port": { "pci/0000:08:00.0/32768": { "type": "eth", "netdev": "eth2", "flavour": "pcisf", "controller": 0, "pfnum": 0, "sfnum": 106, "splittable": false, "function": { "hw_addr": "00:00:00:00:00:00", "state": "active", "opstate": "attached", "roce": "enable", "nested_devlink": { "auxiliary/mlx5_core.sf.2": {} } } } } } $ devlink dev reload auxiliary/mlx5_core.sf.2 netns ns1 $ devlink port show pci/0000:08:00.0/32768 pci/0000:08:00.0/32768: type eth netdev eth2 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false function: hw_addr 00:00:00:00:00:00 state active opstate attached roce enable nested_devlink: auxiliary/mlx5_core.sf.2: netns ns1 $ devlink port show pci/0000:08:00.0/32768 -j -p { "port": { "pci/0000:08:00.0/32768": { "type": "eth", "netdev": "eth2", "flavour": "pcisf", "controller": 0, "pfnum": 0, "sfnum": 106, "splittable": false, "function": { "hw_addr": "00:00:00:00:00:00", "state": "active", "opstate": "attached", "roce": "enable", "nested_devlink": { "auxiliary/mlx5_core.sf.2": { "netns": "ns1" } } } } } } ==================== Signed-off-by: David Ahern --- ae0d34854ccfe995d28251b1ae5123970ae142a5