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
21f8ec98
Commit
21f8ec98
authored
2 years ago
by
Artee Roy
Committed by
Sukru Senli
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
libethernet: Support for 64 bit counters.
parent
95aea2e2
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
+16
-10
16 additions, 10 deletions
bcm/bcm.c
ethernet.h
+15
-15
15 additions, 15 deletions
ethernet.h
with
31 additions
and
25 deletions
bcm/bcm.c
+
16
−
10
View file @
21f8ec98
...
@@ -222,14 +222,14 @@ int bcm_eth_reset_phy(const char *name, int phy_id)
...
@@ -222,14 +222,14 @@ int bcm_eth_reset_phy(const char *name, int phy_id)
static
int
bcm_eth_get_stats_from_proc
(
const
char
*
ifname
,
struct
eth_stats
*
s
)
static
int
bcm_eth_get_stats_from_proc
(
const
char
*
ifname
,
struct
eth_stats
*
s
)
{
{
u
nsigned
long
rx_bytes
,
rx_packets
,
rx_err
,
rx_drop
;
u
int64_t
rx_bytes
,
rx_packets
,
rx_err
,
rx_drop
;
u
nsigned
long
rx_fifo
,
rx_frame
,
rx_comp
,
rx_multi
;
u
int64_t
rx_fifo
,
rx_frame
,
rx_comp
,
rx_multi
;
u
nsigned
long
tx_bytes
,
tx_packets
,
tx_err
,
tx_drop
;
u
int64_t
tx_bytes
,
tx_packets
,
tx_err
,
tx_drop
;
u
nsigned
long
tx_fifo
,
tx_coll
,
tx_carr
,
tx_comp
;
u
int64_t
tx_fifo
,
tx_coll
,
tx_carr
,
tx_comp
;
u
nsigned
long
tx_mcast_packets
=
0
,
rx_mcast_bytes
=
0
,
tx_mcast_bytes
=
0
;
u
int64_t
tx_mcast_packets
=
0
,
rx_mcast_bytes
=
0
,
tx_mcast_bytes
=
0
;
u
nsigned
long
rx_ucast_packets
=
0
,
tx_ucast_packets
=
0
;
u
int64_t
rx_ucast_packets
=
0
,
tx_ucast_packets
=
0
;
u
nsigned
long
rx_bcast_packets
=
0
,
tx_bcast_packets
=
0
;
u
int64_t
rx_bcast_packets
=
0
,
tx_bcast_packets
=
0
;
u
nsigned
long
rx_err_unknown
=
0
;
u
int64_t
rx_err_unknown
=
0
;
char
cmdbuf
[
512
]
=
{
0
};
char
cmdbuf
[
512
]
=
{
0
};
char
*
ptr
;
char
*
ptr
;
int
ret
;
int
ret
;
...
@@ -243,8 +243,14 @@ static int bcm_eth_get_stats_from_proc(const char *ifname, struct eth_stats *s)
...
@@ -243,8 +243,14 @@ static int bcm_eth_get_stats_from_proc(const char *ifname, struct eth_stats *s)
ptr
=
cmdbuf
+
strlen
(
ifname
)
+
strlen
(
":"
);
ptr
=
cmdbuf
+
strlen
(
ifname
)
+
strlen
(
":"
);
ret
=
sscanf
(
ptr
,
ret
=
sscanf
(
ptr
,
" %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu"
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu"
,
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
" %"
SCNu64
,
&
rx_bytes
,
&
rx_packets
,
&
rx_err
,
&
rx_drop
,
&
rx_bytes
,
&
rx_packets
,
&
rx_err
,
&
rx_drop
,
&
rx_fifo
,
&
rx_frame
,
&
rx_comp
,
&
rx_multi
,
&
rx_fifo
,
&
rx_frame
,
&
rx_comp
,
&
rx_multi
,
&
tx_bytes
,
&
tx_packets
,
&
tx_err
,
&
tx_drop
,
&
tx_bytes
,
&
tx_packets
,
&
tx_err
,
&
tx_drop
,
...
...
This diff is collapsed.
Click to expand it.
ethernet.h
+
15
−
15
View file @
21f8ec98
...
@@ -109,21 +109,21 @@ enum eth_callstatus {
...
@@ -109,21 +109,21 @@ enum eth_callstatus {
};
};
struct
eth_stats
{
struct
eth_stats
{
u
nsigned
long
tx_bytes
;
u
int64_t
tx_bytes
;
u
nsigned
long
rx_bytes
;
u
int64_t
rx_bytes
;
u
nsigned
long
tx_packets
;
u
int64_t
tx_packets
;
u
nsigned
long
rx_packets
;
u
int64_t
rx_packets
;
uint
32
_t
tx_errors
;
/* error packets */
uint
64
_t
tx_errors
;
/* error packets */
uint
32
_t
rx_errors
;
uint
64
_t
rx_errors
;
u
nsigned
long
tx_ucast_packets
;
/* unicast packets */
u
int64_t
tx_ucast_packets
;
/* unicast packets */
u
nsigned
long
rx_ucast_packets
;
u
int64_t
rx_ucast_packets
;
u
nsigned
long
tx_mcast_packets
;
/* multicast packets */
u
int64_t
tx_mcast_packets
;
/* multicast packets */
u
nsigned
long
rx_mcast_packets
;
u
int64_t
rx_mcast_packets
;
u
nsigned
long
tx_bcast_packets
;
/* broadcast packets */
u
int64_t
tx_bcast_packets
;
/* broadcast packets */
u
nsigned
long
rx_bcast_packets
;
u
int64_t
rx_bcast_packets
;
uint
32
_t
tx_discard_packets
;
/* no error packets dropped */
uint
64
_t
tx_discard_packets
;
/* no error packets dropped */
uint
32
_t
rx_discard_packets
;
/* no error packets dropped */
uint
64
_t
rx_discard_packets
;
/* no error packets dropped */
uint
32
_t
rx_unknown_packets
;
/* unknown protocol packets */
uint
64
_t
rx_unknown_packets
;
/* unknown protocol packets */
};
};
/* struct eth_vlan - vlan over eth_link */
/* struct eth_vlan - vlan over eth_link */
...
...
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