Skip to content

Commit f7a1672

Browse files
authored
Added frequency and grid information is failure cases
1 parent 653c38a commit f7a1672

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sonic-xcvrd/xcvrd/xcvrd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ def configure_tx_output_power(self, api, lport, tx_power):
12071207
self.log_error("{} configured tx power {} > maximum power {} supported".format(lport, tx_power, max_p))
12081208
return api.set_tx_power(tx_power)
12091209

1210-
def config_laser_frequency_validate(self, api, lport, freq, grid=75):
1210+
def validate_frequency_and_grid(self, api, lport, freq, grid=75):
12111211
supported_grid, _, _, lowf, highf = api.get_supported_freq_config()
12121212
if freq < lowf:
12131213
self.log_error("{} configured freq:{} GHz is lower than the supported freq:{} GHz".format(lport, freq, lowf))
@@ -1217,18 +1217,18 @@ def config_laser_frequency_validate(self, api, lport, freq, grid=75):
12171217
return False
12181218
if grid == 75:
12191219
if (supported_grid >> 7) & 0x1 != 1:
1220-
self.log_error("{} 75GHz is not supported".format(lport))
1220+
self.log_error("{} configured freq:{}GHz supported grid:{} 75GHz is not supported".format(lport, freq, supported_grid))
12211221
return False
12221222
chan = int(round((freq - 193100)/25))
12231223
if chan % 3 != 0:
1224-
self.log_error("{} configured freq:{} GHz is NOT in 75GHz grid".format(lport, freq))
1224+
self.log_error("{} configured freq:{}GHz is NOT in 75GHz grid".format(lport, freq))
12251225
return False
12261226
elif grid == 100:
12271227
if (supported_grid >> 5) & 0x1 != 1:
1228-
self.log_error("{} 100GHz is not supported".format(lport))
1228+
self.log_error("{} configured freq:{}GHz 100GHz is not supported".format(lport, freq))
12291229
return False
12301230
else:
1231-
self.log_error("{} {}GHz is not supported".format(lport, grid))
1231+
self.log_error("{} configured freq:{}GHz {}GHz is not supported".format(lport, freq, grid))
12321232
return False
12331233
return True
12341234

@@ -1463,7 +1463,7 @@ def task_worker(self):
14631463
# If user requested frequency is NOT the same as configured on the module
14641464
# force datapath re-initialization
14651465
if 0 != freq and freq != api.get_laser_config_freq():
1466-
if self.config_laser_frequency_validate(api, lport, freq) == True:
1466+
if self.validate_frequency_and_grid(api, lport, freq) == True:
14671467
need_update = True
14681468
else:
14691469
# clear setting of invalid frequency config

0 commit comments

Comments
 (0)