Ejemplo n.º 1
0
    def rx_okay(self, wait_time=0.2, checks=10):
        """
        Is this gbe core receiving okay?
            i.e. _rxctr incrementing and _rxerrctr not incrementing

        :param wait_time: seconds to wait between checks
        :param checks: times to run check
        :return: True/False
        """
        if checks < 2:
            raise RuntimeError('Cannot check less often than twice?')
        fields = [
            CheckCounter(self.name + '_rxctr', True, True),
            CheckCounter(self.name + '_rxfullctr', False),
            CheckCounter(self.name + '_rxofctr', False),
            CheckCounter(self.name + '_rxerrctr', False),
            CheckCounter(self.name + '_rxbadctr', False),
            CheckCounter(self.name + '_rxvldctr'),
        ]
        result, message = check_changing_status(fields, self.read_rx_counters,
                                                wait_time, checks)
        if not result:
            self.parent.logger.error('%s: %s' % (self.fullname, message))
            return False
        return True
Ejemplo n.º 2
0
 def tx_okay(self, wait_time=0.2, checks=10):
     """
     Is this gbe core transmitting okay?
     i.e. _txctr incrementing and _txerrctr not incrementing
     :param wait_time: seconds to wait between checks
     :param checks: times to run check
     :return: True/False
     """
     if checks < 2:
         raise RuntimeError('Cannot check less often than twice?')
     fields = {
         CheckCounter(self.name + '_txctr', True, True),
         CheckCounter(self.name + '_txfullctr', False),
         CheckCounter(self.name + '_txofctr', False),
         CheckCounter(self.name + '_txerrctr', False),
         CheckCounter(self.name + '_txvldctr'),
     }
     result, message = check_changing_status(
         fields, self.read_tx_counters, wait_time, checks)
     if not result:
         self.parent.logger.error('%s: %s' % (self.fullname, message))
         return False
     return True
Ejemplo n.º 3
0
 def tx_okay(self, wait_time=0.2, checks=10):
     """
     Is this gbe core transmitting okay?
     i.e. _txctr incrementing and _txerrctr not incrementing
     :param wait_time: seconds to wait between checks
     :param checks: times to run check
     :return: True/False
     """
     if checks < 2:
         raise RuntimeError('Cannot check less often than twice?')
     fields = {
         # name, required, True=same|False=different
         self.name + '_txctr': (True, False),
         self.name + '_txfullctr': (False, True),
         self.name + '_txofctr': (False, True),
         self.name + '_txerrctr': (False, True),
         self.name + '_txvldctr': (False, False),
     }
     result, message = check_changing_status(fields, self.read_tx_counters,
                                             wait_time, checks)
     if not result:
         LOGGER.error('%s: %s' % (self.fullname, message))
         return False
     return True