Line 407 & 412 on master branch. The logic is to take Ethernet# and hardcode divide by 4 to get front panel port #. This works for 100G ports but when moving to 400G, folks are using base8 instead of base4 to reflect the # of serdes for port breakout.
Current workaround is to use "index" column for this function.
But we see this (/4) hardcoding several places in SONiC. Request to place either base8 or base4 as a user configurable variable (maybe in JSON) and remove all this /4 hardcoding in SONiC codebase.