mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
netdev: Add queue stats for TX stop and wake
TX queue stop and wake are counted by some drivers. Support reporting these via netdev-genl queue stats. Signed-off-by: Daniel Jurgens <danielj@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jason Xing <kerneljasonxing@gmail.com> Link: https://lore.kernel.org/r/20240510201927.1821109-2-danielj@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c084ebd77a
commit
b56035101e
@ -439,6 +439,20 @@ attribute-sets:
|
|||||||
Number of the packets dropped by the device due to the transmit
|
Number of the packets dropped by the device due to the transmit
|
||||||
packets bitrate exceeding the device rate limit.
|
packets bitrate exceeding the device rate limit.
|
||||||
type: uint
|
type: uint
|
||||||
|
-
|
||||||
|
name: tx-stop
|
||||||
|
doc: |
|
||||||
|
Number of times driver paused accepting new tx packets
|
||||||
|
from the stack to this queue, because the queue was full.
|
||||||
|
Note that if BQL is supported and enabled on the device
|
||||||
|
the networking stack will avoid queuing a lot of data at once.
|
||||||
|
type: uint
|
||||||
|
-
|
||||||
|
name: tx-wake
|
||||||
|
doc: |
|
||||||
|
Number of times driver re-started accepting send
|
||||||
|
requests to this queue from the stack.
|
||||||
|
type: uint
|
||||||
|
|
||||||
operations:
|
operations:
|
||||||
list:
|
list:
|
||||||
|
@ -41,6 +41,9 @@ struct netdev_queue_stats_tx {
|
|||||||
u64 hw_gso_wire_bytes;
|
u64 hw_gso_wire_bytes;
|
||||||
|
|
||||||
u64 hw_drop_ratelimits;
|
u64 hw_drop_ratelimits;
|
||||||
|
|
||||||
|
u64 stop;
|
||||||
|
u64 wake;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,6 +165,8 @@ enum {
|
|||||||
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS,
|
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS,
|
||||||
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES,
|
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES,
|
||||||
NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS,
|
NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS,
|
||||||
|
NETDEV_A_QSTATS_TX_STOP,
|
||||||
|
NETDEV_A_QSTATS_TX_WAKE,
|
||||||
|
|
||||||
__NETDEV_A_QSTATS_MAX,
|
__NETDEV_A_QSTATS_MAX,
|
||||||
NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
|
NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
|
||||||
|
@ -517,7 +517,9 @@ netdev_nl_stats_write_tx(struct sk_buff *rsp, struct netdev_queue_stats_tx *tx)
|
|||||||
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_GSO_BYTES, tx->hw_gso_bytes) ||
|
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_GSO_BYTES, tx->hw_gso_bytes) ||
|
||||||
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS, tx->hw_gso_wire_packets) ||
|
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS, tx->hw_gso_wire_packets) ||
|
||||||
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES, tx->hw_gso_wire_bytes) ||
|
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES, tx->hw_gso_wire_bytes) ||
|
||||||
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS, tx->hw_drop_ratelimits))
|
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS, tx->hw_drop_ratelimits) ||
|
||||||
|
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_STOP, tx->stop) ||
|
||||||
|
netdev_stat_put(rsp, NETDEV_A_QSTATS_TX_WAKE, tx->wake))
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -165,6 +165,8 @@ enum {
|
|||||||
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS,
|
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS,
|
||||||
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES,
|
NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES,
|
||||||
NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS,
|
NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS,
|
||||||
|
NETDEV_A_QSTATS_TX_STOP,
|
||||||
|
NETDEV_A_QSTATS_TX_WAKE,
|
||||||
|
|
||||||
__NETDEV_A_QSTATS_MAX,
|
__NETDEV_A_QSTATS_MAX,
|
||||||
NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
|
NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user