On (06/30/09 07:22), Andrew Gallatin wrote:
> 
> I was looking at transitioning my driver from ndd to dladm,
> and I was wondering if there is a way to get a list, from
> the command line, of all private properties that a driver supports.
>
> Eg, the bge driver supports some private properties like "_drain_max":
>
> # dladm show-linkprop bge0 -p _drain_max
> LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
> bge0         _drain_max      rw   64             64             --
>
> Trying the ndd trick (?) doesn't seem to work:
>
> #dladm show-linkprop bge0 -p \?
> LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
> dladm: warning: cannot get link property '?' for bge0: object not found
> bge0         ?
>
>
> So.. are private properties really private now?

dladm itself does not have an interface to return the list of private
properties, and there was no motivation to do this because private properties
are considered something of a deprecated corner case.

However, the framework itself does return the list of private properties. 
('ndd -get /dev/<driver> \?' actually uses the Brussels interfaces to 
get the list of properties. For example, bge registers the following
private properties with the Brussels framework:

    145 mac_priv_prop_t bge_priv_prop[] = {
    146         {"_adv_asym_pause_cap", MAC_PROP_PERM_RW},
    147         {"_adv_pause_cap", MAC_PROP_PERM_RW}
    148 };
    149 
    150 #define BGE_MAX_PRIV_PROPS \
    151         (sizeof (bge_priv_prop) / sizeof (mac_priv_prop_t))

    : 

    3524        macp->m_priv_props = bge_priv_prop;
    :
    3532        err = mac_register(macp, &bgep->mh);

and that information is tracked by the GLDv3 layer and returned
as part of ndd -get /dev/<driver> \?.

Note that if you do know the name of your private property, you can
use dladm to set/get its value using
   # dladm show-linkprop -p _my_private_property [driver]
   # dladm set-linkprop -p _my_private_property=value <driver>


--Sowmini

 

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to