Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
119226c5
Commit
119226c5
authored
Feb 18, 2011
by
Ben Hutchings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sfc: Expose TX push and TSO counters through ethtool statistics
Signed-off-by:
Ben Hutchings
<
bhutchings@solarflare.com
>
parent
0a6f40c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
drivers/net/sfc/ethtool.c
drivers/net/sfc/ethtool.c
+20
-1
No files found.
drivers/net/sfc/ethtool.c
View file @
119226c5
...
...
@@ -28,7 +28,8 @@ struct efx_ethtool_stat {
enum
{
EFX_ETHTOOL_STAT_SOURCE_mac_stats
,
EFX_ETHTOOL_STAT_SOURCE_nic
,
EFX_ETHTOOL_STAT_SOURCE_channel
EFX_ETHTOOL_STAT_SOURCE_channel
,
EFX_ETHTOOL_STAT_SOURCE_tx_queue
}
source
;
unsigned
offset
;
u64
(
*
get_stat
)
(
void
*
field
);
/* Reader function */
...
...
@@ -86,6 +87,10 @@ static u64 efx_get_atomic_stat(void *field)
EFX_ETHTOOL_STAT(field, channel, n_##field, \
unsigned int, efx_get_uint_stat)
#define EFX_ETHTOOL_UINT_TXQ_STAT(field) \
EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \
unsigned int, efx_get_uint_stat)
static
struct
efx_ethtool_stat
efx_ethtool_stats
[]
=
{
EFX_ETHTOOL_U64_MAC_STAT
(
tx_bytes
),
EFX_ETHTOOL_U64_MAC_STAT
(
tx_good_bytes
),
...
...
@@ -116,6 +121,10 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = {
EFX_ETHTOOL_ULONG_MAC_STAT
(
tx_non_tcpudp
),
EFX_ETHTOOL_ULONG_MAC_STAT
(
tx_mac_src_error
),
EFX_ETHTOOL_ULONG_MAC_STAT
(
tx_ip_src_error
),
EFX_ETHTOOL_UINT_TXQ_STAT
(
tso_bursts
),
EFX_ETHTOOL_UINT_TXQ_STAT
(
tso_long_headers
),
EFX_ETHTOOL_UINT_TXQ_STAT
(
tso_packets
),
EFX_ETHTOOL_UINT_TXQ_STAT
(
pushes
),
EFX_ETHTOOL_U64_MAC_STAT
(
rx_bytes
),
EFX_ETHTOOL_U64_MAC_STAT
(
rx_good_bytes
),
EFX_ETHTOOL_U64_MAC_STAT
(
rx_bad_bytes
),
...
...
@@ -470,6 +479,7 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
struct
efx_mac_stats
*
mac_stats
=
&
efx
->
mac_stats
;
struct
efx_ethtool_stat
*
stat
;
struct
efx_channel
*
channel
;
struct
efx_tx_queue
*
tx_queue
;
struct
rtnl_link_stats64
temp
;
int
i
;
...
...
@@ -495,6 +505,15 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
data
[
i
]
+=
stat
->
get_stat
((
void
*
)
channel
+
stat
->
offset
);
break
;
case
EFX_ETHTOOL_STAT_SOURCE_tx_queue
:
data
[
i
]
=
0
;
efx_for_each_channel
(
channel
,
efx
)
{
efx_for_each_channel_tx_queue
(
tx_queue
,
channel
)
data
[
i
]
+=
stat
->
get_stat
((
void
*
)
tx_queue
+
stat
->
offset
);
}
break
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment