Discussion:
Let's not count unknown ethertypes as interface errors?
(too old to reply)
Martin Husemann
2020-12-12 16:00:22 UTC
Permalink
Hey folks,

since I am (still) struggling with wlan stuff I may look more often at
error counters than others - or have you ever noticed that the wifi
device in your NetBSD notebook shows tons of (and ever increasing)
error counts?
ifconfig -v athn0 | fgrep input
input: 2343 packets, 186818 bytes, 479 multicasts, 258 errors

and it will steadily increase while I keep typing over that connection.

This is a very normal condition and no actual errors involved - I am using
wpa_supplicant and this causes 802.1x frames to be sent/received.
Now our kernel does not do anything with them, but here:

https://nxr.netbsd.org/xref/src/sys/net/if_ethersubr.c#928

it drops the packet, frees the mbuf chain, but also:

951 drop:
952 m_freem(m);
953 dropped:
954 if_statinc(ifp, if_ierrors); /* XXX should have a dedicated counter? */

increments the input error count - and I think that is wrong, as the XXX
comment hints.

Several easy solutions:
- like the comment says: create a special "unknown protocols" counter
and use that for this case, leaving the other "goto drop;" in that
function still increase ierrors
- just delete the last line (if_statinc) here - no real error to be seen,
just ignore it silentely
- as above, but conditionalize it on some net.$whatever debug sysctl
setting

I would go for the most easy way (2nd suggestion, just delete it).

What do you think?

Martin
P.S.: after being done with this message, my counter now says:
input: 8766 packets, 1079266 bytes, 1388 multicasts, 737 errors


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Greg Troxel
2020-12-12 17:34:43 UTC
Permalink
Martin Husemann <***@duskware.de> writes:

I agree that this is not an error.
Post by Martin Husemann
- like the comment says: create a special "unknown protocols" counter
and use that for this case, leaving the other "goto drop;" in that
function still increase ierrors
- just delete the last line (if_statinc) here - no real error to be seen,
just ignore it silentely
- as above, but conditionalize it on some net.$whatever debug sysctl
setting
I would go for the most easy way (2nd suggestion, just delete it).
There is if_noproto already, sys/net/if_stats.h line 51.

It is used in vlan, ppp, gre and others for more or less "the next-layer
field has a value we don't handle" which is exactly what's going on
here. So please just change to if_noproto instead (and you can drop the
comment even).
Ryota Ozaki
2020-12-22 10:23:40 UTC
Permalink
Post by Greg Troxel
I agree that this is not an error.
Post by Martin Husemann
- like the comment says: create a special "unknown protocols" counter
and use that for this case, leaving the other "goto drop;" in that
function still increase ierrors
- just delete the last line (if_statinc) here - no real error to be seen,
just ignore it silentely
- as above, but conditionalize it on some net.$whatever debug sysctl
setting
I would go for the most easy way (2nd suggestion, just delete it).
There is if_noproto already, sys/net/if_stats.h line 51.
It is used in vlan, ppp, gre and others for more or less "the next-layer
field has a value we don't handle" which is exactly what's going on
here. So please just change to if_noproto instead (and you can drop the
comment even).
+1 for now

I'll revisit there if I have spare time...

Thanks,
ozaki-r

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Michael van Elst
2020-12-12 19:17:20 UTC
Permalink
Post by Martin Husemann
- like the comment says: create a special "unknown protocols" counter
and use that for this case, leaving the other "goto drop;" in that
function still increase ierrors
- just delete the last line (if_statinc) here - no real error to be seen,
just ignore it silentely
We only have one (input) interface error counter, and that counts dropped
packets for many reasons.

So either you need another per-interface counter to distinguish
the reason why things got dropped, probably too much of a change,
or keep the single counter for all reasons.

I would add a global counter and/or a histogram to report "unknown protocols"
(or all protocols).
--
--
Michael van Elst
Internet: ***@serpens.de
"A potential Snark may lurk in every tree."

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...