tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Per-cpu stats for network interfaces



On Sat, Jan 25, 2020 at 08:40:17AM -0800, Jason Thorpe wrote:
> +/*
> + * Transitional aid to allow drivers to migrate to the new API.  Once
> + * all drivers are transitioned, the implementation will be replaced
> + * with per-cpu counters.
> + */
> +
> +static inline uint64_t *
> +IF_STAT_GETREF(ifnet_t *ifp)
> +{
> +	return (uint64_t *)(((uintptr_t)ifp) +
> +	    offsetof(ifnet_t, if_data.ifi_ipackets));
> +}

Looks good.  I think you can `return &ifp->if_data.ifi_ipackets;` in
IF_STAT_GETREF()?

Dave

-- 
David Young
dyoung%pobox.com@localhost    Urbana, IL    (217) 721-9981


Home | Main Index | Thread Index | Old Index