Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libethernet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HAL
libethernet
Commits
2a333afc
Commit
2a333afc
authored
5 years ago
by
Oussama Ghorbel
Committed by
Anjan Chanda
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
libethernet: bcm : read extended stats from proc
parent
ba7c1395
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bcm/bcm.c
+8
-7
8 additions, 7 deletions
bcm/bcm.c
ethernet.c
+2
-1
2 additions, 1 deletion
ethernet.c
with
10 additions
and
8 deletions
bcm/bcm.c
+
8
−
7
View file @
2a333afc
...
...
@@ -4,6 +4,7 @@
* Copyright (C) 2018 iopsys Software Solutions AB. All rights reserved.
*
* Author: anjan.chanda@iopsys.eu
* oussama.ghorbel@iopsys.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -225,10 +226,10 @@ static int bcm_eth_get_stats_from_proc(const char *ifname, struct eth_stats *s)
unsigned
long
rx_fifo
,
rx_frame
,
rx_comp
,
rx_multi
;
unsigned
long
tx_bytes
,
tx_packets
,
tx_err
,
tx_drop
;
unsigned
long
tx_fifo
,
tx_coll
,
tx_carr
,
tx_comp
;
unsigned
long
tx_mcast_packets
,
rx_mcast_bytes
,
tx_mcast_bytes
;
unsigned
long
rx_ucast_packets
,
tx_ucast_packets
;
unsigned
long
rx_bcast_packets
,
tx_bcast_packets
;
unsigned
long
rx_err_unknown
;
unsigned
long
tx_mcast_packets
=
0
,
rx_mcast_bytes
=
0
,
tx_mcast_bytes
=
0
;
unsigned
long
rx_ucast_packets
=
0
,
tx_ucast_packets
=
0
;
unsigned
long
rx_bcast_packets
=
0
,
tx_bcast_packets
=
0
;
unsigned
long
rx_err_unknown
=
0
;
char
cmdbuf
[
512
]
=
{
0
};
char
*
ptr
;
int
ret
;
...
...
@@ -253,7 +254,7 @@ static int bcm_eth_get_stats_from_proc(const char *ifname, struct eth_stats *s)
&
rx_bcast_packets
,
&
tx_bcast_packets
,
&
rx_err_unknown
);
if
(
ret
!=
1
2
)
if
(
ret
<
1
6
)
return
-
1
;
s
->
tx_bytes
=
tx_bytes
;
...
...
@@ -262,14 +263,14 @@ static int bcm_eth_get_stats_from_proc(const char *ifname, struct eth_stats *s)
s
->
rx_packets
=
rx_packets
;
s
->
tx_errors
=
tx_err
;
s
->
rx_errors
=
rx_err
;
s
->
tx_discard_packets
=
tx_drop
;
s
->
rx_discard_packets
=
rx_drop
;
s
->
tx_ucast_packets
=
tx_ucast_packets
;
s
->
rx_ucast_packets
=
rx_ucast_packets
;
s
->
tx_mcast_packets
=
tx_mcast_packets
;
s
->
rx_mcast_packets
=
INVALID_UINT32
;
/* 'rx_mcast_bytes' available */
s
->
tx_bcast_packets
=
tx_bcast_packets
;
s
->
rx_bcast_packets
=
rx_bcast_packets
;
s
->
tx_discard_packets
=
tx_drop
;
s
->
rx_discard_packets
=
rx_drop
;
s
->
rx_unknown_packets
=
rx_err_unknown
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
ethernet.c
+
2
−
1
View file @
2a333afc
...
...
@@ -55,10 +55,11 @@ const struct eth_ops *get_eth_driver(const char *ifname)
{
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
eth_ops
)
/
sizeof
(
eth_ops
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
eth_ops
)
/
sizeof
(
eth_ops
[
0
]);
i
++
)
{
if
(
!
strncmp
(
eth_ops
[
i
]
->
ifname
,
ifname
,
strlen
(
eth_ops
[
i
]
->
ifname
)))
return
eth_ops
[
i
];
}
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment