Skip to content

Commit

Permalink
[Dynamic Buffer Calc] Support dynamic buffer calculation on top of po…
Browse files Browse the repository at this point in the history
…rt auto negotiation (sonic-net#1762)

- What I did
Update the speed used for headroom calculating according to port auto-negotiation change.
The speed taken into the calculation is now called effective speed in the code.

- Why I did it
One logic was to take the configured speed into account when calculating the headroom because it's the maximum possible speed at which a port runs.
As port auto-negotiation supported, this logic needs to be updated accordingly:
The maximum possible speed is no longer the configured one with auto-negotiation enabled.
So the speed taken into account should be:

If port auto-negotiation is enabled:
maximum speed in adv_speeds if it is configured
maximum speed in supported_speeds otherwise
Otherwise: the configured speed

- How I verified it
Run regression test and vs test.

Signed-off-by: Stephen Sun stephens@nvidia.com
  • Loading branch information
stephenxs authored Jul 2, 2021
1 parent 1367646 commit 5d24d08
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 60 deletions.
3 changes: 2 additions & 1 deletion cfgmgr/buffermgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ int main(int argc, char **argv)
TableConnector(&cfgDb, CFG_BUFFER_PORT_INGRESS_PROFILE_LIST_NAME),
TableConnector(&cfgDb, CFG_BUFFER_PORT_EGRESS_PROFILE_LIST_NAME),
TableConnector(&cfgDb, CFG_DEFAULT_LOSSLESS_BUFFER_PARAMETER),
TableConnector(&stateDb, STATE_BUFFER_MAXIMUM_VALUE_TABLE)
TableConnector(&stateDb, STATE_BUFFER_MAXIMUM_VALUE_TABLE),
TableConnector(&stateDb, STATE_PORT_TABLE_NAME)
};
cfgOrchList.emplace_back(new BufferMgrDynamic(&cfgDb, &stateDb, &applDb, buffer_table_connectors, db_items_ptr));
}
Expand Down
Loading

0 comments on commit 5d24d08

Please sign in to comment.