Hi all,

I have started working on CR 6745288.  This CR enhances libdladm by 
allowing users of libdladm to create handles and pass to libdladm 
function.   This reduces the number of open(DLD_CONTROL_DEV) calls.

I have started out with the following structure for the handle:

struct dladm_handle {
    int             dld_fd;    /* file handle for DLD_CONTROL_DEV */
    datalink_id_t   dld_linkid;
    char            dld_linkname[MAXLINKNAMELEN];
};

I've noticed that there are a lot of calls to dladm_name2info() and 
dladm_datalink_id2info(), both of which return the flags, class, and 
media associated with the link.  So, this got me into thinking that I 
should expand the handle to include those things also.  I am thinking of 
expanding the handle to:

struct dladm_handle {
    int                 dld_fd;    /* file handle for DLD_CONTROL_DEV */
    datalink_id_t       dld_linkid;
    char                dld_luinkname[MAXLINKNAMELEN];
    uint32_t            dld_flags;
    uint32_t            dld_media;
    datalink_class_t    dld_class;
};

I've already started changing some libdladm funcitons and dladm.c to use 
handles.  Before I dig deeper and expand the handle, I'd like to get 
feedback on this proposal.

Thanks,
Anurag




Reply via email to