Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion device/marvell/armhf-marvell_et6448m_52x-r0/default_sku
Original file line number Diff line number Diff line change
@@ -1 +1 @@
et6448m t1
et6448m default
11 changes: 11 additions & 0 deletions src/sonic-config-engine/config_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,20 @@ def generate_l2_config(data):
data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'}
return data

def generate_default_config(data):
if not data['DEVICE_METADATA']['localhost'].has_key('hostname'):
data['DEVICE_METADATA']['localhost']['hostname'] = 'sonic'
if not data['DEVICE_METADATA']['localhost'].has_key('type'):
data['DEVICE_METADATA']['localhost']['type'] = 'ToRRouter'
for port in natsorted(data['PORT'].keys()):
data['PORT'][port]['admin_status'] = 'up'
data['PORT'][port]['mtu'] = '9100'
return data

_sample_generators = {
't1': generate_t1_sample_config,
'l2': generate_l2_config,
'default': generate_default_config,
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this default configuration? is the switch in l2 mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"generate_t1_sample_config" IP addresses being assigned from 10.0.0.0 to max port.
"generate_l2_config" all ports were added to Vlan1000
"generate_empty_config" ports were NOT added in config_db.json
To have system without any predefined configs for IP or VLAN, added this "default" config with just port config alone.

Copy link
Collaborator

Choose a reason for hiding this comment

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

there is no clear definition of empty configuration. is it layer 2 more, layer 3 mode? we need a clear definition of empty configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Current empty configuration doesn't even populate ports in config_db.json. User has to populate all the ports manually which can be avoided if scripts can just update all the ports in config and provide user a facility to configure later L2 or L3.

If you dont agree on this, Im ok to abandon this 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.

Also current l2 or t1 config generation adds hardcoded configuration which enables testbed suite to run testing. But the same L2/L3 config may not be the one user interested in.

'empty': generate_empty_config
}

Expand Down