Project

General

Profile

Bug #4537

flowadm show-flowprop shows possible values of properties incorrectly

Added by Shruti Sampat about 7 years ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Start date:
2014-01-27
Due date:
% Done:

0%

Estimated time:
Difficulty:
Tags:
needs-triage
Gerrit CR:

Description

The output of 'flowadm show-flowprop' command shows '?' as the possible value of property, if value for the property has not been set.

For e.g., consider flow 'testflow', values for whose properties have not been set, and flow 'https-1', values for whose properties have been set.

shruti@justforkix:~$ flowadm show-flowprop 
FLOW         PROPERTY        VALUE          DEFAULT        POSSIBLE
testflow     maxbw           --             --             ?
testflow     priority        --             --             ?
https-1      maxbw             500          --             500 
https-1      priority        high           --             high

From the man page of flowadm -

POSSIBLE

             A comma-separated list of the  values  the  property
             can  have.  If  the values span a numeric range, the
             minimum and maximum values might be shown as  short-
             hand.   If   the  possible  values  are  unknown  or
             unbounded, -- (double hyphen), is shown.
#1

Updated by Peter Tribble about 1 year ago

  • Assignee set to Peter Tribble
#2

Updated by Peter Tribble about 1 year ago

  • Subject changed from 'flowadm show-flowprop' command output shows possible values of property as '?' if not set to flowadm show-flowprop shows possible values of properties incorrectly

What's actually happening is that flowadm is showing the actual value set for the property, rather than the range of possible values. You can see that for the https-1 flow here. If the value is unset, then it gets printed as a '?'.

The reason for that mistake is a little convoluted.

First, the relevant function dladm_get_flowprop() in libdladm doesn't even have any code to handle the DEFAULT or POSSIBLE case at all. It falls through to the current value.

Second, the DLADM_PROP_VAL_* macros are actually defined in two places. As part of the enum dladm_prop_type_t in libdllink.h, and as part of the enum prop_type_t in libdlflow_impl.h. Unfortunately, the enums are actually different. While flowadm uses the version in libdllink.h, when it gets to dladm_get_flowprop() that uses the other version from libdllink.h. As the values of the macros are different, things just don't match up.

#3

Updated by Peter Tribble about 1 year ago

The other place that uses dladm_get_flowprop() to get the list of possible values is the error message if you try and set an incorrect value. For example:

If the property value is unset, you get:

flowadm set-flowprop -p priority=footle znic0flow
flowadm: warning: footle is an invalid value for flow property priority

If the property value is set (eg to medium), you just get it back:

lowadm set-flowprop -p priority=footle limit-udp-1
flowadm: warning: flow property 'priority' must be one of: medium

Also available in: Atom PDF