From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Tue, 17 Apr 2012 10:19:32 +0200 References: <1334618695-28338-1-git-send-email-martin@hundeboll.net> In-Reply-To: <1334618695-28338-1-git-send-email-martin@hundeboll.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201204171019.32919.lindner_marek@yahoo.de> Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: The list for a Better Approach To Mobile Ad-hoc Networking On Tuesday, April 17, 2012 01:24:55 Martin Hundeb=C3=B8ll wrote: > Added additional counters in a bat_stats structure, which are exported > through the ethtool api. The counters are specific to batman-adv and > includes: > forwarded packets > management packets (OGMs at this point) > translation table packets > distributed arp table packets Looks very good! A few questions though: > @@ -869,6 +875,9 @@ static int route_unicast_packet(struct sk_buff *skb, > struct hard_iface *recv_if) /* decrement ttl */ > unicast_packet->header.ttl--; >=20 > + /* Update stats counter */ > + bat_priv->bat_stats.forward++; Here we only count the number of packets. Would it be possible to also coun= t=20 the number of bytes ? Similar to tx_packets and tx_bytes ? Same for management tx/bytes. > +struct bat_stats { > + uint64_t forward; > + uint64_t mgmt_tx; > + uint64_t mgmt_rx; > + uint64_t tt_request_tx; > + uint64_t tt_request_rx; > + uint64_t tt_response_tx; > + uint64_t tt_response_rx; > + uint64_t tt_roam_adv_tx; > + uint64_t tt_roam_adv_rx; > + uint64_t dat_request_tx; > + uint64_t dat_request_rx; > + uint64_t dat_reply_tx; > + uint64_t dat_reply_rx; > +}; How do we handle code segments that are not compiled into the module ? We=20 simply leave this counters hanging around at 0 ? Regards, Marek