[ovs-dev] [PATCH] dpif-linux: Use MAX_PORTS instead of hard-coded 65535.

Ben Pfaff blp at nicira.com
Thu May 2 17:06:20 UTC 2013


Thanks, applied.

On Wed, May 01, 2013 at 11:42:49PM -0700, Justin Pettit wrote:
> Looks good.
> 
> --Justin
> 
> 
> On May 1, 2013, at 5:13 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > MAX_PORTS is currently USHRT_MAX (also 65535).  I think that's a
> > coincidence; I don't remember MAX_PORTS being mentioned when the new
> > dpif_channel code was written.
> > 
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> > lib/dpif-linux.c |    2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
> > index b863a2e..39acc9a 100644
> > --- a/lib/dpif-linux.c
> > +++ b/lib/dpif-linux.c
> > @@ -312,7 +312,7 @@ add_channel(struct dpif_linux *dpif, uint32_t port_no, struct nl_sock *sock)
> >         int new_size = port_no + 1;
> >         int i;
> > 
> > -        if (new_size > 65535) {
> > +        if (new_size > MAX_PORTS) {
> >             VLOG_WARN_RL(&error_rl, "%s: datapath port %"PRIu32" too big",
> >                          dpif_name(&dpif->dpif), port_no);
> >             return EFBIG;
> > -- 
> > 1.7.2.5
> > 
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
> 



More information about the dev mailing list