From: Gary Thomas <gthomas@redhat.com>
To: Andrew Lunn <andrew.lunn@ascom.ch>
Cc: ecos-discuss@sources.redhat.com, Grant Edwards <grante@visi.com>
Subject: Re: [ECOS] SNMP shows zero tx packets?
Date: Thu, 04 Jan 2001 05:28:00 -0000 [thread overview]
Message-ID: <XFMail.20010104062828.gthomas@redhat.com> (raw)
In-Reply-To: <20010104093320.X8442@biferten.ma.tech.ascom.ch>
On 04-Jan-2001 Andrew Lunn wrote:
> On Thu, Jan 04, 2001 at 09:14:50AM +0100, Andrew Lunn wrote:
>> You need to look in packages/net/snmp/agent/mibgroups/mibII/inferfaces.c
>>
>> The offending bit of code is
>>
>> case IFOUTUCASTPKTS:
>> long_ret = ifp->if_opackets - ifp->if_omcasts;
>> return (unsigned char *) &long_ret;
>>
>> This is returning the number of multicast packets output!
>> It should return if_opackets.
>
> Duh, i should not better than to reply before drinking the mornings
> first cup of coffee. That line is correct.
>
> Thats seems to be missing is code to increment if_opackets. I cannot
> find that anyway. Realy you need to go back to the OpenBSD sources and
> find out where it increments the counter. I suspect its either in the
> device driver itself, or the generic ethernet layer between the driver
> and the stack.
Correct you are. This is something I missed when abstracting the device
drivers [eCos drivers know nothing of the OpenBSD stack environment].
This patch oughta do the trick:
Index: io/eth/current/src/net/eth_drv.c
===================================================================
RCS file: /home/cvs/ecc/ecc/io/eth/current/src/net/eth_drv.c,v
retrieving revision 1.10
diff -u -5 -p -r1.10 eth_drv.c
--- io/eth/current/src/net/eth_drv.c 2000/12/11 16:41:27 1.10
+++ io/eth/current/src/net/eth_drv.c 2001/01/04 13:26:14
@@ -554,11 +554,13 @@ static struct mbuf *mbuf_key;
static void
eth_drv_tx_done(struct eth_drv_sc *sc, CYG_ADDRESS key, int status)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct mbuf *m0 = (struct mbuf *)key;
+
// Check for errors here (via 'status')
+ ifp->if_opackets++;
// Done with packet
mbuf_key = m0;
m_freem(m0);
// Start another if possible
eth_drv_send(ifp);
next prev parent reply other threads:[~2001-01-04 5:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-03 13:15 Grant Edwards
2001-01-04 0:15 ` Andrew Lunn
2001-01-04 0:33 ` Andrew Lunn
2001-01-04 5:28 ` Gary Thomas [this message]
2001-01-04 8:22 ` Grant Edwards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=XFMail.20010104062828.gthomas@redhat.com \
--to=gthomas@redhat.com \
--cc=andrew.lunn@ascom.ch \
--cc=ecos-discuss@sources.redhat.com \
--cc=grante@visi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).