Skip to contentSkip to conversation

ice: use internal pf id instead of function number

PATCH Superseded Michal Swiatkowski 2 participants 2 messages Aug 13, 2024 – Aug 14, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ice: use internal pf id instead of function number

Use always the same pf id in devlink port number. When doing pass-through the PF to VM bus info func number can be any value.

---
 drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/devlink/devlink_port.c +2 -2
index 4abdc40d345e..1fe441bfa0ca 100644
@@ -340,7 +340,7 @@ int ice_devlink_create_pf_port(struct ice_pf *pf)
 		return -EIO;
 
 	attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
-	attrs.phys.port_number = pf->hw.bus.func;
+	attrs.phys.port_number = pf->hw.pf_id;
 
 	/* As FW supports only port split options for whole device,
 	 * set port split options only for first PF.
@@ -458,7 +458,7 @@ int ice_devlink_create_vf_port(struct ice_vf *vf)
 		return -EINVAL;
 
 	attrs.flavour = DEVLINK_PORT_FLAVOUR_PCI_VF;
-	attrs.pci_vf.pf = pf->hw.bus.func;
+	attrs.pci_vf.pf = pf->hw.pf_id;
 	attrs.pci_vf.vf = vf->vf_id;
 
 	ice_devlink_set_switch_id(pf, &attrs.switch_id);
Signature · 1 line
2.42.0
#1 lore raw
Quoted 2 lines · Tue, Aug 13, 2024 at 09:16:10AM CEST, [email protected] wrote:

Use always the same pf id in devlink port number. When doing pass-through the PF to VM bus info func number can be any value.

From the patch subject I'm not sure which tree you target, but since this is a bugfix of something not recent, you should target -net. Also, please provide "Fixes" tag blaming the commit(s) that introduced the issue.

Quoted 33 lines

---
drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/devlink/devlink_port.c +2 -2
index 4abdc40d345e..1fe441bfa0ca 100644
@@ -340,7 +340,7 @@ int ice_devlink_create_pf_port(struct ice_pf *pf)
 		return -EIO;
 
 	attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
-	attrs.phys.port_number = pf->hw.bus.func;
+	attrs.phys.port_number = pf->hw.pf_id;
 
 	/* As FW supports only port split options for whole device,
 	 * set port split options only for first PF.
@@ -458,7 +458,7 @@ int ice_devlink_create_vf_port(struct ice_vf *vf)
 		return -EINVAL;
 
 	attrs.flavour = DEVLINK_PORT_FLAVOUR_PCI_VF;
-	attrs.pci_vf.pf = pf->hw.bus.func;
+	attrs.pci_vf.pf = pf->hw.pf_id;
 	attrs.pci_vf.vf = vf->vf_id;
 
 	ice_devlink_set_switch_id(pf, &attrs.switch_id);
Signature · 1 line
2.42.0