Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

devlink: Improve the port attributes description

Current PF number description is vague, sometimes interpreted as
some PF index. VF number in the PCI specification starts at 1; however
in kernel, it starts at 0 for representor model.

Improve the description of devlink port attributes PF, VF and SF
numbers with these details.

Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Parav Pandit <parav@nvidia.com>
Link: https://patch.msgid.link/20241224183706.26571-1-parav@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Parav Pandit and committed by
Jakub Kicinski
bb70b0d4 be16b46f

+12 -10
+6 -5
include/net/devlink.h
··· 35 35 /** 36 36 * struct devlink_port_pci_pf_attrs - devlink port's PCI PF attributes 37 37 * @controller: Associated controller number 38 - * @pf: Associated PCI PF number for this port. 38 + * @pf: associated PCI function number for the devlink port instance 39 39 * @external: when set, indicates if a port is for an external controller 40 40 */ 41 41 struct devlink_port_pci_pf_attrs { ··· 47 47 /** 48 48 * struct devlink_port_pci_vf_attrs - devlink port's PCI VF attributes 49 49 * @controller: Associated controller number 50 - * @pf: Associated PCI PF number for this port. 51 - * @vf: Associated PCI VF for of the PCI PF for this port. 50 + * @pf: associated PCI function number for the devlink port instance 51 + * @vf: associated PCI VF number of a PF for the devlink port instance; 52 + * VF number starts from 0 for the first PCI virtual function 52 53 * @external: when set, indicates if a port is for an external controller 53 54 */ 54 55 struct devlink_port_pci_vf_attrs { ··· 62 61 /** 63 62 * struct devlink_port_pci_sf_attrs - devlink port's PCI SF attributes 64 63 * @controller: Associated controller number 65 - * @sf: Associated PCI SF for of the PCI PF for this port. 66 - * @pf: Associated PCI PF number for this port. 64 + * @sf: associated SF number of a PF for the devlink port instance 65 + * @pf: associated PCI function number for the devlink port instance 67 66 * @external: when set, indicates if a port is for an external controller 68 67 */ 69 68 struct devlink_port_pci_sf_attrs {
+6 -5
net/devlink/port.c
··· 1376 1376 * 1377 1377 * @devlink_port: devlink port 1378 1378 * @controller: associated controller number for the devlink port instance 1379 - * @pf: associated PF for the devlink port instance 1379 + * @pf: associated PCI function number for the devlink port instance 1380 1380 * @external: indicates if the port is for an external controller 1381 1381 */ 1382 1382 void devlink_port_attrs_pci_pf_set(struct devlink_port *devlink_port, u32 controller, ··· 1402 1402 * 1403 1403 * @devlink_port: devlink port 1404 1404 * @controller: associated controller number for the devlink port instance 1405 - * @pf: associated PF for the devlink port instance 1406 - * @vf: associated VF of a PF for the devlink port instance 1405 + * @pf: associated PCI function number for the devlink port instance 1406 + * @vf: associated PCI VF number of a PF for the devlink port instance; 1407 + * VF number starts from 0 for the first PCI virtual function 1407 1408 * @external: indicates if the port is for an external controller 1408 1409 */ 1409 1410 void devlink_port_attrs_pci_vf_set(struct devlink_port *devlink_port, u32 controller, ··· 1431 1430 * 1432 1431 * @devlink_port: devlink port 1433 1432 * @controller: associated controller number for the devlink port instance 1434 - * @pf: associated PF for the devlink port instance 1435 - * @sf: associated SF of a PF for the devlink port instance 1433 + * @pf: associated PCI function number for the devlink port instance 1434 + * @sf: associated SF number of a PF for the devlink port instance 1436 1435 * @external: indicates if the port is for an external controller 1437 1436 */ 1438 1437 void devlink_port_attrs_pci_sf_set(struct devlink_port *devlink_port, u32 controller,