octeontx2-af: map management port always to first PF
PATCH v2 1/1 octeontx2-af: map management port always to first PF
The user can enable or disable any MAC block or a few ports of the block. The management port's interface name varies depending on the setup of the user if its not mapped to the first pf.
The management port mapping is now configured to always connect to the first PF. This patch implements this change.
---
v2 * Refactor code to avoid code duplication.
.../net/ethernet/marvell/octeontx2/af/mbox.h | 5 +- .../ethernet/marvell/octeontx2/af/rvu_cgx.c | 84 +++++++++++++------ 2 files changed, 63 insertions(+), 26 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.h +4 -1
@@ -639,7 +639,10 @@ struct cgx_lmac_fwdata_s {/* Only applicable if SFP/QSFP slot is present */ struct sfp_eeprom_s sfp_eeprom;struct phy_s phy; -#define LMAC_FWDATA_RESERVED_MEM 1021 +u32 lmac_type; +u32 portm_idx; + u64 mgmt_port:1; +#define LMAC_FWDATA_RESERVED_MEM 1019u64 reserved[LMAC_FWDATA_RESERVED_MEM ]; };
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +59 -25
100 lines not on this page · raw message
--
2.17.1
Quoted 7 lines · Hariprasad Kelam
The user can enable or disable any MAC block or a few ports of the block. The management port's interface name varies depending on the setup of the user if its not mapped to the first pf.
The management port mapping is now configured to always connect to the first PF. This patch implements this change.
nit: it's generally preferred to avoid "this patch.." language in commit messages, as it is clear from the context.
That being said, its not worth a re-roll just to fix this.
Jakub Kicinski
maintainerQuoted 3 lines · On Wed, 10 Apr 2024 18:55:38 +0530 Hariprasad Kelam wrote:
The user can enable or disable any MAC block or a few ports of the block. The management port's interface name varies depending on the setup of the user if its not mapped to the first pf.
There is no concept of management port in Linux networking. I may be missing the point, but I'm unable to review this in the context of the upstream Linux kernel.
Sunil Kovvuri Goutham
maintainerQuoted 17 lines
-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Friday, April 12, 2024 8:26 AM
To: Hariprasad Kelam <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Sunil Kovvuri Goutham <[email protected]>; Geethasowjanya Akula <[email protected]>; Jerin Jacob <[email protected]>; Linu Cherian <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>; Naveen Mamindlapalli <[email protected]>; [email protected]; [email protected]
Subject: Re: [net-next PatchV2] octeontx2-af: map management port always to first PF----------------------------------------------------------------------
On Wed, 10 Apr 2024 18:55:38 +0530 Hariprasad Kelam wrote:
Quoted 7 lines
Quoted 3 lines
The user can enable or disable any MAC block or a few ports of the block. The management port's interface name varies depending on the setup of the user if its not mapped to the first pf.
There is no concept of management port in Linux networking.
I may be missing the point, but I'm unable to review this in the context of the upstream Linux kernel.
Agree, that there is no concept of management port in Linux.
From Octeon hardware pov, there are multiple MACs and each MAC (internally called RPM) is capable of supporting multiple interfaces (called LMACs). Let's say there are two RPMs on the board and RPM0 is configured to 2x50G and RPM1 is configured as 4x10G.
When kernel boots with this config, let's say the interface names are eth0, eth1.. eth5.
If user is using 'eth3' for NFS, DHCP, SSH etc (ie for device management purposes) and then if user changes RPM0
config to 4x10G, then in the subsequent boot the same RPM1:LMAC0 could be named as 'eth5' now.
Customers have reported that their scripts are not working in these scenarios and they want some predictable naming.
What this patch does is that, RPM:LMAC0 which customer is using for management port is always mapped to same PCI device, so that interface naming remains unchanged irrespective of different RPM configurations.
Thanks,
Sunil.
Jakub Kicinski
maintainerQuoted 10 lines · On Fri, 12 Apr 2024 12:07:40 +0000 Sunil Kovvuri Goutham wrote:
Agree, that there is no concept of management port in Linux.
From Octeon hardware pov, there are multiple MACs and each MAC (internally called RPM) is capable of supporting multiple interfaces (called LMACs). Let's say there are two RPMs on the board and RPM0 is configured to 2x50G and RPM1 is configured as 4x10G.
When kernel boots with this config, let's say the interface names are eth0, eth1.. eth5.
If user is using 'eth3' for NFS, DHCP, SSH etc (ie for device management purposes) and then if user changes RPM0
config to 4x10G, then in the subsequent boot the same RPM1:LMAC0 could be named as 'eth5' now.
Customers have reported that their scripts are not working in these scenarios and they want some predictable naming.What this patch does is that, RPM:LMAC0 which customer is using for management port is always mapped to same PCI device, so that interface naming remains unchanged irrespective of different RPM configurations.
You should try to associate a devlink port with the netdev, that will give it appropriate predictable naming. (Failing that, just implement ndo_get_phys_port_name directly, but really devlink is much preferred).