Hi,
I hope this is where I should send this E-Mail :)

I'm having an issue with port stats reply handler at RYU Controller.

My code is as following:

def send_port_stats_request(datapath, port_num):
    ofp = datapath.ofproto
    ofp_parser = datapath.ofproto_parser

    req = ofp_parser.OFPPortStatsRequest(datapath, 0, port_num)
    return datapath.send_msg(req)


    @set_ev_cls(ofp_event.EventOFPPortStatsReply, MAIN_DISPATCHER)
    def port_stats_reply_handler(self, ev):
        ports = []
        for stat in ev.msg.body:
            print(' \nStatistics of port_no: %d \n'
                  ' rx_packets:    %d \n tx_packets:    %d \n'
                  ' rx_bytes:      %d \n tx_bytes:      %d \n'
                  ' rx_dropped:    %d \n tx_dropped:    %d \n'
                  ' rx_errors:     %d \n tx_errors:     %d \n'
                  ' rx_frame_err:  %d \n rx_over_err:   %d \n rx_crc_err:    %d 
\n'
                  ' collisions:    %d \n duration_sec:  %d \n duration_nsec: %d 
\n'
                  ' --- End of statistics --- \n' %
                  (stat.port_no,
                   stat.rx_packets, stat.tx_packets,
                   stat.rx_bytes, stat.tx_bytes,
                   stat.rx_dropped, stat.tx_dropped,
                   stat.rx_errors, stat.tx_errors,
                   stat.rx_frame_err, stat.rx_over_err,
                   stat.rx_crc_err, stat.collisions,
                   stat.duration_sec, stat.duration_nsec))

        self.logger.debug('PortStats: %s', ports)

once I sent several messages from the controller:
send_port_stats_request(dp1,0)
send_port_stats_request(dp1,1)
send_port_stats_request(dp1,2)
send_port_stats_request(dp1,3)
send_port_stats_request(dp1,4)
send_port_stats_request(dp1,5)
send_port_stats_request(dp1,6)
send_port_stats_request(dp1,7)
send_port_stats_request(dp1,8)
send_port_stats_request(dp1,9)

some of the packets seems to arrive to reply handler and some don't (I see they 
are all sent from the switch (using indigo).
What can be the problem?

In addition, I saw get_port_stats at ofctl - but could not understand what is 
waiters.

If you don't know, can you direct me?

Thanks,
Zahi
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to