[ovs-dev] [PATCH] ofp-table: Improve log message in ofputil_decode_table_features().

Ben Pfaff blp at ovn.org
Tue Feb 2 17:55:27 UTC 2021


On Tue, Feb 02, 2021 at 05:15:20PM +0100, Ilya Maximets wrote:
> On 1/21/21 11:49 PM, Ben Pfaff wrote:
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> > ---
> >  lib/ofp-table.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/lib/ofp-table.c b/lib/ofp-table.c
> > index 6ed6c5e3b274..a956754f2d56 100644
> > --- a/lib/ofp-table.c
> > +++ b/lib/ofp-table.c
> > @@ -523,9 +523,12 @@ ofputil_decode_table_features(struct ofpbuf *msg,
> >  
> >      /* OpenFlow 1.3 and 1.4 always require all of the required properties.
> >       * OpenFlow 1.5 requires all of them if any property is present. */
> > -    if ((seen & OFPTFPT13_REQUIRED) != OFPTFPT13_REQUIRED
> > -        && (tf->any_properties || oh->version < OFP15_VERSION)) {
> > -        VLOG_WARN_RL(&rl, "table features message missing required property");
> > +    unsigned int missing = (seen & OFPTFPT13_REQUIRED) ^ OFPTFPT13_REQUIRED;
> > +    if (missing && (tf->any_properties || oh->version < OFP15_VERSION)) {
> > +        VLOG_WARN_RL(&rl,
> > +                     "table features message missing %u required "
> > +                     "properties, including property %d",
> > +                     count_1bits(missing), rightmost_1bit_idx(missing));
> >          return OFPERR_OFPTFFC_BAD_FEATURES;
> >      }
> >  
> > 
> 
> Makes sense,
> Acked-by: Ilya Maximets <i.maximets at ovn.org>

Thanks, applied to master.


More information about the dev mailing list