1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

LACP bypass fixes

Ticket: CM-5924, CM-5937, CM-5921, CM-5932
Reviewed By: CCR-2911
Testing Done:

bonding driver:
- renamed bond lacp-bypass-use-priority config option to
  lacp-bypass-all-active with the default value of 0
- ignore clag role when lacp-bypass-all-active is enabled
- added info logging of lacp bypass state changes

iproute2:
- renamed bond lacp-bypass-use-priority config option

ifupdown:
- renamed bond lacp-bypass-use-priority config option
- added default value handling for lacp bypass attributes

switchd:
- macs learned on individual slaves are now sync to kernel with
  the bond's ifindex.  This eliminates flooding when cpu is
  communicating to the host where the bond is in lacp bypass
- fixed bond forwarding state propagation to individual slaves in
  bypass
This commit is contained in:
Wilson Kok
2015-05-08 11:17:14 -07:00
parent 458b49fa1e
commit 137de5d7dc
2 changed files with 16 additions and 16 deletions

View File

@ -94,11 +94,11 @@ class ifenslave(moduleBase):
'bond-lacp-bypass-priority':
{'help' : 'slave priority for lacp bypass',
'example' : ['bond-lacp-bypass-priority swp1=1 swp2=1 swp3=2']},
'bond-lacp-bypass-use-priority':
{'help' : 'enable priority based selection for lacp bypass',
'bond-lacp-bypass-all-active':
{'help' : 'allow all slaves to be active in lacp bypass irrespective of priority',
'validvals' : ['0', '1'],
'default' : '1',
'example' : ['bond-lacp-bypass-use-priority 1']},
'default' : '0',
'example' : ['bond-lacp-bypass-all-active 1']},
'bond-slaves' :
{'help' : 'bond slaves',
'required' : True,
@ -170,7 +170,7 @@ class ifenslave(moduleBase):
self.logger.warn('%s: required attribute %s'
%(ifaceobj.name, dattrname) +
' not present or set to \'0\'')
elif attrname in ['bond-lacp-bypass-allow']:
elif attrname in ['bond-lacp-bypass-allow', 'bond-lacp-bypass-all-active', 'bond-lacp-bypass-period']:
# For some attrs, set default values
optiondict = self.get_mod_attr(attrname)
if optiondict:
@ -193,7 +193,7 @@ class ifenslave(moduleBase):
('bond-lacp-fallback-allow', 'lacp_bypass_allow'),
('bond-lacp-fallback-period', 'lacp_bypass_period'),
('bond-lacp-bypass-allow', 'lacp_bypass_allow'),
('bond-lacp-bypass-use-priority', 'lacp_bypass_use_priority'),
('bond-lacp-bypass-all-active', 'lacp_bypass_all_active'),
('bond-lacp-bypass-period', 'lacp_bypass_period')])
linkup = self.ipcmd.is_link_up(ifaceobj.name)
try:
@ -384,8 +384,8 @@ class ifenslave(moduleBase):
self.ifenslavecmd.get_lacp_fallback_period(bondname),
'bond-lacp-bypass-priority' :
self.ifenslavecmd.get_lacp_fallback_priority(bondname),
'bond-lacp-bypass-use-priority' :
self.ifenslavecmd.get_lacp_fallback_use_priority(bondname)}
'bond-lacp-bypass-all-active' :
self.ifenslavecmd.get_lacp_fallback_all_active(bondname)}
slaves = self.ifenslavecmd.get_slaves(bondname)
if slaves:
bondattrs['bond-slaves'] = slaves

View File

@ -54,7 +54,7 @@ class ifenslaveutil(utilsBase):
%(bondname, x))),
['use_carrier', 'miimon', 'min_links', 'num_unsol_na',
'num_grat_arp', 'lacp_bypass_allow', 'lacp_bypass_period',
'lacp_bypass_use_priority', 'clag_enable'])
'lacp_bypass_all_active', 'clag_enable'])
except Exception, e:
pass
@ -318,25 +318,25 @@ class ifenslaveutil(utilsBase):
prio_str = ' '.join(prios)
return prio_str
def set_lacp_fallback_use_priority(self, bondname, useprio, prehook=None, posthook=None):
if (self._cache_check([bondname, 'linkinfo', 'lacp_bypass_use_priority'],
lacp_bypass_use_priority)):
def set_lacp_fallback_all_active(self, bondname, useprio, prehook=None, posthook=None):
if (self._cache_check([bondname, 'linkinfo', 'lacp_bypass_all_active'],
lacp_bypass_all_active)):
return
if prehook:
prehook(bondname)
try:
self.write_file('/sys/class/net/%s' %bondname +
'/bonding/lacp_bypass_use_priority', useprio)
'/bonding/lacp_bypass_all_active', useprio)
except:
raise
finally:
if posthook:
posthook(bondname)
self._cache_update([bondname, 'linkinfo',
'lacp_bypass_use_priority'], useprio)
'lacp_bypass_all_active'], useprio)
def get_lacp_fallback_use_priority(self, bondname):
return self._cache_get([bondname, 'linkinfo', 'lacp_bypass_use_priority'])
def get_lacp_fallback_all_active(self, bondname):
return self._cache_get([bondname, 'linkinfo', 'lacp_bypass_all_active'])
def get_ad_sys_mac_addr(self, bondname):
return self._cache_get([bondname, 'linkinfo', 'ad_sys_mac_addr'])