On Fri, Aug 30, 2013 at 04:16:58PM +0200, Benjamin Lunsky wrote:
> I have been working on my own netdev-provider to set up the port speeds in 
> OVS.
> 
> I noticed that in lib/ofp-util.h, max_speed and curr_speed are of type 
> uint32_t and are described as speed in kbps
> 
> /* Abstract ofp10_phy_port or ofp11_port. */
> struct ofputil_phy_port {
>  . . . 
>     /* Speed. */
>     uint32_t curr_speed;        /* Current speed, in kbps. */
>     uint32_t max_speed;         /* Maximum supported speed, in kbps. */
> };
> 
> and in ofproto/ofproto.c, these are determined in these lines in static 
> struct netdev * ofport_open( . . . )
> 
>     pp->curr_speed = netdev_features_to_bps(pp->curr, 0);
>     pp->max_speed = netdev_features_to_bps(pp->supported, 0);
> 
> 
> But in lib/netdev.c,  netdev_features_to_bps returns bps not kbps
> Everything is therefore off by 1000, and because max_speed and curr_speed are 
> of type uint32_t, and netdev_features_to_bps returns uint64_t - the 
> information is lost on a 10 Gbps port and one cannot simply divide by 1000 
> again to get port speed. 
> 
> I think this is a bug? unless I'm missing something?

I think you're right.  I sent out a patch to fix the problem.  Will
you review it?

Thanks,

Ben.
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to