Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Buffer Config Manager #417

Merged
merged 10 commits into from
Jan 26, 2018
Merged

Conversation

andriymoroz-mlnx
Copy link
Contributor

@andriymoroz-mlnx andriymoroz-mlnx commented Dec 15, 2017

Signed-off-by: Andriy Moroz c_andriym@mellanox.com

What I did
PG Buffers update on port speed change

Why I did it
Added buffer manager to track port speed and update PG profiles

How I verified it
Checked PG profiles on port on different speed set
Manually tested typical setups configuration (t1, t1-lag, t0)

Details if related
See: https://github.com/Azure/SONiC/wiki/Run-Time-Buffers-Configuration-Update-design

NOTE1:
Dynamic profile deletion if not used is not implemented (requires more tests and investigation)
Does not affect main functionality. Suggest to implement it as an improvement.

NOTE2:
speed+cable-to-profile mapping implemented in .ini file not in an additional DB as described in the design. (will be in sonic-buildimage PR)

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
@lguohan
Copy link
Contributor

lguohan commented Jan 10, 2018

@yxieca to review

doCableTask(fvField(i), fvValue(i));
}
if (table_name == CFG_PORT_TABLE_NAME && fvField(i) == "speed")
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the field ever != "speed"?

If yes, why ignoring them is correct? Please at least add comment to state reason why it is safe to ignore them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we receive updates for other fields as well. Actually every time at least one field in the table gets updated, all subscribers receive notifications about all fields. buffer manager is interested in speed only. I'll add a comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation!


namespace swss {

#define INGRESS_LOSSLESS_PG_POOL_NAME "ingress_lossless_pool"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is assuming ingress lossless pg pool name the right thing to do?

Can this code support both shared ingress pg pool and separate pg pools for lossless and lossy traffic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently we support buffers update for profiles which use ingress lossless pools only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it prevent shared pg pool?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a discussion with Guohan, this change will affect Broadcom platform in negative way.

On some Broadcom platforms, due to the MMU memory size limitation, we have to allocate a shared buffer pool for all pgs (lossy and lossless), and create 2 buffer profiles on top of the shared pg pool.

I think by hard coding the pg pool name, here is a potential risk for Broadcom platforms that requires shared buffer pool.

There is a buffers.json file checked in for Broadcom TH chip: https://github.com/Azure/sonic-swss/blob/master/swssconfig/sample/th.64ports.buffers.json

Please make sure your code works on this scenario as well.

Thanks,
Ying

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, pool_name is yet another candidate to get to the new table with QOS/BUFFER configuration (besides pg/queue index to generate profile for)
But existing implementation will still work with this platform.
Since the configuration is static no new profiles will be generated on speed change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated config for Force10-S6100 (previously by mistake used td2.32ports.buffers.json for it)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. thanks for the update.

namespace swss {

#define INGRESS_LOSSLESS_PG_POOL_NAME "ingress_lossless_pool"
#define LOSSLESS_PGS "3-4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By defining lossless pgs to 3-4 in code, do we lose the flexibility of choosing any pg as lossless?

I know that in practice we are always have been using 3-4 as lossless pgs, but losing the capability of changing is a bit concerning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theoretically PGs numbers can be fetched from the PORT_QOS_MAP:pfc_enable.
@lguohan, can we rely on the fact that queues specified in PORT_QOS_MAP:pfc_enable ("3,4") will always be the ones for which we need to update ingress lossless profile on speed change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a discussion, we decided to move forward with this change for now and revisit this area and remove the hard coded pg numbers in the future.

}
if (ret == Select::TIMEOUT)
{
buffmgr.doTask();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think calling drain() makes more sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, I'll check. Just used the solution similar to initmgrd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doTask() in base class calls drain:

void Orch::doTask()
{
    for(auto &it : m_consumerMap)
    {
        it.second->drain();
    }
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for digging it up!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doTask is virtual function and the call will be dispatched to derived class. but calling doTask() is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buffermgr does not override doTask(void) so we will go via Orch::doTask() anyway

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks :-)

@lguohan
Copy link
Contributor

lguohan commented Jan 16, 2018

I would really like to see swss integration tests on this PR.

Copy link
Contributor

@yxieca yxieca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please respond to the buffer pool comment.

Thanks,
Ying

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
@andriymoroz-mlnx
Copy link
Contributor Author

VS test requires changes in VS docker (sonic-net/sonic-buildimage@ff8332f) which require changes from this PR
probably need to be reverted and added later to avoid deadlock
so it is for preview only

@andriymoroz-mlnx
Copy link
Contributor Author

Changes with the test reverted and moved to the separate PR
#432

@yxieca
Copy link
Contributor

yxieca commented Jan 24, 2018

It appears that this review might need to be updated before it can be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants