Skip to content

Commit bb70b0d

Browse files
paravmellanoxkuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Shay Drory <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Parav Pandit <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent be16b46 commit bb70b0d

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

include/net/devlink.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct devlink_port_phys_attrs {
3535
/**
3636
* struct devlink_port_pci_pf_attrs - devlink port's PCI PF attributes
3737
* @controller: Associated controller number
38-
* @pf: Associated PCI PF number for this port.
38+
* @pf: associated PCI function number for the devlink port instance
3939
* @external: when set, indicates if a port is for an external controller
4040
*/
4141
struct devlink_port_pci_pf_attrs {
@@ -47,8 +47,9 @@ struct devlink_port_pci_pf_attrs {
4747
/**
4848
* struct devlink_port_pci_vf_attrs - devlink port's PCI VF attributes
4949
* @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
5253
* @external: when set, indicates if a port is for an external controller
5354
*/
5455
struct devlink_port_pci_vf_attrs {
@@ -61,8 +62,8 @@ struct devlink_port_pci_vf_attrs {
6162
/**
6263
* struct devlink_port_pci_sf_attrs - devlink port's PCI SF attributes
6364
* @controller: Associated controller number
64-
* @sf: Associated PCI SF for of the PCI PF for this port.
65-
* @pf: Associated PCI PF number for this port.
65+
* @sf: associated SF number of a PF for the devlink port instance
66+
* @pf: associated PCI function number for the devlink port instance
6667
* @external: when set, indicates if a port is for an external controller
6768
*/
6869
struct devlink_port_pci_sf_attrs {

net/devlink/port.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ EXPORT_SYMBOL_GPL(devlink_port_attrs_set);
13761376
*
13771377
* @devlink_port: devlink port
13781378
* @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
13801380
* @external: indicates if the port is for an external controller
13811381
*/
13821382
void devlink_port_attrs_pci_pf_set(struct devlink_port *devlink_port, u32 controller,
@@ -1402,8 +1402,9 @@ EXPORT_SYMBOL_GPL(devlink_port_attrs_pci_pf_set);
14021402
*
14031403
* @devlink_port: devlink port
14041404
* @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
14071408
* @external: indicates if the port is for an external controller
14081409
*/
14091410
void devlink_port_attrs_pci_vf_set(struct devlink_port *devlink_port, u32 controller,
@@ -1430,8 +1431,8 @@ EXPORT_SYMBOL_GPL(devlink_port_attrs_pci_vf_set);
14301431
*
14311432
* @devlink_port: devlink port
14321433
* @controller: associated controller number for the devlink port instance
1433-
* @pf: associated PF for the devlink port instance
1434-
* @sf: associated SF of a PF for the devlink port instance
1434+
* @pf: associated PCI function number for the devlink port instance
1435+
* @sf: associated SF number of a PF for the devlink port instance
14351436
* @external: indicates if the port is for an external controller
14361437
*/
14371438
void devlink_port_attrs_pci_sf_set(struct devlink_port *devlink_port, u32 controller,

0 commit comments

Comments
 (0)