[ovs-discuss] Port speed bug

Ben Pfaff blp at nicira.com
Wed Sep 4 20:40:58 UTC 2013


Thanks, I applied this to master and to branches back to 1.9.

On Mon, Sep 02, 2013 at 09:08:24AM +0200, Benjamin Lunsky wrote:
> Thank you for the quick response Ben.
> 
> Patch is working 100%.
> 
> Regards,
> 
> Benjamin
> 
> 
> 
> Benjamin Lunsky
> benjamin.lunsky at netronome.com
> 
> 
> ---
> 
> 
> 
> 
> On 30 Aug 2013, at 7:11 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > 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.
> 



More information about the discuss mailing list