proposed new if_data variable

From: Brooks Davis (brooks_at_one-eyed-alien.net)
Date: 08/27/04

  • Next message: Andre Oppermann: "Re: proposed new if_data variable"
    Date: Fri, 27 Aug 2004 13:05:32 -0700
    To: net@freebsd.org
    
    
    

    I'd like to proposed adding a new variable, ifi_epoch, to struct
    if_data. It will be set to the time the counters were zeroed,
    currently, the time if_attach was called. The intent is to provide a
    correct value for RFC2233's ifCounterDiscontinuityTime and to make it
    easier for applications to verify that the interface they are looking at
    is the same one that had this index last time.

    Since this will increase the size of struct if_data and thus struct
    ifnet, the change needs to be made now if it's going to be made for
    5-STABLE. Any comments on this idea?

    -- Brooks

    ----- Forwarded message from Brooks Davis <brooks@freebsd.org> -----

    From: Brooks Davis <brooks@freebsd.org>
    Date: Wed, 25 Aug 2004 19:46:15 GMT
    To: Perforce Change Reviews <perforce@freebsd.org>
    X-Virus-Status: No
    Subject: PERFORCE change 60419 for review

    http://perforce.freebsd.org/chv.cgi?CH=60419

    Change 60419 by brooks@brooks_minya on 2004/08/25 19:45:20

                   Add a new member to if_data, ifi_epoch (aka ifp->if_epoch).
                   if_epoch is indended to be set to the time the interface was
                   attached or the last time the stats were reset (we don't
                   currently support that, but it is a potentialy useful concept
                   and I've got plans to cause resets to happen in certain
                   circumstances). if_epoch is indended to always be a valid value
                   for ifCounterDiscontinuityTime in RFC2233.

    Affected files ...

    .. //depot/user/brooks/cleanup/sys/net/if.c#28 edit
    .. //depot/user/brooks/cleanup/sys/net/if.h#7 edit
    .. //depot/user/brooks/cleanup/sys/net/if_var.h#19 edit

    Differences ...

    ==== //depot/user/brooks/cleanup/sys/net/if.c#28 (text+ko) ====

    @@ -387,6 +387,7 @@
             TAILQ_INIT(&ifp->if_multiaddrs);
             knlist_init(&ifp->if_klist, NULL);
             getmicrotime(&ifp->if_lastchange);
    + getmicrotime(&ifp->if_epoch);
     
     #ifdef MAC
             mac_init_ifnet(ifp);

    ==== //depot/user/brooks/cleanup/sys/net/if.h#7 (text+ko) ====

    @@ -103,6 +103,7 @@
             u_long ifi_hwassist; /* HW offload capabilities */
             u_long ifi_unused; /* XXX was ifi_xmittiming */
             struct timeval ifi_lastchange; /* time of last administrative change */
    + struct timeval ifi_epoch; /* time of creation or stat reset */
     };
     
     #define IFF_UP 0x1 /* interface is up */

    ==== //depot/user/brooks/cleanup/sys/net/if_var.h#19 (text+ko) ====

    @@ -227,6 +227,7 @@
     #define if_iqdrops if_data.ifi_iqdrops
     #define if_noproto if_data.ifi_noproto
     #define if_lastchange if_data.ifi_lastchange
    +#define if_epoch if_data.ifi_epoch
     #define if_recvquota if_data.ifi_recvquota
     #define if_xmitquota if_data.ifi_xmitquota
     #define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)

    ----- End forwarded message -----

    
    



  • Next message: Andre Oppermann: "Re: proposed new if_data variable"

    Relevant Pages

    • Re: proposed new if_data variable
      ... Brooks Davis wrote: ... It will be set to the time the counters were zeroed, ... > Since this will increase the size of struct if_data and thus struct ... the change needs to be made now if it's going to be made for ...
      (freebsd-net)
    • [PATCH][2.6.7-mm5] perfctr low-level documentation
      ... Control data may be per-counter, global, or both. ... The counters are not assumed to be interchangeable. ... +"struct perfctr_sum_ctrs" ... +some low-level driver operations. ...
      (Linux-Kernel)
    • Re: [PATCH 1/4] x86_64: (SPARSE_VIRTUAL doubles sparsemem speed)
      ... performance counter before and after virt_to_page and page_address. ... This patch allows the use of simple performance counters to measure time ... struct pc pc; ... To mark the beginning of the time measurement do ...
      (Linux-Kernel)
    • Re: proposed new if_data variable
      ... > I'd like to proposed adding a new variable, ifi_epoch, to struct ... It will be set to the time the counters were zeroed, ... > easier for applications to verify that the interface they are looking at ... BMS ...
      (freebsd-net)
    • Re: if_data size issues
      ... Brooks Davis wrote: ... >>Given the pain this change is causing and the limited impact of ... theory that I can use a time_t without changing the struct size. ... I think it would be useful to declare upfront that should a ...
      (freebsd-arch)