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

[portsyncd]: Removing manual commands to bring up interfaces #174

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

stcheng
Copy link
Contributor

@stcheng stcheng commented Mar 7, 2017

  • allow-hotplug stanza is added to interfaces file

Signed-off-by: Shuotian Cheng [email protected]

#165

@stcheng stcheng self-assigned this Mar 7, 2017
@lguohan
Copy link
Contributor

lguohan commented Mar 7, 2017

there is one more in portsyncd for vlan interface, can we remove that ifup as well?

string cmd = "/sbin/ifup --all --force --interfaces " + file;


return;
m_portTableProducer.set(key, fvVector);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use {} for the else region?

/* Bring up the front panel port as the first place*/
/* TODO: handle system retur code, if-block is just a warning suppressor */
if (system(("/sbin/ifup --force " + key).c_str()))
;
g_portSet.erase(key);
Copy link
Contributor

@lguohan lguohan Mar 7, 2017

Choose a reason for hiding this comment

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

g_portSet [](start = 12, length = 9)

the description in line 190 is not complete. Check if the port is in the PORT_TABLE. if the port is in the PORT_TABLE, then what? If not, then what?

I do not understand line 206, if a new link is detected and is not in g_portSet, then you set m_portTableProducer, why? what's the use case here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the g_portSet is used to track all the ports that are needed for creating the host interfaces. If the host interfaces are created, in other words the nlmsg is recieved, the port is removed from the g_portSet. After all ports are removed from the g_portSet, all host interfaces are created and thus is the time to create the VLAN interfaces via kernel. Otherwise, the VLAN members cannot be added into the VLAN interface.
I remove the 'else' condition, so that after the host interface is created, the nlmsg will be sent to the db via the set function. This is the place that the port admin status is set.

@@ -40,7 +40,7 @@ LinkSync::LinkSync(DBConnector *db) :
m_vlanTableConsumer(db, APP_VLAN_TABLE_NAME),
m_lagTableConsumer(db, APP_LAG_TABLE_NAME)
{
/* See the comments for g_portSet in linksync.h */
/* See the comments for g_portSet in portsyncd.cpp */
Copy link
Contributor

Choose a reason for hiding this comment

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

in the portsyncd.cpp, it is m_portSet, is it g_portSet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, that's a typo.

@@ -200,17 +197,12 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
return;
}

/* Host interface is created */
if (!g_init && g_portSet.find(key) != g_portSet.end())
Copy link
Contributor

Choose a reason for hiding this comment

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

g_init is always false, where did you set it to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

portsyncd.cpp:122: g_init = true;

/* Bring up the front panel port as the first place*/
/* TODO: handle system retur code, if-block is just a warning suppressor */
if (system(("/sbin/ifup --force " + key).c_str()))
;
g_portSet.erase(key);
Copy link
Contributor

Choose a reason for hiding this comment

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

in line 53, you also do g_portSet.erase(), why two places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

line 53 indicates that the admin status is already in the db, which indicates that the host interface is already created. the g_portSet is only used to track the ports that don't have host interfaces created yet.
this part of the code is to handle portsyncd restart issues so that after portsyncd restarts, it could still finish all the uninitialized ports/VLANs.

@lguohan
Copy link
Contributor

lguohan commented Mar 7, 2017

🕐

@stcheng
Copy link
Contributor Author

stcheng commented Mar 7, 2017

updated some comments

- allow-hotplug stanza is added to interfaces file
- vlan_interfaces and lag_interfaces files are removed

Signed-off-by: Shuotian Cheng <[email protected]>
@stcheng stcheng merged commit 6f06b59 into sonic-net:master Mar 15, 2017
@stcheng
Copy link
Contributor Author

stcheng commented Mar 15, 2017

sonic-net/sonic-buildimage#381 is needed for this change.

@stcheng stcheng deleted the bringup branch March 15, 2017 19:04
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
* Add portconfig utility

Signed-off-by: Andriy Moroz <[email protected]>

* Fix units conversion in scripts/intfutil

Signed-off-by: Andriy Moroz <[email protected]>

* Remove old script

Signed-off-by: Andriy Moroz <[email protected]>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
lukasstockner pushed a commit to genesiscloud/sonic-swss that referenced this pull request Apr 2, 2023
… API's read size for read_eeprom (sonic-net#174)

This PR adds stub functions definition with details as to how firmware upgrade should be implemented by a Y cable vendor.
It also fixes the read_eeprom read size for vendor part number and vendor name retreival API's

Description
Added a stub functions definition with a doc string describing how it should be implemented
Added these API's stub functions for vendors to implement

def download_firmware(physical_port, fwfile)
def activate_firmware(physical_port)
def rollback_firmware(physical_port)

Motivation and Context
Firmware upgrade is a functionality that vendors need to implement, this PR adds the definition's
and a description of how the implementation of this firmware upgrade procedure API's should be implemented
by breaking down the firmware upgrade into above specified sub routines.

Signed-off-by: vaibhav-dahiya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants