mirror of https://gitee.com/openkylin/linux.git
qlcnic: Fix bug in TX statistics
o Driver was not updating TX stats so it was not populating statistics in `ifconfig` command output. Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f663dd9aaf
commit
1ac6762a0b
|
@ -1711,6 +1711,7 @@ int qlcnic_83xx_init_mailbox_work(struct qlcnic_adapter *);
|
||||||
void qlcnic_83xx_detach_mailbox_work(struct qlcnic_adapter *);
|
void qlcnic_83xx_detach_mailbox_work(struct qlcnic_adapter *);
|
||||||
void qlcnic_83xx_reinit_mbx_work(struct qlcnic_mailbox *mbx);
|
void qlcnic_83xx_reinit_mbx_work(struct qlcnic_mailbox *mbx);
|
||||||
void qlcnic_83xx_free_mailbox(struct qlcnic_mailbox *mbx);
|
void qlcnic_83xx_free_mailbox(struct qlcnic_mailbox *mbx);
|
||||||
|
void qlcnic_update_stats(struct qlcnic_adapter *);
|
||||||
|
|
||||||
/* Adapter hardware abstraction */
|
/* Adapter hardware abstraction */
|
||||||
struct qlcnic_hardware_ops {
|
struct qlcnic_hardware_ops {
|
||||||
|
|
|
@ -1267,7 +1267,7 @@ static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type)
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qlcnic_update_stats(struct qlcnic_adapter *adapter)
|
void qlcnic_update_stats(struct qlcnic_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct qlcnic_host_tx_ring *tx_ring;
|
struct qlcnic_host_tx_ring *tx_ring;
|
||||||
int ring;
|
int ring;
|
||||||
|
|
|
@ -2780,6 +2780,9 @@ static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev)
|
||||||
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
||||||
struct net_device_stats *stats = &netdev->stats;
|
struct net_device_stats *stats = &netdev->stats;
|
||||||
|
|
||||||
|
if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
|
||||||
|
qlcnic_update_stats(adapter);
|
||||||
|
|
||||||
stats->rx_packets = adapter->stats.rx_pkts + adapter->stats.lro_pkts;
|
stats->rx_packets = adapter->stats.rx_pkts + adapter->stats.lro_pkts;
|
||||||
stats->tx_packets = adapter->stats.xmitfinished;
|
stats->tx_packets = adapter->stats.xmitfinished;
|
||||||
stats->rx_bytes = adapter->stats.rxbytes + adapter->stats.lrobytes;
|
stats->rx_bytes = adapter->stats.rxbytes + adapter->stats.lrobytes;
|
||||||
|
|
Loading…
Reference in New Issue