Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136198622
D24331.id70318.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D24331.id70318.diff
View Options
Index: sys/net/if_lagg.c
===================================================================
--- sys/net/if_lagg.c
+++ sys/net/if_lagg.c
@@ -1874,10 +1874,6 @@
error = lagg_proto_start(sc, m);
LAGG_RUNLOCK();
-
- if (error != 0)
- if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
-
return (error);
}
@@ -2100,6 +2096,7 @@
* port if the link is down or the port is NULL.
*/
if ((lp = lagg_link_active(sc, lp)) == NULL) {
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
return (ENETDOWN);
}
@@ -2127,6 +2124,7 @@
{
int active_ports = 0;
int errors = 0;
+ int enc_errors = 0;
int ret;
struct lagg_port *lp, *last = NULL;
struct mbuf *m0;
@@ -2147,27 +2145,38 @@
}
ret = lagg_enqueue(last->lp_ifp, m0);
- if (ret != 0)
+ if (ret != 0) {
errors++;
+ enc_errors++;
+ }
}
last = lp;
}
if (last == NULL) {
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS,
+ errors - enc_errors);
m_freem(m);
return (ENOENT);
}
if ((last = lagg_link_active(sc, last)) == NULL) {
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS,
+ errors - enc_errors);
m_freem(m);
return (ENETDOWN);
}
ret = lagg_enqueue(last->lp_ifp, m);
- if (ret != 0)
+ if (ret != 0) {
errors++;
+ enc_errors++;
+ }
if (errors == 0)
return (ret);
+ else
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS,
+ errors - enc_errors);
return (0);
}
@@ -2192,6 +2201,7 @@
/* Use the master port if active or the next available port */
if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) {
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
return (ENETDOWN);
}
@@ -2315,6 +2325,7 @@
* port if the link is down or the port is NULL.
*/
if ((lp = lagg_link_active(sc, lp)) == NULL) {
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
return (ENETDOWN);
}
@@ -2386,6 +2397,7 @@
lp = lacp_select_tx_port(sc, m);
if (lp == NULL) {
+ if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
m_freem(m);
return (ENETDOWN);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 17, 3:19 PM (4 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25424045
Default Alt Text
D24331.id70318.diff (2 KB)
Attached To
Mode
D24331: lagg: stop double-counting output errors and counting drops as errors
Attached
Detach File
Event Timeline
Log In to Comment